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.
Messages
19,773
Reaction score
10,726
I have enabled MathJax on the site. There are no Latex images being displayed. Please post any problems. I'll leave it enabled for the next hour or so and switch back to images until we are 100% ready.
 
Physics news on Phys.org
Greg Bernhardt said:
I have enabled MathJax on the site. There are no Latex images being displayed. Please post any problems. I'll leave it enabled for the next hour or so and switch back to images until we are 100% ready.

So I wrote the LaTex code for y=x^2 and a dubious thing appeared (below). Do these essentially replace the nicely looking LaTex images and to make them we'd still have to type the LaTex code ?

y=x^2
 
dextercioby said:
So I wrote the LaTex code for y=x^2 and a dubious thing appeared (below). Do these essentially replace the nicely looking LaTex images and to make them we'd still have to type the LaTex code ?

y=x^2

Nothing in what you do changes :)
 
So, Greg, it's the image which changes and the lower space on the server occupied by the tinier pictures, right ?
 
dextercioby said:
So, Greg, it's the image which changes and the lower space on the server occupied by the tinier pictures, right ?

I have no idea what you are saying :) There are no images anymore.
 
The align environments seem buggy, plus some markup in my blog posts don't render. I'm trying to troubleshoot now.
 
jhae2.718 said:
The align environments seem buggy, plus some markup in my blog posts don't render. I'm trying to troubleshoot now.

The blog needs to be reworked, there were a few extra things we needed to do to make latex work on the blogs and I haven't touched that yet, so disregard the blogs for the moment.
 
Ok.

(> 4 characters)
 
Testing, testing...

-\frac{\hbar^2}{2m}\nabla^2 \Psi + V \Psi = i \hbar \frac{\partial \Psi}{\partial t}
 
  • #10
Test of align*:
<br /> \begin{align*}<br /> \nabla \cdot \mathbf{E} &amp;= \frac{\rho}{\varepsilon_0} \\<br /> \nabla \cdot \mathbf{B} &amp;= 0 \\<br /> \nabla \times \mathbf{E} &amp;= -\frac{\partial \mathbf{B}}{\partial t} \\<br /> \nabla \times \mathbf{B} &amp;= \mu_0\mathbf{j} + \mu_0\varepsilon_0 \frac{\partial \mathbf{E}}{\partial t}<br /> \end{align*}<br />
 
Last edited:
  • #11
I have four (4) in this line of text. I "accidentally" typed (3) the first time but saw it in preview, changed it, and the preview worked properly!
 
  • #13
Can I draw a commutative diagram?
<br /> \begin{CD}<br /> A @&gt;&gt;&gt; B \\<br /> @VVV @VVV \\<br /> C @&gt;&gt;&gt; D <br /> \end{CD}<br />
Nope (didn't expect this environment to work anyways). But interestingly, I get a box containing the latex code. Hrm, how about as a matrix?
<br /> \left[<br /> \begin{matrix}<br /> A &amp;\to&amp; B \\<br /> \downarrow &amp; &amp; \downarrow \\<br /> C &amp;\to&amp; D<br /> \end{matrix}<br /> \right]<br />
Successful!
 
  • #14
Ooh, quick edit doesn't play nicely.

I just quick edited this post to put "\sqrt{3}" in the post, but the latex didn't render and I just saw the raw text. But if I reload the page, it will look right.

edit: Or, eI thought reloading would. Nothing's rendering now. :(

edit2: Ah, now reload's working.
 
  • #15
Greg, the align* environment should align the LaTeX by placement of &s.

Sometimes I see it rendered correctly, other times not. See attached image.
latexRenderings.png
 
  • #16
sorry I was doing some tweaking. turning off for now, i'll turn it back on later tonight and update here. thanks! images are back
 
  • #17
Why the sudden change?

Sorry to say I really hate the new look. The images are smaller, and arew just ugly compared to the old font. Please bring back imgtex =)
 
  • #18
What I checked worked OK.
 
  • #19
Nebuchadnezza said:
Why the sudden change?

Sorry to say I really hate the new look. The images are smaller, and arew just ugly compared to the old font. Please bring back imgtex =)

such problems can be configured
 
  • #20
Greg, during the test was the math rendered with cmr font? (Didn't look like it, but hard to tell...)
 
  • #22
So MathJax doesn't treat equations as images. Does this mea we can have an unlimited number of LaTeX equations i our blogs? Right now, you can have only 10, which is kind of anoying...
 
  • #23
I'd think so, Micro.
 
  • #24
MathJax is back up. Please resume testing and reporting back. thanks!
 
  • #25
Let's see if one of the truth tables from my programming blog will work here:
<br /> \centering <br /> \begin{tabular}{r | c | c |} <br /> &amp; \textbf{True} &amp; \textbf{False} \\ \hline <br /> \textbf{True} &amp; True &amp; False \\ \hline <br /> \textbf{False} &amp; False &amp; False \\ \hline <br /> \end{tabular}<br />

Edit: seems like the tabular environment is not supported...
Edit2: This is not a bug, tabular and centering are not supported in MathJax. So, no LaTeX tables. :(
 
  • #26
Please don't fix what's not broken!
 
  • #27
MathJax will help lower the load on the servers. Text requires less bandwidth than images.

The appearance is configurable and can be changed.
 
  • #28
flyingpig said:
Please don't fix what's not broken!

It is broken, unsupported and burdensome. We currently host 1,114,554 latex graphics.
 
  • #29
But it's so small!
 
  • #30
Again, the cosmetic aspects can be changed. Stop whining! It's just a test!
 
  • #31
So, we can't click anymore to see the latex code? :(
 
  • #32
Edit: NVM, this is wrong: "No; as a workaround you can quote the post to see the \LaTeX."

Edit: heh, that's funny, MathJax renders \LaTeX incorrectly. Wonder if it works in eq. mode:
<br /> \LaTeX<br />
 
  • #34
QuarkCharmer said:
So, we can't click anymore to see the latex code? :(

Right click on the equation to get a menu.
 
  • #35
If the TeX is too small, you can manually scale it in the menu.
 
  • #36
Greg Bernhardt said:
Right click on the equation to get a menu.

Ah, View MathML Source. Thanks
 
  • #37
It works in PMs and the old system did not. I think it's an improvement. Good move.

Are all the math symbols available ?
 
  • #38
Hm, let me try repeating something I posted on another site as a real-world test:
However, you can _convert_ an amount of kinetic energy measured in one frame to another frame, if you know their relative velocity. If you're working at low speeds, the easy (approximate) way to do this is to just calculate the relative velocity, as you did. So if the train observer measures a kinetic energy K = \frac{1}{2}mv^2, the ground observer will measure a kinetic energy of \frac{1}{2}m(v + V)^2, or
K + \sqrt{2Km}V + \frac{1}{2}mV^2
(in one dimension).

If you get up to higher speeds, or you want an exact expression, you'll have to use the relativistic definition of energy. In special relativity, the kinetic energy is given by the difference between the total energy and the "rest energy,"
K = E - mc^2
One way to figure out the transformation rule is to use the fact that the total energy is part of a four-vector, along with the relativistic momentum,
\begin{pmatrix}E/c \\ p\end{pmatrix} = \begin{pmatrix}\gamma_v mc \\ \gamma_v mv\end{pmatrix}
where \gamma_v = 1/\sqrt{1 - v^2/c^2}. This four-vector transforms under the Lorentz transformation as you shift from one reference frame to another,
\begin{pmatrix}E/c \\ p\end{pmatrix}_\text{ground} = \begin{pmatrix}\gamma &amp; \gamma\beta \\ \gamma\beta &amp; \gamma\end{pmatrix}\begin{pmatrix}E/c \\ p\end{pmatrix}_\text{train}
(where \beta = V/c and \gamma = 1/\sqrt{1 - \beta^2}), so the energy as observed from the ground would be given by
E_\text{ground} = \gamma(E_\text{train} + \beta c p_\text{train})
The kinetic energy is obtained by subtracting mc^2 from the total energy, so you'd get
K_\text{ground} = \gamma(E_\text{train} + \beta c p_\text{train}) - mc^2
which works out to
K_\text{ground} = \gamma K_\text{train} + (\gamma - 1) mc^2 + \gamma\beta c p_\text{train}
where K is the relativistic kinetic energy and p is the relativistic momentum.

If you wanted it in terms of energy alone:
K_\text{ground} = \gamma K_\text{train} + (\gamma - 1) mc^2 + \gamma\beta\sqrt{K_\text{train}^2 + 2 mc^2 K_\text{train}}
You might start to notice a similarity to the non-relativistic expression above (K + \sqrt{2Km}V + \frac{1}{2}mV^2), and indeed, if you plug in some approximations that are valid at low speeds (\gamma \approx 1, \gamma - 1 \approx V^2/c^2, K_\text{train} \approx \frac{1}{2}mv^2 \ll mc^2), you will recover exactly that expression.
I'm seeing some pretty serious problems in the post preview on Firefox 4: large chunks of the post text just don't show up. It doesn't seem to be a problem with the HTML or MathML markup, but rather with the way the browser's rendering engine interacts with it, because if I scroll down far enough to put the preview out of view and then back up, it'll look different. Plus, I can select sections of text to make them show up, but then other sections of the preview (and even of the page, outside of the preview) flicker in and out of view as I change the selection. A lot of the problem areas seem to start at instances of the / operator in the math, so perhaps the way that's being rendered is messing things up somehow. I suppose this could be a problem with MathJax itself, but I've been to several other sites that use it and never had this problem before (including the site where I originally posted the exact same thing I quoted), so there must be something specific to PF that is contributing to this problem somehow. (A sample screenshot attached - notice how part of the second matrix equation is cut off, as well as most of the lines above and below it. At other times multiple entire paragraphs would be missing.)

Although it's not as big of an issue, the block equations have a bit too much space above and (especially) below them. Also, the font size is noticeably too small, though not by much. If it's possible to use a larger font size for the block equations than the inline ones, I think that would make the post look better overall.
 

Attachments

  • pfpreviewbug1.png
    pfpreviewbug1.png
    8.4 KB · Views: 428
Last edited:
  • #39
I'll leave MathJax up for another hour and then back to images. thanks for all the feedback! dianoza i'll forward the post to the developers. FF4 just came out so I bet they are working to get it compatible.
 
  • #40
...and I'm now seeing the same rendering errors (missing chunks of text) when looking at the post itself - this is after posting, not in preview mode anymore.
 
  • #41
diazona said:
...I'm seeing some pretty serious problems in the post preview on Firefox 4...

I can confirm this on Firefox 4, Linux x86_64 2.6.37.6-0.5
 
  • #42
It works in Konqueror with KHTML. Konqi with WebKit is slow, it hangs on fondtata.js for me. Could just be a side effect of running a Windows 7 VM in the background.

Test: \not =
 
Last edited:
  • #43
Greg, are we on MathJax 1.1? Edit: dumb question, you're linking to their CDN.

A bit of Googling suggests that there exist rendering problems with FF 4.*.
 
Last edited:
  • #44
jhae2.718 said:
Greg, are we on MathJax 1.1? Edit: dumb question, you're linking to their CDN.

A bit of Googling suggests that there exist rendering problems with FF 4.*.

thanks I'll look into it more tomorrow. for now the images are back. thanks again for all the feedback!
 
  • #45
jhae2.718 said:
Greg, are we on MathJax 1.1? Edit: dumb question, you're linking to their CDN.

A bit of Googling suggests that there exist rendering problems with FF 4.*.
Hm... the site I took my example from also uses MathJax 1.1:
MathJax v1.1
using local STIX fonts

TeX Input Jax v1.1
HTML-CSS Output Jax v1.1
mml Element Jax v1.1
tex2jax Extension v1.1
MathZoom Extension v1.1
MathMenu Extension v1.1
TeX/noErrors Extension v1.0.1
TeX/noUndefined Extension v1.0.1
Firefox v4.0
but there are no rendering errors.
 
  • #46
I'm wondering if the the "Zoom Function" on Firefox 4.0 might be the culprit here. I haven't did any research however since I'm ready for bed with several crafted beers in me. :)

Anyway, I'm all for unloading the server which will be an asset to PF. Thanks for your work Greg.
 
  • #48
Pages with any appreciable amount of LaTeX take a lot longer to load, it seems. For example, this page took about 15 - 20 sec. to load.
 
  • #49
Not having any problems with Diazona's post anymore.
 
  • #50
Mark44 said:
Pages with any appreciable amount of LaTeX take a lot longer to load, it seems. For example, this page took about 15 - 20 sec. to load.

What browser are you using? I would think in a current version of FF or Chrome that the JS processing would be slightly faster than downloading images.
 

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