Mathjax + pandoc + reveal.js equation rendering works only for local mathjax src

471 views
Skip to first unread message

kord...@googlemail.com

unread,
Jul 23, 2016, 6:52:13 AM7/23/16
to MathJax Users
I convert my markdown files to reveal.js presentation using pandoc (I'm on a mac):

pandoc -s -S -t revealjs --mathjax -o test.html test.md

Unfortunately horizontal lines (e.g. in \frac{}{} or \sqrt{} environments) seem to be offset and equations look garbled. Using a local version of mathjax everything looks fine, i.e.

pandoc -s -S -t revealjs --mathjax="MathJax/MathJax.js?config=TeX-AMS-MML_HTMLorMML" -o test.html test.md

I attached the markdown file and the html presentation using the remote source of Mathjax.

It would be great if you can tell me whats going on here. Thanks a lot.

test.html
test.md

Davide Cervone

unread,
Jul 23, 2016, 8:59:16 AM7/23/16
to mathja...@googlegroups.com
Your example is not self-contained, as you have not arranged for the javascript of CSS to be loaded, so the result we get probably isn’t the same as what you get.  I suspect there is something in your CSS that is affecting it, but I can’t tell, since I don’t have the CSS.  Perhaps you can arrange a codebin or jsfiddle example that loads the CSS and JS from your site.  Without that your example renders correctly for me.

Note also that you should indicate the browser and OS that you are using, especially when there are display issues.

Davide


--
You received this message because you are subscribed to the Google Groups "MathJax Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mathjax-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
<test.html><test.md>

kord...@googlemail.com

unread,
Jul 23, 2016, 9:25:14 AM7/23/16
to MathJax Users
Thanks for the answer. I am using OSX 10.11.5 and tested this both in Safari and Chrome.
My understanding from reading the pandoc manual is that mathjax does not work self-contained.

I am using an unmodified version of https://github.com/hakimel/reveal.js/

I am completely new to JS and css files and not exactly sure how I could assist you now.

Thanks!

Davide Cervone

unread,
Jul 25, 2016, 10:10:41 AM7/25/16
to mathja...@googlegroups.com
Reveal’s CSS that is supposed to reset the HTML elements to a known font, baseline, etc. is overriding MathJax’s CommonHTML styles (presumably the ".reveal span" selector is more specific than MathJax’s ".mjx-char" and other similar selectors.  I would recommend removing the ".reveal span” from the list of resets in the reveal.js/css/reveal.css file.  The values given should be the defaults for a span already, and unless you are setting your own CSS that would override that, I don’t think that will cause any problems.

Davide

kord...@googlemail.com

unread,
Jul 28, 2016, 2:37:18 AM7/28/16
to MathJax Users
Great, that worked!

Thanks a lot.
Reply all
Reply to author
Forward
0 new messages