# processEscapes not working

50 views

### Davide P. Cervone

Mar 29, 2011, 2:27:10 PM3/29/11
This was originally posted to the old SourceForge user forums at

but those are not closed, so I've copied it here. Hope the formatting comes through to the google group OK. If not, I'll repost.

Davide

_________________________________________________________________

### Davide P. Cervone

Apr 9, 2011, 4:10:17 PM4/9/11
Geoff:

I finally figured out what is going on, here. It turns out that your
startup code not only loads MathJax, but also queues a call to
MathJax.Hub.Typeset. That means the page is typeset twice. Normally,
that is not a problem, as the second pass will not find any new math.
But the Typeset method calls both the preprocessors and the output
processor, and that means tex2jax runs over the page a second time.
That may not sound like a problem, but in the case of escaped dollars,
it is. Why? Because the first pass unescapes them (to turn them into
normal dollar signs) and the second then FINDS those dollars and uses
them as delimiters. Whew!

Anyway, the solution is to have tex2jax arrange things so that the
previously escaped dollars are not treated as delimiters on the second
pass. That can be done by having tex2jax enclose the dollars in a
<span> for example, which will prevent the next pass from matching it
with another dollar sign (since tex2jax requires the two delimiters to
be in the same parent element).

I haven't fixed tex2jax yet, but thought I would let you know what the
problem is. It was a challenge to isolate this one (especially since
I was taken down several blind alleys), but it should not be hard to
fix.

Davide

### Geoff Dalgas

May 26, 2011, 12:50:56 AM5/26/11
to MathJax Users
Davide,

Has there been any forward motion on this as far as a fix? In order
to render MathJax on our site I am following the documentation listed
here: http://www.mathjax.org/docs/1.1/typeset.html

which does require MathJax.Hub.Queue(["Typeset", MathJax.Hub]);

We are now using MathJax from the CDN so any fix deployed there should
fix our network of sites immediately.

Thanks for any info!

### Davide P. Cervone

May 26, 2011, 8:33:03 AM5/26/11