Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Inline MathJax not working with PageDown

I'm trying to implement PageDown and MathJax in my Django application. I followed insctructions here.
My code is working properly and Mathjax is running as it should, except that it doesn't render inline equations.

I've added all required files(Markdown Converter, Markdown Sanitizer, Markdown Editor, Mathjax and Mathjax editing - as described in tutorial)

I'm initializing plugins with code:

var converter1 = Markdown.getSanitizingConverter();

            converter1.hooks.chain("preBlockGamut", function (text, rbg) {
                return text.replace(/^ {0,3}""" *\n((?:.*?\n)+?) {0,3}""" *$/gm, function (whole, inner) {
                    return "<blockquote>" + rbg(inner) + "</blockquote>\n";
                });
            });

            var editor1 = new Markdown.Editor(converter1);
            var postfix = "";
            euni.mathjaxEditing.prepareWmdForMathJax(editor1, postfix, [["$", "$"], ["\\\\(","\\\\)"]]);

            editor1.run();

How can i get Mathjax to render inline equations?
As mentioned above, thing like $$2x+5$$ work as expected?

like image 929
intelis Avatar asked May 31 '15 00:05

intelis


1 Answers

You have to enable inline equations:

MathJax.Hub.Config({
 tex2jax: {
  inlineMath: [ ['$','$'], ["\\(","\\)"] ],
  processEscapes: true
}

});

See this older post: https://tex.stackexchange.com/questions/27633/mathjax-inline-mode-not-rendering

like image 158
U Avalos Avatar answered Sep 27 '22 21:09

U Avalos