diff options
author | John MacFarlane <jgm@berkeley.edu> | 2017-06-18 11:41:40 +0200 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2017-06-18 11:44:21 +0200 |
commit | ec3992b2f0aef0eefb85bdb693adfd0969126f7d (patch) | |
tree | 3b5d4562f0c5d4d5b8fecebdd10403984b76b51c /src/Text/Pandoc/Writers/HTML.hs | |
parent | abd2e94f5a8c1238eebeef9b6edb91b8031507e7 (diff) | |
download | pandoc-ec3992b2f0aef0eefb85bdb693adfd0969126f7d.tar.gz |
Use revealjs's math plugin for mathjax.
This is a thin wrapper around mathjax that makes math look better
on revealjs.
See https://github.com/hakimel/reveal.js/#mathjax
We do this by setting the 'mathjax' boolean variable and
using it in the revealjs template. Also, for revealjs
and mathjax, we don't assign the usual thing to the 'math'
variable, since it's handled by mathjax config.
Closes #3743.
Diffstat (limited to 'src/Text/Pandoc/Writers/HTML.hs')
-rw-r--r-- | src/Text/Pandoc/Writers/HTML.hs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs index 7de38f49a..43c098866 100644 --- a/src/Text/Pandoc/Writers/HTML.hs +++ b/src/Text/Pandoc/Writers/HTML.hs @@ -253,7 +253,9 @@ pandocToHtml opts (Pandoc meta blocks) = do H.script ! A.src (toValue url) ! A.type_ "text/javascript" $ mempty - MathJax url -> + MathJax url + | slideVariant /= RevealJsSlides -> + -- mathjax is handled via a special plugin in revealjs H.script ! A.src (toValue url) ! A.type_ "text/javascript" $ case slideVariant of @@ -285,6 +287,10 @@ pandocToHtml opts (Pandoc meta blocks) = do (if stMath st then defField "math" (renderHtml' math) else id) $ + defField "mathjax" + (case writerHTMLMathMethod opts of + MathJax _ -> True + _ -> False) $ defField "quotes" (stQuotes st) $ maybe id (defField "toc" . renderHtml') toc $ defField "author-meta" authsMeta $ |