New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't parse when there are more than one \sum or \inf in an equation #984

Closed
bitmingw opened this Issue Dec 25, 2014 · 2 comments

Comments

Projects
None yet
2 participants
@bitmingw

bitmingw commented Dec 25, 2014

Issue Summary

When using the library for my webpage, I notice that if there are more than one \sum or \inf notations in a single equation, library will not render the result.

Cases

For example, this equation can be rendered properly:

$$
\bar x = \underset{x}\arg \min \sum_{i=1}^{n} \left( x - x_i \right)
$$

But when there are two \sum in a equation, MathJax won't work:

$$
SE = \sum_{j=1}^{\infty} \sum_{k=1}^{\infty} x_{jk}
$$

The same thing happens when two \int are used in a equation:

$$
w = \int_{0}^{\infty} \int_{0}^{\infty} x \mathop{dx}
$$

Even the combination of \inf and \sum will not produce a proper result.

Environment

I use MathJax library by including the script:

<script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
@dpvc

This comment has been minimized.

Show comment
Hide comment
@dpvc

dpvc Dec 26, 2014

Member

This type of problem is frequently due to the content management system you are using interfering wit the TeX code. I suspect that your system uses the underscore (_) to indicate italics when it appears at the beginning and ending of a phrase, and that in the second and third equations the underscores cause a portion of the math to be converted to <em>...</em> or a similar construction, while the first does not. The difference between them has nothing to do with the \int or \sum, but with what precedes and follows the _. In the first equation, the second underscore is between two letters (not considered the end of a word), while in the other two, it is followed by a brace (a non-letter).

This is not a MathJax issue, but a problem with your content management system. You may be able to get around it by escaping the underscores (e.g., \_), but it will depend on the system you are using. You may also be able to put the math into a "verbatim" mode (if your system has one) so that it will not alter the contents of the LaTeX notation.

Member

dpvc commented Dec 26, 2014

This type of problem is frequently due to the content management system you are using interfering wit the TeX code. I suspect that your system uses the underscore (_) to indicate italics when it appears at the beginning and ending of a phrase, and that in the second and third equations the underscores cause a portion of the math to be converted to <em>...</em> or a similar construction, while the first does not. The difference between them has nothing to do with the \int or \sum, but with what precedes and follows the _. In the first equation, the second underscore is between two letters (not considered the end of a word), while in the other two, it is followed by a brace (a non-letter).

This is not a MathJax issue, but a problem with your content management system. You may be able to get around it by escaping the underscores (e.g., \_), but it will depend on the system you are using. You may also be able to put the math into a "verbatim" mode (if your system has one) so that it will not alter the contents of the LaTeX notation.

@bitmingw

This comment has been minimized.

Show comment
Hide comment
@bitmingw

bitmingw Dec 29, 2014

By escaping \_ the system can render equations correctly, thank you!

bitmingw commented Dec 29, 2014

By escaping \_ the system can render equations correctly, thank you!

@bitmingw bitmingw closed this Dec 29, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment