Merge pull request #195 from acowley/latex-fragment

Wrap LaTeX environments in a div
This commit is contained in:
Yujie Wen 2016-02-23 14:51:39 +08:00
commit ada46bc9bc
1 changed files with 11 additions and 3 deletions

View File

@ -92,9 +92,7 @@
(item . org-reveal-item)
(keyword . org-reveal-keyword)
(link . org-reveal-link)
(latex-environment . (lambda (latex-env contents info)
(setq info (plist-put info :reveal-mathjax t))
(org-html-latex-environment latex-env contents info)))
(latex-environment . org-reveal-latex-environment)
(latex-fragment . (lambda (frag contents info)
(setq info (plist-put info :reveal-mathjax t))
(org-html-latex-fragment frag contents info)))
@ -854,6 +852,16 @@ the result is the Data URIs of the referenced image."
(replace-regexp-in-string "<a href=\"#" "<a href=\"#/slide-"
(org-html-link link desc info))))))
(defun org-reveal-latex-environment (latex-env contents info)
"Transcode a LaTeX environment from Org to Reveal.
LATEX-ENV is the Org element. CONTENTS is the contents of the environment. INFO is a plist holding contextual information "
(setq info (plist-put info :reveal-mathjax t))
(let ((attrs (org-export-read-attribute :attr_html latex-env)))
(format "<div%s>\n%s\n</div>\n"
(if attrs (concat " " (org-html--make-attribute-string attrs)) "")
(org-html-latex-environment latex-env contents info))))
(defun org-reveal-plain-list (plain-list contents info)
"Transcode a PLAIN-LIST element from Org to Reveal.