浏览代码

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 年之前
父节点
当前提交
94dbeedd4a
共有 1 个文件被更改,包括 3 次插入1 次删除
  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)
   "Insert the user setup into the mathjax template.
 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)
 	  (options org-html-mathjax-options)
 	  (in-buffer (or (plist-get info :html-mathjax) ""))