Skip to content

Commit df1814b

Browse files
committed
org-html-format-latex: Preserve buffer-local settings
* lisp/ox-html.el (org-html-format-latex): Carry over buffer-local variables when create LaTeX images. Use `org-export-with-buffer-copy' instead of `with-temp-buffer'. Fixes https://orgmode.org/list/m2fsqr75md.fsf@ego.team
1 parent 39005dc commit df1814b

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

lisp/ox-html.el

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2873,11 +2873,12 @@ INFO is a plist containing export properties."
28732873
;; temporary buffer so that dvipng/imagemagick can properly
28742874
;; turn the fragment into an image.
28752875
(setq latex-frag (concat latex-header latex-frag))))
2876-
(with-temp-buffer
2877-
(insert latex-frag)
2878-
(org-format-latex cache-relpath nil nil cache-dir nil
2879-
"Creating LaTeX Image..." nil processing-type)
2880-
(buffer-string))))
2876+
(org-export-with-buffer-copy
2877+
(erase-buffer)
2878+
(insert latex-frag)
2879+
(org-format-latex cache-relpath nil nil cache-dir nil
2880+
"Creating LaTeX Image..." nil processing-type)
2881+
(buffer-string))))
28812882

28822883
(defun org-html--wrap-latex-environment (contents _ &optional caption label)
28832884
"Wrap CONTENTS string within appropriate environment for equations.

0 commit comments

Comments
 (0)