I have 2 input formats: "Full HTML" and "Full HTML + Mathjax".

I don't want MathJax to parse the code between the dollar symbol, in any node using "Full HTML" input filter. I haven't checked the "MathJax filter" checkbox in admin/settings/filters/ , but I have some older nodes with dollar symbols, and MathJax is reading everything between those symbols as Latex.

For example: I have $1000 and lost $500

Thanks for your help.

Comments

jpcurley25’s picture

There is a hack around this if you use /$ as an 'escape character' (instead of just $ which will signify the start a LaTeX chunk) to display a dollar sign in HTML instead of starting a chunk for LaTeX to filter. Hopefully this helps.

federico’s picture

Category: support » feature

Thanks. My site has already >3000 nodes, and it's about economics. There are a lot of $ signs, so it's impossible to go node by node replacing $ with /$.

I think that, if you don't check the "MathJax filter" in admin/settings/filters/, MathJax should be disabled for the nodes that use that filter, plus there is no way to disable it.

I'm changing this into a feature request. Please tell me If I'm wrong.

Thanks anyway.

jpcurley25’s picture

I totally agree that the dollar sign is not uncommon enough to make a good tag. New functionality may be in order.

However, have you tried to change the tag that mathjax looks for? If you look at ../modules/mathjax/mathjax.js on lines 27 and 28 shown below, you should be able to change your delimiter from $ to whatever you like. This would make your content far more robust in the future if you are able to implement it without too much hassle.

'inlineMath: [ [\'$\',\'$\'], [\'\\\\(\',\'\\\\)\'] ],' +  // look for $...$ and \(...\) as delimiters for inline math
'displayMath: [ [\'$$\',\'$$\'], [\'\\\\[\',\'\\\\]\'] ],' + // look for $$...$$ and \[...\] as delimiters for display math

On my site, I changed the '$' to '+++' on my website and it works fine and since '+++' is very unlikely to appear anywhere else, it makes a good delimiter. Perhaps there is an easy way to change this in all articles without doing it manually using flexifilter's chunk grabber and append/prepend.

Hope this helps!

federico’s picture

Thanks jpcurley! I'll implement your suggestion ASAP. Sure it helps.

cilefen’s picture

Priority: Normal » Major
cilefen’s picture

Status: Active » Closed (works as designed)

It is not possible at this stage to configure this properly with the MathJax API. Use jpcurley25's solution.