LaTeX Why are MathJax images not displaying on my webpage?

AI Thread Summary
MathJax has been enabled on the site, but users are experiencing issues with LaTeX images not displaying correctly, leading to frustration over the appearance and functionality. Some users report that certain LaTeX environments, like align and tabular, are not rendering properly, and there are inconsistencies in how equations appear across different browsers. The transition from image-based LaTeX to MathJax is intended to reduce server load, but users are concerned about the visual quality and usability of the new format. Feedback indicates that while MathJax can handle more equations without server strain, it may introduce rendering issues that affect the user experience. The discussion reflects a need for further adjustments and testing to optimize MathJax's implementation.
  • #301
Try using the developer tools in IE8 (hit F12) to run debugging on the script to see where the problem is cropping up.
 
Physics news on Phys.org
  • #302
Well I tried that and pressed the debug button, and although I haven't a clue as to what I was doing or did -- it worked.

At the moment I can open and close IE8 and not see any errors and Tex works again.

It remains to be seen whether this fix is permanent on restart.

I would be interest in what 'debugging' achieves though.

Thanks a bunch Vela.
 
  • #303
The suggestion wasn't meant to fix the problem but to see where and why the problem came up, so the problem probably just went away on its own for you.
 
  • #304
I am aware that the reason it now works is more likely to be some positive change made at the PF source end and that my random pressing buttons was just a coincidence.

Particularly as the fix has survived several reboots.

So thank you whoever finally got it right, I asssume someone is monitoring this thread for feedback.

There have obviously been lots of changes tried out over the last few days. PF speed and response has been highly variable.

It all seems tickety boo now.
 
  • #305
I can't remember if it was already reported or not. There are difference between engines. In some old threads LaTeX is now not displayed correctly:

https://www.physicsforums.com/showthread.php?t=124602

I haven't checked yet why, and I will probably take care about this particular thread, but it is likely that similar problems are present in different threads.

Edit: new engine doesn't like unmatching pairs of \left[ & \right] - if there are both, they are rendered correctly, but just \right] triggers an error.
 
Last edited:
  • #306
In that thread, one of the expressions that doesn't render is:

H_{2}SO_{4}_{(aq)} \rightarrow 2H^{+}_{(aq)} + SO_{4}^{2-}_{(aq)}

I tried to run it through Latex on my computer, and it threw up an error about double subscripts.
 
  • #307
Good point. I don't know LaTeX well enough, but I guess k_i_j is ambiguous, should it be k_{ij} or k_{i_j}?

I haven't checked everything, just skimmed, could be there are more errors.
 
  • #308
Borek said:
Good point. I don't know LaTeX well enough, but I guess k_i_j is ambiguous, should it be k_{ij} or k_{i_j}?

I haven't checked everything, just skimmed, could be there are more errors.

There's a third choice: {k_i}_j which I suspect was intended. :wink:
 
  • #309
No matter what was intended, it was wrong, as (aq) should be not a subscript, that's a common mistake. If memory serves me well H_2SO_{4}(aq) is the correct notation (although I am not sure at the moment whether it should or shouldn't be italicized).
 
  • #310
Borek said:
No matter what was intended, it was wrong, as (aq) should be not a subscript, that's a common mistake. If memory serves me well H_2SO_{4}(aq) is the correct notation (although I am not sure at the moment whether it should or shouldn't be italicized).

Hmm, from wikipedia (as far as that is reliable): "An aqueous solution is a solution in which the solvent is water. It is usually shown in chemical equations by appending aq as a subscript to the relevant formula."

Since it is an attribute to the chemical compound, it seems logical to me that it would be a subscript.

Where is the "common mistake"?
 
  • #311
Wikipedia is wrong and repeats a common mistake that state of aggregation should be written as a subscript. It shouldn't be. There is only one decisive source of information here, http://www.iupac.org/reports/provisional/abstract05/GreenBook051206_prs.pdf , General Chemistry section, Other symbols and conventions in chemistry (2.10.1), (vi) States of aggregation.

Note: could be there is already a newer version of Green Book, I just copied/pasted what I posted several years ago at CF.
 
Last edited by a moderator:
  • #312
Borek said:
Wikipedia is wrong and repeats a common mistake that state of aggregation should be written as a subscript. It shouldn't be. There is only one decisive source of information here, http://www.iupac.org/reports/provisional/abstract05/GreenBook051206_prs.pdf , General Chemistry section, Other symbols and conventions in chemistry (2.10.1), (vi) States of aggregation.

Note: could be there is already a newer version of Green Book, I just copied/pasted what I posted several years ago at CF.

All right. I accept that! :smile:

Btw, wikipedia now says: "An aqueous solution is a solution in which the solvent is water. It is usually shown in chemical equations by appending aq to the relevant formula." :wink:

(Next time wikipedia will be right!)
 
Last edited by a moderator:
  • #313
I like Serena said:
Btw, wikipedia now says: "An aqueous solution is a solution in which the solvent is water. It is usually shown in chemical equations by appending aq to the relevant formula." :wink:

(Next time wikipedia will be right!)


PF members in action. Outstanding. :cool:
 
  • #314
The PF Library is still using the old LaTeX processor. Could that be updated to MathJax?
 
  • #315
Redbelly98 said:
The PF Library is still using the old LaTeX processor. Could that be updated to MathJax?

ah yes thanks for reminding me
 
  • #316
Greg Bernhardt said:
ah yes thanks for reminding me
It is my pleasure to remind to you :wink:
 
  • #317
In this thread, https://www.physicsforums.com/showthread.php?t=510385, does anyone know what might have triggered the appearance of the red part? I double checked and I didn't forget to write "\par" or anything. I even made a copy paste of the "{\partial f}" that appears in the LHS of the equation and the red part still appears in the LHS. The code I used is

\sum_i\frac{\partial f}{\partial x^i}\frac{d\varphi^i_x(t)}{dt}(0)=\sum_i\frac{\partial f}{\partial x^i}X^i(x)
 
  • #318
quasar987 said:
In this thread, https://www.physicsforums.com/showthread.php?t=510385, does anyone know what might have triggered the appearance of the red part? I double checked and I didn't forget to write "\par" or anything. I even made a copy paste of the "{\partial f}" that appears in the LHS of the equation and the red part still appears in the LHS. The code I used is

\sum_i\frac{\partial f}{\partial x^i}\frac{d\varphi^i_x(t)}{dt}(0)=\sum_i\frac{\partial f}{\partial x^i}X^i(x)

Every 50 characters, the forum software automatically inserts a space. In this case, the \partial gets split into \par tial which doesn't exist. So it's better to leave some spaces and use

\sum_i\frac{\partial f}{\partial x^i}\frac{d\varphi^i_x(t)}{dt}(0) = \sum_i\frac{\partial f}{\partial x^i}X^i(x)

for example. This yields

\sum_i\frac{\partial f}{\partial x^i}\frac{d\varphi^i_x(t)}{dt}(0) = \sum_i\frac{\partial f}{\partial x^i}X^i(x)
 
  • #319
I see! :\
 
  • #320
vela said:
Any decision on new delimiters?
I'm bumping this question. Greg, did you decide that you don't want any new delimiters for LaTeX?

The default simple delimiters are:
$...$ for itex
$$...$$ for tex

This option is the only one that would make it possible to copy stuff without change between forum posts and LaTeX documents. However, most people feel that it's much more important to be able to type a dollar sign in posts about money without preceding it with a backslash or something. So I came up with two alternatives.

The simple option is:
££...££ for itex
$$...$$ for tex

Almost everyone has # and/or £ on the 3 key, and $ on the 4 key. Most (all?) of the ones who don't can still type those symbols easily.

The complicated option is:
££...££, ##...##, §§...§§, ··...·· for itex.
$$...$$, ¢¢...¢¢ for tex.

The §,· and ¢ characters are minor improvements for Germans, Spaniards, and French Canadians respectively. The only advantage it has for them is that it allows them to use either Shift+3 for itex and Shift+4 for tex, or Alt Gr+3 for itex and Alt Gr+4 for tex, instead of e.g. Alt Gr+3 for itex and Shift+4 for tex.

Keyboard layouts at Wikipedia.

Note that one new "delimiter" (the option to use no delimiters at all in certain situations) has already been implemented. MathJax interprets stuff between "begin" and "end" statements as LaTeX, for example: \begin{align}\Lambda =\gamma\begin{pmatrix}1 & -v\\ -v & 1\end{pmatrix}, & & \gamma =\frac{1}{\sqrt{1-v^2}}.\end{align} This can be disabled if you prefer to force everyone to use itex and tex.
 
  • #321
The trouble with $...$ is that vBulletin parses posts using a regular expression engine. LaTeX syntax is too flexible to allow $...$ to be parsed using regular expressions. It requires a finite state machine instead.

Here's a simple explanation why: The best a regular expression algorithm can do is search for two $ signs with something in between. That is, a regular expression such as (Perl syntax)

\$(.*)\$

The reason you have to grab any sort of text that might appear between $ signs is because LaTeX syntax itself allows any sorts of characters to appear between $ signs. In particular, it allows spaces, periods, backslashes, even additional $ signs.

So, if someone is writing a post about money, and talks about $200 at one point, and then later mentions $5.35, then the vBulletin parser would grab the string

"200 at one point, and then later mentions "

and send it off to the LaTeX parser. Whoops.

The reason LaTeX itself can deal with the $ signs is because it doesn't use regular expressions.

Note, I have actually written an implementation of $...$ for vBulletin, but in order to work I added the additional requirement that the characters immediately adjacent to the $...$ cannot be spaces (if they are spaces, it interprets them as dollar signs). In the end I scrapped the idea, because I thought it would be too confusing to most people, especially given the disastrous attempts at LaTeX that we often see here.
 
  • #322
Ben Niehoff said:
THere's a simple explanation why: The best a regular expression algorithm can do is search for two $ signs with something in between. That is, a regular expression such as (Perl syntax)

\$(.*)\$

What about:

\$([^\$]*)\$

or

\$(.*?)\$

I've learned to always use pretty strict expressions in Perl to avoid such problems.
 
  • #323
I like Serena said:
What about:

\$([^\$]*)\$

or

\$(.*?)\$

I've learned to always use pretty strict expressions in Perl to avoid such problems.

Both of those would still fail on the example I gave (a sentence with two dollar amounts in it).
 
  • #324
Greg isn't going to write any regular expressions. All he's going to do (if he chooses to do anything) is to find the line in the MathJax configuration file where the optional delimiters are specified, and type them in there. I think this makes it 100% certain that we would have the problem that Ben describes if we choose to use single dollar signs as LaTeX delimiters. I also think I read somewhere that the users can type \$3.50 when they want $3.50 to be displayed, but new members will still be pretty confused.

That's why I suggested that we use ££ instead of $.
 
  • #325
Why not choose \$ as the LaTeX delimiter? Then there is no collision with ordinary dollar signs.

Of course, it means you still can't copy and paste directly from LaTeX documents, but with your other solutions, you can't do that anyway.

Edit: Of course, then we'd have trouble writing Perl regular expressions in our posts! How does MathJax work; i.e., when does it run in the processing sequence? It seems to be a Javascript that runs on the completed page, which is long after the vBulletin parser processes the posts. In that case, I think we're stuck with 'itex' and 'tex'.

I would recommend against making the delimiter some random symbol. The $ sign is standardized already, but if it can't be the $ sign, it shouldn't be some other symbol.
 
  • #326
Ben Niehoff said:
Why not choose \$ as the LaTeX delimiter? Then there is no collision with ordinary dollar signs.
It's significantly harder to to type than ££.
(Edit: If you're that attached to standard usage, doesn't it also bother you that your suggestion is a complete reversal of the default "$ for itex", "\$ for dollar sign"?)

Ben Niehoff said:
It seems to be a Javascript that runs on the completed page, which is long after the vBulletin parser processes the posts. In that case, I think we're stuck with 'itex' and 'tex'.
As I said, all that's required is a simple edit of a MathJax configuration file. (OK, maybe not if you specifically want to use \$ as a delimiter).
 
Last edited:
  • #327
Ben Niehoff said:
I would recommend against making the delimiter some random symbol. The $ sign is standardized already, but if it can't be the $ sign, it shouldn't be some other symbol.
Why not? What's wrong with using something like ##?
 
  • #328
Fredrik said:
The simple option is:
££...££ for itex
$$...$$ for tex

Almost everyone has # and/or £ on the 3 key, and $ on the 4 key. Most (all?) of the ones who don't can still type those symbols easily.

The complicated option is:
££...££, ##...##, §§...§§, ··...·· for itex.
$$...$$, ¢¢...¢¢ for tex.

The §,· and ¢ characters are minor improvements for Germans, Spaniards, and French Canadians respectively. The only advantage it has for them is that it allows them to use either Shift+3 for itex and Shift+4 for tex, or Alt Gr+3 for itex and Alt Gr+4 for tex, instead of e.g. Alt Gr+3 for itex and Shift+4 for tex.

Keyboard layouts at Wikipedia.
I had another look a the keyboard layout page. I had forgotten that ££ is a bad option for people with a US keyboard. ## is better for them. But most of the rest of the world should prefer ££ (based on the location on the keyboard), so here's a third option:
##...## or ££...££ for itex
$$...$$ for tex
 
  • #329
Fredrik said:
##...## or ££...££ for itex
$$...$$ for tex
I'd modify that slightly to ##…## and ££…££ for itex.
 
  • #330
I think you both mean the same thing.

A person could use either ##...## or ££...££ for itex, and it would work.

Both ##…## and ££…££ would work for itex.
 
  • #331
Why is my latex code not processed?
\frac{i \hbar t}{m}[\itex]<br /> \frac{i\hbart}{m}[\itex]&lt;br /&gt; \frac{i\hbar t}{m}[\itex]
 
  • #332
Juqon said:
Why is my latex code not processed?
Your closing itex tags are wrong. Use /, not \.
 
  • #333
Oh, of course, thank you! :)
 
  • #335
Juqon said:
As a start, you need to put some spaces in with that code. After 50 consecutive characters without a space, the processor will automatically insert a space.

By the way, you don't need the {} brackets when they surround a single character, i.e. t^{2} can be simply replaced with t^2. That will give you fewer brackets, and be easier to debug in case the numbers of {'s and }'s don't match.
 
  • #337
Juqon said:
What the other two guys said. As an alternative to multiple tex tags, use the align environment. That will make the \\ code work. Like this: \begin{align}
a &= b\\
&=c
\end{align} Tex tags are actually not necessary when the latex code starts with a begin statement, and ends with the corresponding end statement.

Also, please don't post equations with lines that are that long. They are seriously annoying in a browser window. So please insert a few extra \\ to make the lines shorter.
 
  • #338
Absolutely right, and the space broke the command \r ight.
And that with the new line separation was very motivating.
Very helpful, thanks!
 
  • #339
Hello!
I am writing because I do not know how to write the following formula in MathJax

I have read this entire thread and information about extracurricular parentheses, but in this case it's not that simple.

Did you have problems with habits relating to of the old system?

What about tables? It is not possible to create them?

\small\overbrace{a,...,a}^{\mbox{k a&#039;s}}, \underbrace{b,...,b}_{\mbox{l b&#039;s}}\hspace{10} \large\underbrace{\overbrace{a...a}^{\mbox{k a&#039;s}}, \overbrace{b...b}^{\mbox{l b&#039;s}}}_{\mbox{k+l elements}}

\small\overbrace{a,...,a}^{\mbox{k a&#039;s}}, \underbrace{b,...,b}_{\mbox{l b&#039;s}}\hspace{10pt} \large\underbrace{\overbrace{a...a}^{\mbox{k a&#039;s}}, \overbrace{b...b}^{\mbox{l b&#039;s}}}_{\mbox{k+l elements}}


\left[ \frac{X}{Y}\right ]

On mathtex that gives
be8xnl.png
 
Last edited:
  • #340
paul-g said:
I am writing because I do not know how to write the following formula in MathJax
You can't open with "tex" and close with "itex" or vice versa. You need to specify a unit for the hspace command. Note sure about the tables.

\small\overbrace{a,...,a}^{\mbox{k a&#039;s}}, \underbrace{b,...,b}_{\mbox{l b&#039;s}}\hspace{10pt} \large\underbrace{\overbrace{a...a}^{\mbox{k a&#039;s}}, \overbrace{b...b}^{\mbox{l b&#039;s}}}_{\mbox{k+l elements}}
\left[ \frac{X}{Y}\right ]
 
  • #341
The fact that I forgot to define the / hspace number of the unit, but it worked for MathTex.

Thank you anyway.

I will experiment a bit with the tables.
 

Similar threads

Replies
3
Views
4K
Replies
15
Views
25K
Replies
4
Views
4K
Replies
8
Views
2K
Replies
3
Views
2K
Replies
4
Views
4K
Replies
3
Views
2K
Replies
3
Views
13K
Back
Top