forked from mirrors/org-mode
org-latex-preview: Fix startup preamble generation
* lisp/org-latex-preview.el (org-latex-preview--get-preamble): When `org-startup-with-latex-preview' (or the `#+startup: latexpreview') option is set, preamble generation and precompilation fail as latex previews are generated in the clone of the current buffer created by `org-export-with-buffer-copy'. This is because org-mode is turned on in the cloned buffer, which requires creating LaTeX previews there. Not only is this unnecessary, it causes a flurry of errors since the cloned buffer is killed before the previews can be placed. Explicitly avoid org-startup-* tasks in the cloned buffer when generating the LaTeX preamble for our main Org buffer.
This commit is contained in:
parent
33c79f8e0e
commit
2835c96dcf
|
@ -1346,7 +1346,8 @@ previews."
|
||||||
"Obtain the LaTeX preview for snippet preview in BUF."
|
"Obtain the LaTeX preview for snippet preview in BUF."
|
||||||
(with-current-buffer (or buf (current-buffer))
|
(with-current-buffer (or buf (current-buffer))
|
||||||
(org-fold-core-ignore-modifications
|
(org-fold-core-ignore-modifications
|
||||||
(let ((info (org-combine-plists
|
(let ((org-inhibit-startup t)
|
||||||
|
(info (org-combine-plists
|
||||||
(org-export--get-export-attributes
|
(org-export--get-export-attributes
|
||||||
(org-export-get-backend 'latex))
|
(org-export-get-backend 'latex))
|
||||||
(org-export--get-buffer-attributes)
|
(org-export--get-buffer-attributes)
|
||||||
|
|
Loading…
Reference in New Issue