# [IPython-dev] mathjax not rendering in notebook

Brian Granger ellisonbg@gmail....
Mon Aug 13 19:59:57 CDT 2012

Can we move this discussion to the issue we have open about problems
with mathjax rendering in the notebook as it relates to markdown.

On Mon, Aug 13, 2012 at 12:37 PM, Matthias BUSSONNIER
<bussonniermatthias@gmail.com> wrote:
>
>> Thanks - yes - the pointer to the Chrome developer panel got me a
>> little further.
>>
>> I think what is happening is that some other script (?markdown) is
>> getting to the TeX before it gets to mathjax.
>>
>> Specifically, if I put the mal-functioning TeX into a cell:
>>
>> $$>> \begin{array}{c} >> y_1 \cr >> y_2 \mathtt{t}_i \cr >> y_{3} >> \end{array} >>$$
>>
>> and put a breakpoint on the line:
>>
>> MathJax.Hub.Queue(["Typeset",MathJax.Hub]);
>>
>> in cell.js, the html in the cell before rendering is this:
>>
>> <p>$$>> \begin{array}{c} >> y_1 \cr >> y_2 \mathtt{t}<em>i \cr >> y</em>{3} >> \end{array} >>$$</p>
>>
>> Notice the stray <em> .. </em> tags.  If I do a tiny edit to the
>> malfunctioning TeX so that it renders correctly (removing the {} round
>> the last '3'):
>
> Ah ! Yes, that should be markdown _smth_ is the way to emphases stuff.
> https://github.com/ipython/ipython/issues/2289
>
> If I was looking at where markdown is processed I would look in IPython/frontend/html/notebook/static/js/textcell.js
>
> But I don't know this file very much.
>
> Thanks !
> --
> Matthias
>
>
>> $$>> \begin{array}{c} >> y_1 \cr >> y_2 \mathtt{t}_i \cr >> y_3 >> \end{array} >>$$
>>
>> then the html before MathJax gets it is:
>>
>> <p>$$>> \begin{array}{c} >> y_1 \cr >> y_2 \mathtt{t}_i \cr >> y_3 >> \end{array} >>$$</p>
>>
>> So I think something in the notebook is inserting the <em> .. </em>
>> tags into the TeX, and this is busting the rendering.   I've attached
>> a fuller output of the html before and after rendering.
>>
>> What could be doing this?  Is there a way of stopping this
>> preprocessing of TeX?  Could this also explain the need for three \
>> for end-of-line instead of two?
>>
>> Cheers,
>>
>> Matthew
>> <mathjax_io_dumps.txt>_______________________________________________
>> IPython-dev mailing list
>> IPython-dev@scipy.org
>> http://mail.scipy.org/mailman/listinfo/ipython-dev
>
> _______________________________________________
> IPython-dev mailing list
> IPython-dev@scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-dev

--
Brian E. Granger
Cal Poly State University, San Luis Obispo
bgranger@calpoly.edu and ellisonbg@gmail.com