LaTeX Is LaTeX Preview Working Properly?

  • Thread starter Thread starter chroot
  • Start date Start date
  • Tags Tags
    Latex
Click For Summary
LaTeX preview functionality has been recently updated, allowing users to see graphical representations of their LaTeX code in posts. However, some users are experiencing issues where previews display incorrect cached images instead of the intended LaTeX output. This problem appears to be linked to browser settings and user accounts, with varying experiences reported across different platforms. A workaround suggested involves adding dummy LaTeX images to force the generation of new previews. The developer has implemented code to delete stale images, aiming to resolve these caching issues.
  • #31
That's definitely not the problem I have. It fails every time, no matter what browser or computer(!) I use. I never had those intermittent problems that you have described before. (At least I think it was you, but I may remember it wrong).
 
Physics news on Phys.org
  • #32
Aren't images which are used more than once generated once? For example, if I type \lambda once and then \lambda again, it generates, stores and inserts two separate images?

[edit]Apparently it does... that's weird[/edit]
 
  • #33
Fredrik said:
That's definitely not the problem I have. It fails every time, no matter what browser or computer(!) I use. I never had those intermittent problems that you have described before. (At least I think it was you, but I may remember it wrong).

I'm not sure if my description was completely accurate either, just going from memory of something that was posted last summer.

A work-around might be to write "editing in progress" at the top of a post, then submit it. Proofread, edit, and save as needed. When you're done, remove the "editing in progress" sign.

I've been frustrated with LaTex often enough that I try to avoid it. Not really possible all the time (such as in the post you linked to) though.

CompuChip said:
Aren't images which are used more than once generated once? For example, if I type https://www.physicsforums.com/latex_images/21/2192470-0.png once and then https://www.physicsforums.com/latex_images/21/2192470-1.png again, it generates, stores and inserts two separate images?

[edit]Apparently it does... that's weird[/edit]

Yup, those are two separate images with different URL's:
https://www.physicsforums.com/latex_images/21/2192470-0.png
and
https://www.physicsforums.com/latex_images/21/2192470-1.png
 
Last edited by a moderator:
  • #34
Redbelly98 said:
A work-around might be to write "editing in progress" at the top of a post, then submit it. Proofread, edit, and save as needed. When you're done, remove the "editing in progress" sign.

I've been frustrated with LaTex often enough that I try to avoid it. Not really possible all the time (such as in the post you linked to) though.
Most of my posts are like that, so avoiding LaTeX isn't really an option for me. The "editing in progress" trick is only good enough for posts that have very little LaTeX content. So if this problem can't be solved, I would either have to get a new account or stop posting.

I'm writing this on a fourth computer, and I still get the same images when I preview. It's not the latest images or anything like that, but always the images from the post I linked to. I just did some more testing and noticed that if I put more than 15 LaTeX images in my post, only the first 15 are messed up in the preview. The 16th is displayed fine. Maybe I'll use that as a workaround for a while. :smile:
 
  • #35
Fredrik said:
Most of my posts are like that, so avoiding LaTeX isn't really an option for me. The "editing in progress" trick is only good enough for posts that have very little LaTeX content. So if this problem can't be solved, I would either have to get a new account or stop posting.

I'm writing this on a fourth computer, and I still get the same images when I preview. It's not the latest images or anything like that, but always the images from the post I linked to. I just did some more testing and noticed that if I put more than 15 LaTeX images in my post, only the first 15 are messed up in the preview. The 16th is displayed fine. Maybe I'll use that as a workaround for a while. :smile:

I'm having exactly the same problem as Fredrik, except for me the number is not 15 but 2. Always. And the 2 corrupted images I see are always the same images every time. They are two equations that I once generated some time ago (probably the first Latex I created after it got reenabled after the disk problems).

I suspect that something went wrong in the past, some images got cached (on the server) in such a way that the cached images take precedence over freshly generated Latex in previews. Different users have a different number of "badly cached" images. For me it's 2, for Fredrik it's 15, for many lucky souls it's zero.

So a workaround is to stick a load of dummy latex images at the top of your post while previewing, remembering to delete them again before posting.
 
  • #36
Okay guys, I added a bit of code that actively deletes stale preview images before generating new ones. That hopefully means the images will no longer be cached (by any entity -- our server, intervening proxy servers, or the browsers themselves).

Let me know if anything changes for you. Since some of you have this problem no matter what computer you use, etc., I'm worried there's actually a caching proxy server upstream of you, even if it's usually transparent.

- Warren
 
  • #37
chroot said:
Okay guys, I added a bit of code that actively deletes stale preview images before generating new ones. That hopefully means the images will no longer be cached (by any entity -- our server, intervening proxy servers, or the browsers themselves).

Let me know if anything changes for you. Since some of you have this problem no matter what computer you use, etc., I'm worried there's actually a caching proxy server upstream of you, even if it's usually transparent.

- Warren
The problem seems to be fixed, for me at least. Thank you!
 
  • #38
chroot said:
Okay guys, I added a bit of code that actively deletes stale preview images before generating new ones.
...
Let me know if anything changes for you.
Thank you. It's working fine for me now.
 
  • #39
I just noticed another problem. Maybe it's only when I preview. I'll have to post this to find out. If I write f'(x), it appears as f single − quote(x).

f'(x)

Nope, it looks fine when I post it.
 
  • #40
Fredrik said:
I just noticed another problem. Maybe it's only when I preview. I'll have to post this to find out. If I write f'(x), it appears as f single − quote(x).

f'(x)

Nope, it looks fine when I post it.

Fredrik,

Fixed that one too. All should be well in LaTeX-land now.

- Warren
 
  • #41
Thank you. We're lucky to have you here. :smile:
 
  • #42
mattmns said:
2 + 2 = 4
2 + 2 = 5 :smile:
 
  • #43
Unit said:
2 + 2 = 5 :smile:

That is true, modulo one.
 
  • #44
\sum(A+BX_{i}-Y_{i})^2=0

\mbox{just practising}
 
Last edited:
  • #45
I've just given up on trying to post an answer because in preview all of my Latex stuff is showing images from a previous post ages ago and refuses to show the stuff I've entered today. I've cleared the browser cache and restarted it before trying again and that didn't help. What else can I try? For example, the following expression is displaying in preview as v2/r which I used in a post some weeks ago:

<br /> \frac{d\mathbf{p}}{dt} = \frac{E}{c^2} \mathbf{g} \left ( 1 + \frac{v^2}{c^2} \right )<br />

Edit: When I submitted this one, the LaTeX now appears as a broken image marker.
 
  • #46
Johnathan: You need to use lowercase letters for the tex tags.

Is it just me, or do we now have to refresh after every preview to get the correct latex expression to show up? :confused:
 
  • #47
There's an ongoing problem with LaTeX used in blogs and PMs. The image files in this case have "preview" URL, and you often get the wrong image. The problem is described also in thread [post=2590434]TEX broken?[/post].

I've just checked and the problem is still there.
 
  • #48
I'm not sure if you posted that to report a problem, or if it was a reply to me. I'm aware of the need to click reply and preview, to get the LaTeX to look OK when you receive a PM. But that's not what I was talking about. I've been making a bunch of posts today, and every time, the LaTeX is messed up when I preview. (Older images are displayed). It doesn't help to just click preview again. I have to click my browser's refresh button, and then the resend button that shows up. And if I make any little change, I have to repeat the procedure.
 
  • #49
Latex preview is working fine for me, but I see old images for latex in private messages and profile visitor messages.
 
  • #50
dx said:
Latex preview is working fine for me, but I see old images for latex in private messages and profile visitor messages.

LaTeX has never worked in PMs and PVMs
 
  • #51
For the first time in more than a year, latex preview doesn't work. It shows old images though I typed new equations. I hope that when I push "Submit reply" the true images will show up. :smile:
 
  • #52
fluidistic said:
For the first time in more than a year, latex preview doesn't work. It shows old images though I typed new equations. I hope that when I push "Submit reply" the true images will show up. :smile:
I'm glad it's not just me. I had that problem yesterday and the day before. Let's see if I still have it today...x, w, z. Yes, I do. (I wrote "x,y" and previewed, then I changed it to "x,w,z" and previewed again. The w shows up as y in the preview).

Edit: Trying again, after logging out and back in again. Uh...I still see a y.
 
  • #53
I have had problems with this today as well. A workaround is to (after a Ctrl-c for safety) refresh the composition page. Click on "Resend" in the Confirm window that opens.
 
  • #54
LaTeX doesn't work in RSS feeds. I think this is by design though...
 
  • #55
This is a test

This is only a test

Preview is not working for me, still getting old images.
 
  • #56
NOTE: This is not about preview or latex in PMs/VMs etc.

Inline latex seems to be somewhat broken:

[ tex ]\dot \theta[ /tex ] = \dot \theta

[ itex ]\dot \theta [ /itex ] = \dot \theta

However, [ itex ]\dot x \dot k[ /itex ] = \dot x \dot k

So it seems that with inline tex things like superscripts, dots, overlines, hats, and vector symbols do not show up over tall characters (like theta or k), but work for short characters (like x). This didn't happen before.
 
Last edited:
  • #57
That problem has been around for a long time Gokul, but since you're retired staff with over 10K posts, I guess you've been here much longer than that. Another problem with itex (example: \mathbb R) is that it changes the distance to the next line. You would often get better results with tex tags actually. And I'll just type a few more words to make sure that there's at least one line of text below the math expression.
 
  • #58
Gokul43201 said:
NOTE: This is not about preview or latex in PMs/VMs etc.

Inline latex seems to be somewhat broken:

[ tex ]\dot \theta[ /tex ] = \dot \theta

[ itex ]\dot \theta [ /itex ] = \dot \theta

However, [ itex ]\dot x \dot k[ /itex ] = \dot x \dot k

So it seems that with inline tex things like superscripts, dots, overlines, hats, and vector symbols do not show up over tall characters (like theta or k), but work for short characters (like x). This didn't happen before.
It seems that the top row of pixels is missing in itex.

[noparse]\sqrt{X}[/noparse] = \sqrt{X}
[noparse]\sqrt{X}[/noparse] = \sqrt{X}

(By the way, this message didn't preview correctly either, the same image was displayed for both the tex and itex.)

EDIT: the final version still seems to be wrong, the tex and itex seem to be identical. They are both displaying the top row of pixels missing on my computer.
 
Last edited:
  • #59
DrGreg said:
EDIT: the final version still seems to be wrong, the tex and itex seem to be identical. They are both displaying the top row of pixels missing on my computer.

tex : \sqrt{\alpha \beta \gamma}

itex : \sqrt{\alpha \beta \gamma}

Top row seems to be fine.
 
  • #60
\sqrt{iTeX}
\sqrt{TeX}

Problem only seems to happen with tall enough characters.
 

Similar threads

  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 12 ·
Replies
12
Views
3K
  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 23 ·
Replies
23
Views
4K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
Replies
5
Views
2K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 3 ·
Replies
3
Views
1K