-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Subscript notation issue #329
Comments
I also notice a failure in a related instance. Here, it is just a single subscript, but the following:
renders fine, while adding a subscript i (_i) to the last part of the equation causes it to fail:
Using the very latest MathJax from GitHub, as well as the CDN service. |
This renders fine for me, e.g., by copy&pasting it into http://cdn.mathjax.org/mathjax/latest/test/sample-dynamic-2.html. (fyi: the first example is a missing When you say "does not work", what are you seeing? (math-processing error, not rendered as expected etc) Also, tell us you browser+version+OS, please. And, if you can, a link to an example page where the error occurs. |
So, here is a screen shot of the "not working" case: Here is the code that produces the output:
And here, when I eliminate the grouped subscript in the first case, and the last "_i" in the second, it renders: Here is the code that produces this output:
Using Safari 6 or Chrome 23 in OS X 10.8.2 Here is the MathJax configuration I have set up on the page:
|
PS, the underscore isn't missing in the first example, I just did not use a verbatim block, so it disappeared. I will fix this. |
It looks like this is an interaction between your content management system and MathJax. If you are using a Markdown engine, it probably uses underscores to denote italics (notice that material between the underscores is italicized). Since the markdown engine is running before the page is shipped (and MathJax runs after it arrives at your browser), the underscores are already removed and You don't mention what content management system you are using, but this is most likely something that needs to be dealt with at that end of things. In some cases, you can use "verbatim" mode to prevent the system from altering the mathematics. E.g., for Markdown, you might use backticks around the math. That might require altering the MathJax configuration to allow MathJax to process In any case, this doesn't look like a MathJax issue but rather a Markdown interaction with the TeX code. |
Thanks. I'm using Landslide to convert Markdown to HTML5 presentation slides. I will consult Landslide's author. |
PS backslashing the underscore seems to do the trick. |
I ran into another variant of the issue. Sometimes the underscores work without escaping them. But then they stop working when there are multiple underscores in the expression. The solution is to escape all occurences of underscores. In case of markdown add |
@vman049, you don't say which content management system (CMS) you are using, and since this is really a question about the CMS more than it is about MathJax, that is probably going to make a difference. You have referenced Jekyll and Hugo posts, so it is not clear which you are using. Your third reference is to the official recommendation of how to handle MathJax in Hugo, so if you are using Hugo, that shows how to be able to use the same notation within inline and display math. You also don't say what the actual result is in displayed equations, e.g., whether the underscore is displayed as a literal underscore, for example. If so, it is probably also possible to define
so that |
Just wanted to mention for anyone coming here from Google, I was able to solve this issue in hugo by wrapping my mathjax in |
In my case, the |
Inline math expression: Block math expression: Summation superscript is okay! Any workarounds? |
@prasanth-ntu, if you are workin in GitHub, their implementation of MathJax has a number of serious issues, and if I recall correctly, this is one of them. If you are not using Mathjax on GitHub, then can you point us to a page that exhibits the problem? |
@dpvc I am relatively new to writing/rendering math expressions in GitHub Markdown, as so far I have been either using Jupyter Markdowns or Latex directly to render them. |
It is not an issue with MathJax, it is an issue with how GitHub connects their markdown to MathJax. In this case, they are filtering attributes from the MathJax output, and have removed ones that are critical to the layout. That is not MathJax's fault, and is out of our control. Unfortunately, users don't have the ability to change how GitHub Markdown handles that. The only option I know of is to petition GitHub to correct their implementation. There is a discussion board where issues are listed, and a bug report system that you can use. This is something that GitHub will have to address, not MathJax. |
When I try to use the grouped subscript notation ("_{}"), Mathjax does render it. For example:
does not work because of the "_{1i}" subscripts. If I just use a single subscript, like "X_i", it works fine.
The text was updated successfully, but these errors were encountered: