Browse Source

ox-html.el (org-html--build-mathjax-config): Do not always include MathJax configuration

* ox-html.el (org-html--build-mathjax-config): Only include
MathJax configuration if the resulting HTML contains LaTeX
fragments.
Bastien Guerry 12 years ago
parent
commit
94dbeedd4a
1 changed files with 3 additions and 1 deletions
  1. 3 1
      lisp/ox-html.el

+ 3 - 1
lisp/ox-html.el

@@ -1268,7 +1268,9 @@ INFO is a plist used as a communication channel."
 (defun org-html--build-mathjax-config (info)
 (defun org-html--build-mathjax-config (info)
   "Insert the user setup into the mathjax template.
   "Insert the user setup into the mathjax template.
 INFO is a plist used as a communication channel."
 INFO is a plist used as a communication channel."
-  (when (memq (plist-get info :with-latex) '(mathjax t))
+  (when (and (memq (plist-get info :with-latex) '(mathjax t))
+	     (org-element-map (plist-get info :parse-tree)
+		 '(latex-fragment) 'identity info t))
     (let ((template org-html-mathjax-template)
     (let ((template org-html-mathjax-template)
 	  (options org-html-mathjax-options)
 	  (options org-html-mathjax-options)
 	  (in-buffer (or (plist-get info :html-mathjax) ""))
 	  (in-buffer (or (plist-get info :html-mathjax) ""))