Jelajahi Sumber

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
Ihor Radchenko 3 tahun lalu
induk
melakukan
df1814b83e
1 mengubah file dengan 6 tambahan dan 5 penghapusan
  1. 6 5
      lisp/ox-html.el

+ 6 - 5
lisp/ox-html.el

@@ -2873,11 +2873,12 @@ INFO is a plist containing export properties."
 	;; temporary buffer so that dvipng/imagemagick can properly
 	;; turn the fragment into an image.
 	(setq latex-frag (concat latex-header latex-frag))))
-    (with-temp-buffer
-      (insert latex-frag)
-      (org-format-latex cache-relpath nil nil cache-dir nil
-			"Creating LaTeX Image..." nil processing-type)
-      (buffer-string))))
+    (org-export-with-buffer-copy
+     (erase-buffer)
+     (insert latex-frag)
+     (org-format-latex cache-relpath nil nil cache-dir nil
+		       "Creating LaTeX Image..." nil processing-type)
+     (buffer-string))))
 
 (defun org-html--wrap-latex-environment (contents _ &optional caption label)
   "Wrap CONTENTS string within appropriate environment for equations.