Idea for using inline equations with dollar signs

22 views
Skip to first unread message

Kalid Azad

unread,
May 1, 2014, 2:22:05 AM5/1/14
to mathja...@googlegroups.com
Regular dollar signs ($x^2$) are problematic for inline math because they can trigger on text like $123.45 + $6.78.

I like the convenience of a single symbol, so my workaround was to require a space on either side of the dollar sign, like so:

<script type="text/x-mathjax-config">MathJax.Hub.Config({
    tex2jax:{
        inlineMath:[[' $','$ ']],
    },
    styles: {
        "span.MathJax" : {
            "margin" : "0em 0.4em"
        }
    }
});
</script>

The spaces are removed by mathjax, but re-added via CSS. This allows very readable $x^2$, and is unlikely to trigger on currency. Allowing inlineMath to take regular expressions (not just text strings) would allow for even more control.

Hope this helps someone,

-Kalid

j.shub...@gmail.com

unread,
Jun 16, 2014, 9:54:21 AM6/16/14
to mathja...@googlegroups.com
It seems in latest Mathjax display is set block !important. I need to implement inline. How to do it. Setting display to inline in custom css is not helping. Please any idea how to solve this. Thank you
Reply all
Reply to author
Forward
0 new messages