summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2017-06-25 09:39:32 +0200
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2017-06-25 09:39:32 +0200
commite903288e5080775cbd4d87c69deeba3268cda5c1 (patch)
tree23a76e3e96dc32ea4357c077adeb9b13fd593f26
parent7ca34d2aef42aad1d48692b58f51514e61204fd6 (diff)
downloadorg-mode-e903288e5080775cbd4d87c69deeba3268cda5c1.tar.gz
ox-latex: Fix LATEX_HEADER_EXTRA keyword
* lisp/ox-latex.el (org-latex-make-preamble): Do not include LATEX_HEADER_EXTRA keywords' contents when previewing a LaTeX fragment. Reported-by: Mario Román <mromang08@gmail.com> <http://lists.gnu.org/archive/html/emacs-orgmode/2017-06/msg00477.html>
-rw-r--r--lisp/ox-latex.el18
1 files changed, 10 insertions, 8 deletions
diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el
index f11a8a6..ec4b495 100644
--- a/lisp/ox-latex.el
+++ b/lisp/ox-latex.el
@@ -1623,15 +1623,15 @@ non-nil, only includes packages relevant to image generation, as
specified in `org-latex-default-packages-alist' or
`org-latex-packages-alist'."
(let* ((class (plist-get info :latex-class))
- (class-options (plist-get info :latex-class-options))
- (header (nth 1 (assoc class (plist-get info :latex-classes))))
(class-template
(or template
- (and (stringp header)
- (if (not class-options) header
- (replace-regexp-in-string
- "^[ \t]*\\\\documentclass\\(\\(\\[[^]]*\\]\\)?\\)"
- class-options header t nil 1)))
+ (let* ((class-options (plist-get info :latex-class-options))
+ (header (nth 1 (assoc class (plist-get info :latex-classes)))))
+ (and (stringp header)
+ (if (not class-options) header
+ (replace-regexp-in-string
+ "^[ \t]*\\\\documentclass\\(\\(\\[[^]]*\\]\\)?\\)"
+ class-options header t nil 1))))
(user-error "Unknown LaTeX class `%s'" class))))
(org-latex-guess-polyglossia-language
(org-latex-guess-babel-language
@@ -1644,7 +1644,9 @@ specified in `org-latex-default-packages-alist' or
snippet?
(mapconcat #'org-element-normalize-string
(list (plist-get info :latex-header)
- (plist-get info :latex-header-extra)) ""))))
+ (and (not snippet?)
+ (plist-get info :latex-header-extra)))
+ ""))))
info)
info)))