Usage of "%" in an equation

11 views
Skip to first unread message

dominic...@springer.com

unread,
May 31, 2016, 3:47:58 AM5/31/16
to MathJax Users
recently I come across an equation

$$\text{E=}\frac{\text{A <1mm}}{\text{B}}\text{in}\text{\% }$$

and MathJax displays as

Refer the "\" before "%". I am aware that the "%" is present inside \text. Just wondering it is right to show the "\" symbol in MathJax view. If I remove "\" then the rest of the Tex equation become a comment and may be invalid. How do you handle such situation?

Regards
Dominic
Auto Generated Inline Image 1

Peter Krautzberger

unread,
May 31, 2016, 4:29:22 AM5/31/16
to mathja...@googlegroups.com
Hi,

This is expected behavior. MathJax does not process macros in \text{} except to identify mathematics within it.

See https://github.com/mathjax/MathJax/issues/1473 for more discussion and links.

Regards,
Peter.


--
You received this message because you are subscribed to the Google Groups "MathJax Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mathjax-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Davide P. Cervone

unread,
May 31, 2016, 7:21:31 AM5/31/16
to mathja...@googlegroups.com
Following up on Peter's comment that MathJax doesn't process macros in text mode, it also doesn't process comments in text mode, so \text{% } does cause a comment, and will generate the correct output for you.  On the other hand, so would "\%\space" or "\%\text{ }" rather than "\text{\% }" if you want to keep something that will work in both MathJax and actual TeX.

Davide

On May 31, 2016, at 3:47 AM, dominic...@springer.com wrote:

recently I come across an equation

$$\text{E=}\frac{\text{A <1mm}}{\text{B}}\text{in}\text{\% }$$

and MathJax displays as
<Auto Generated Inline Image 1.png>

Refer the "\" before "%". I am aware that the "%" is present inside \text. Just wondering it is right to show the "\" symbol in MathJax view. If I remove "\" then the rest of the Tex equation become a comment and may be invalid. How do you handle such situation?

Regards
Dominic

--
You received this message because you are subscribed to the Google Groups "MathJax Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mathjax-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
<Auto Generated Inline Image 1.png>

Reply all
Reply to author
Forward
0 new messages