reveal.js writer and template: reuse mathjax URL...

...provided by the argument to `--mathjax` or the normal
pandoc default, rather than a hard-coded one in the template.

Closes #4701.
This commit is contained in:
John MacFarlane 2018-06-12 09:35:27 -07:00
parent 1e45bb0041
commit 4173460689
2 changed files with 7 additions and 6 deletions

View file

@ -237,7 +237,7 @@ $if(maxScale)$
$endif$
$if(mathjax)$
math: {
mathjax: 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js',
mathjax: '$mathjaxurl$',
config: 'TeX-AMS_HTML-full',
tex2jax: {
inlineMath: [['\\(','\\)']],

View file

@ -296,10 +296,11 @@ 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) $
MathJax u -> defField "mathjax" True .
defField "mathjaxurl"
(takeWhile (/='?') u)
_ -> defField "mathjax" False) $
defField "quotes" (stQuotes st) $
-- for backwards compatibility we populate toc
-- with the contents of the toc, rather than a