Parcourir la source

Use LATEX_HEADER stuff also when previewing fragments

Carsten Dominik il y a 15 ans
Parent
commit
7050ea8d4a
3 fichiers modifiés avec 17 ajouts et 1 suppressions
  1. 8 0
      lisp/ChangeLog
  2. 1 1
      lisp/org-html.el
  3. 8 0
      lisp/org.el

+ 8 - 0
lisp/ChangeLog

@@ -1,5 +1,13 @@
 2010-01-01  Carsten Dominik  <carsten.dominik@gmail.com>
 
+	* org.el (org-format-latex-header-extra): New variable.
+	(org-format-latex): Set org-format-latex-header-extra from
+	in-buffer stuff.
+	(org-format-latex): Add org-format-latex-header-extra to the
+	variables on which image creation depends.
+	(org-create-formula-image): Add the header stuff from in-buffer
+	settings.
+
 	* org-inlinetask.el (org-inlinetask-export-handler): Add CSS class
 	for TODO keyword in inline tasks.
 

+ 1 - 1
lisp/org-html.el

@@ -420,7 +420,7 @@ This may also be a function, building and inserting the postamble.")
   "Hook run during HTML export, after blockquote, verse, center are done.")
 
 (defvar org-export-html-final-hook nil
-  "Hook run during HTML export, after blockquote, verse, center are done.")
+  "Hook run at the end of HTML export, in the new buffer.")
 
 ;;; HTML export
 

+ 8 - 0
lisp/org.el

@@ -2889,6 +2889,8 @@ appears on the page."
   :group 'org-latex
   :type 'string)
 
+(defvar org-format-latex-header-extra nil)
+
 ;; The following variable is defined here because is it also used
 ;; when formatting latex fragments.  Originally it was part of the
 ;; LaTeX exporter, which is why the name includes "export".
@@ -14798,6 +14800,8 @@ Some of the options can be changed using the variable
 	 (opt org-format-latex-options)
 	 (matchers (plist-get opt :matchers))
 	 (re-list org-latex-regexps)
+	 (org-format-latex-header-extra
+	  (plist-get (org-infile-export-plist) :latex-header-extra))
 	 (cnt 0) txt hash link beg end re e checkdir
 	 executables-checked
 	 m n block linkfile movefile ov)
@@ -14821,6 +14825,7 @@ Some of the options can be changed using the variable
 	    (let (print-length print-level) ; make sure full list is printed
 	      (setq hash (sha1 (prin1-to-string
 				(list org-format-latex-header
+				      org-format-latex-header-extra
 				      org-export-latex-packages-alist
 				      org-format-latex-options
 				      forbuffer txt)))
@@ -14900,6 +14905,9 @@ Some of the options can be changed using the variable
 						 (car p) (cadr p))))
 				     org-export-latex-packages-alist "\n"))
 		"")
+	      (if org-format-latex-header-extra
+		  (concat "\n" org-format-latex-header-extra)
+		"")
 	      "\n\\begin{document}\n" string "\n\\end{document}\n"))
     (let ((dir default-directory))
       (condition-case nil