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:
parent
1e45bb0041
commit
4173460689
2 changed files with 7 additions and 6 deletions
|
@ -237,7 +237,7 @@ $if(maxScale)$
|
||||||
$endif$
|
$endif$
|
||||||
$if(mathjax)$
|
$if(mathjax)$
|
||||||
math: {
|
math: {
|
||||||
mathjax: 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js',
|
mathjax: '$mathjaxurl$',
|
||||||
config: 'TeX-AMS_HTML-full',
|
config: 'TeX-AMS_HTML-full',
|
||||||
tex2jax: {
|
tex2jax: {
|
||||||
inlineMath: [['\\(','\\)']],
|
inlineMath: [['\\(','\\)']],
|
||||||
|
|
|
@ -259,7 +259,7 @@ pandocToHtml opts (Pandoc meta blocks) = do
|
||||||
st <- get
|
st <- get
|
||||||
notes <- footnoteSection opts (reverse (stNotes st))
|
notes <- footnoteSection opts (reverse (stNotes st))
|
||||||
let thebody = blocks' >> notes
|
let thebody = blocks' >> notes
|
||||||
let math = case writerHTMLMathMethod opts of
|
let math = case writerHTMLMathMethod opts of
|
||||||
MathJax url
|
MathJax url
|
||||||
| slideVariant /= RevealJsSlides ->
|
| slideVariant /= RevealJsSlides ->
|
||||||
-- mathjax is handled via a special plugin in revealjs
|
-- mathjax is handled via a special plugin in revealjs
|
||||||
|
@ -296,10 +296,11 @@ pandocToHtml opts (Pandoc meta blocks) = do
|
||||||
(if stMath st
|
(if stMath st
|
||||||
then defField "math" (renderHtml' math)
|
then defField "math" (renderHtml' math)
|
||||||
else id) $
|
else id) $
|
||||||
defField "mathjax"
|
(case writerHTMLMathMethod opts of
|
||||||
(case writerHTMLMathMethod opts of
|
MathJax u -> defField "mathjax" True .
|
||||||
MathJax _ -> True
|
defField "mathjaxurl"
|
||||||
_ -> False) $
|
(takeWhile (/='?') u)
|
||||||
|
_ -> defField "mathjax" False) $
|
||||||
defField "quotes" (stQuotes st) $
|
defField "quotes" (stQuotes st) $
|
||||||
-- for backwards compatibility we populate toc
|
-- for backwards compatibility we populate toc
|
||||||
-- with the contents of the toc, rather than a
|
-- with the contents of the toc, rather than a
|
||||||
|
|
Loading…
Add table
Reference in a new issue