From a54f83d2b411ae58941c32cb23fd47f38e70dc80 Mon Sep 17 00:00:00 2001 From: Benjamin Motz Date: Fri, 28 Sep 2018 16:32:59 +0200 Subject: [PATCH 1/2] Fix ob-latex to respect the keyword :headers This adds support for property :headers in org-format-latex-options. TINYCHANGE --- lisp/ob-latex.el | 8 ++++++-- lisp/org.el | 3 +++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/lisp/ob-latex.el b/lisp/ob-latex.el index 8d037090e..19e44dee5 100644 --- a/lisp/ob-latex.el +++ b/lisp/ob-latex.el @@ -108,8 +108,12 @@ This function is called by `org-babel-execute-src-block'." (append (cdr (assq :packages params)) org-latex-packages-alist))) (cond ((and (string-suffix-p ".png" out-file) (not imagemagick)) - (org-create-formula-image - body out-file org-format-latex-options in-buffer)) + (let ((latex-options (copy-tree org-format-latex-options))) + (when headers + (plist-put latex-options :headers + (append (plist-get latex-options :headers) headers))) + (org-create-formula-image + body out-file latex-options in-buffer))) ((string-suffix-p ".tikz" out-file) (when (file-exists-p out-file) (delete-file out-file)) (with-temp-file out-file diff --git a/lisp/org.el b/lisp/org.el index f3a19d643..d2ff4e41c 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -18571,6 +18571,9 @@ a HTML file." (if (string= bg "Transparent") "white" bg)))) (with-temp-file texfile (insert latex-header) + (when-let ((headers (plist-get options :headers))) + (dolist (h headers) + (insert h))) (insert "\n\\begin{document}\n" "\\definecolor{fg}{rgb}{" fg "}\n" "\\definecolor{bg}{rgb}{" bg "}\n" -- 2.18.0