Skip to content

MathJax CSS classes etc

pkra edited this page Apr 5, 2013 · 4 revisions

A frequent topic: HTML output and CSS clashing.


MathJax color and Pygments code highlighting https://groups.google.com/d/msg/mathjax-users/LgwIpABeP1A/7QhwZ8jGRm8J

it seems, that the problem is an incompatibility with pygments (http://pygments.org/) a python syntax highlighter.

It seems, that pygments and mathjax use the same (css-)classnames for styling issues. Names like ".mi" and ".mo" for example.

eg: the first "-" in my screenshot viewed as html:

And in my pygments.css file, there is a class defined like this: .mo { color: #666666 } /* Literal.Number.Oct */

Do you have any tipps for me, how i can avoid something like this?

regards,

Simon


You could perhaps use

.MathJax .mo { color: inherit }

to override the color for the MathJax output.

Davide


Thanks for your Tipp!

I've used a little bit different way. I changed every definition of the pygments-css file into: .highlight .mo { color: #666666 } /* Literal.Number.Oct */ Since every pygments element is someway a child of a highlight block.

Works great for me.

regards,

Simon


Clone this wiki locally