Browse Source

LaTeX export: More tuning for the options import

Russel Adams writes:

>  That worked, the only point I may make would be to exclude
>  LATEX_HEADER and TEXT from that list.
>
>  I'm also trying to resolve an ordering issue. I want to have a
>  header/footer line declared in the header, but I want to use these
>  orgTITLE macros in that. Currently LATEX_HEADER and the class go first
>  before the definitions, and TEXT occurs inside the document. If the
>  macro isn't defined before the header/footer, you get an error.
>
>  I may have to manually code those, which defeats the purpose of using
>  the org options.

OK, I removed those two fields, and I switched things around so that
the new macros are defined earlier.
Carsten Dominik 16 years ago
parent
commit
8bd874cd30
2 changed files with 7 additions and 3 deletions
  1. 4 0
      lisp/ChangeLog
  2. 3 3
      lisp/org-export-latex.el

+ 4 - 0
lisp/ChangeLog

@@ -1,5 +1,9 @@
 2009-02-20  Carsten Dominik  <carsten.dominik@gmail.com>
 
+	* org-export-latex.el (org-export-latex-collect-header-macros):
+	Remove fields that are used anyway.
+	(org-export-latex-make-header): Insert the options earlier.
+
 	* org-agenda.el (org-agenda-get-progress): Fix bug with state
 	matching.
 

+ 3 - 3
lisp/org-export-latex.el

@@ -745,9 +745,9 @@ OPT-PLIST is the options plist for current buffer."
 			      (car p) (cadr p))))
 		  org-export-latex-packages-alist "\n"))
      ;; insert additional commands in the header
+     opt-defs
      (plist-get opt-plist :latex-header-extra)
      org-export-latex-append-header
-     opt-defs
      ;; insert the title
      (format
       "\n\n\\title{%s}\n"
@@ -809,8 +809,8 @@ If BEG is non-nil, the is the beginning of he region."
 (defun org-export-latex-collect-header-macros (&optional title)
   "Find the various definitions in #+... lines and define TeX macros for them."
   (let ((re (org-make-options-regexp
-	     '("TITLE" "AUTHOR" "DATE" "EMAIL" "TEXT" "OPTIONS" "LANGUAGE"
-	       "LINK_UP" "LINK_HOME" "SETUPFILE" "STYLE" "LATEX_HEADER"
+	     '("TITLE" "AUTHOR" "DATE" "EMAIL" "OPTIONS" "LANGUAGE"
+	       "LINK_UP" "LINK_HOME" "SETUPFILE" "STYLE"
 	       "EXPORT_SELECT_TAGS" "EXPORT_EXCLUDE_TAGS")))
 	out key val a)
     (save-excursion