From f7e208da37aa6d0054919ba0211674de3c39599b Mon Sep 17 00:00:00 2001 From: Carsten Dominik Date: Sun, 16 Aug 2009 09:38:03 +0200 Subject: [PATCH] Make latex preview also use the packages in `org-export-latex-packages-alist'. --- lisp/ChangeLog | 6 ++++++ lisp/org-latex.el | 5 ++++- lisp/org.el | 11 +++++++++++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 22f885007..99cb82130 100755 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,11 @@ 2009-08-16 Carsten Dominik + * org-latex.el (org-export-latex-packages-alist): Fix + customization type. + + * org.el (org-create-formula-image): Also use + `org-export-latex-packages-alist'. + * org-html.el (org-export-as-html): Fix bug in footnote regexp. (org-export-as-html): Format footnotes correctly. diff --git a/lisp/org-latex.el b/lisp/org-latex.el index 1101b1180..df7212e71 100644 --- a/lisp/org-latex.el +++ b/lisp/org-latex.el @@ -247,7 +247,10 @@ When nil, grouping causes only separation lines between groups." "Alist of packages to be inserted in the header. Each cell is of the format \( \"option\" . \"package\" \)." :group 'org-export-latex - :type 'alist) + :type '(repeat + (list + (string :tag "option") + (string :tag "package")))) (defcustom org-export-latex-low-levels 'itemize "How to convert sections below the current level of sectioning. diff --git a/lisp/org.el b/lisp/org.el index ac2a30c71..50cc3eacc 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -13984,6 +13984,7 @@ The images can be removed again with \\[org-ctrl-c-ctrl-c]." ;; This function borrows from Ganesh Swami's latex2png.el (defun org-create-formula-image (string tofile options buffer) + (require 'org-latex) (let* ((tmpdir (if (featurep 'xemacs) (temp-directory) temporary-file-directory)) @@ -14005,7 +14006,17 @@ The images can be removed again with \\[org-ctrl-c-ctrl-c]." (if (eq bg 'default) (setq bg (org-dvipng-color :background))) (with-temp-file texfile (insert org-format-latex-header + (if org-export-latex-packages-alist + (concat "\n" + (mapconcat (lambda(p) + (if (equal "" (car p)) + (format "\\usepackage{%s}" (cadr p)) + (format "\\usepackage[%s]{%s}" + (car p) (cadr p)))) + org-export-latex-packages-alist "\n")) + "") "\n\\begin{document}\n" string "\n\\end{document}\n")) + (debug) (let ((dir default-directory)) (condition-case nil (progn -- 2.11.4.GIT