Issue with Latex Equations: I have a screen recording of the problem

  • Context: LaTeX 
  • Thread starter Thread starter zenterix
  • Start date Start date
  • Tags Tags
    latex
Click For Summary

Discussion Overview

The discussion revolves around issues related to the rendering of LaTeX equations in new threads on the forum. Participants explore the technical challenges and potential solutions regarding the MathJax library's loading behavior, particularly in the context of previewing posts that include LaTeX.

Discussion Character

  • Technical explanation, Debate/contested

Main Points Raised

  • One participant reports persistent issues with LaTeX not rendering correctly when starting new threads, suggesting it may be a bug.
  • Another participant confirms that MathJax only loads on pages where LaTeX is already present, which leads to rendering issues in new threads and first replies.
  • There is a question about whether this issue has been addressed or if it remains unresolved, with a suggestion for regular users to potentially contribute a solution.
  • One participant proposes looking into loading the MathJax script when the preview button is clicked as a possible solution.
  • Another participant shares their workaround of refreshing the browser to see the rendered LaTeX, but notes it does not work as intended in the new thread screen.
  • There are suggestions to include LaTeX on every page to ensure MathJax loads, though concerns about performance are raised due to the library's size and the fact that most threads do not contain equations.
  • An alternative idea is proposed to add a button that would load MathJax on pages without it, and a question is raised about the feasibility of a script that searches for LaTeX tags to trigger MathJax loading.
  • It is noted that the current system complicates the loading of MathJax due to the preview function.

Areas of Agreement / Disagreement

Participants generally agree that the issue with LaTeX rendering is a known problem, but there is no consensus on the best solution or whether it has been adequately addressed.

Contextual Notes

Participants express uncertainty about the performance implications of various proposed solutions, and there are unresolved questions regarding the technical feasibility of implementing certain suggestions.

zenterix
Messages
774
Reaction score
84
My posts all include many equations written in Latex. It seems to me like there are a few bugs related to usage of Latex specifically when just starting a new thread.

I've made a short 2 minute screen recording to show the issue I face every single time I want to start a new thread, and the way I get around it.

Since it doesn't seem possible to attach the video here, I have saved it to Google Drive https://drive.google.com/file/d/1ed7_oD8j66R62h6g0LYvqaBgizgY5Xj0/view?usp=sharing.

I think it's pretty clear what's happening there, though I would be shocked if this is happening to everyone because it's such an annoying bug that I would imagine it would have had to be brought up and solved by now.
 
Physics news on Phys.org
It's a known issue, I'm afraid. MathJax only loads on pages where there's already LaTeX. That means that new threads, and the first reply on a page to use LaTeX, don't get their maths rendered in preview. Yes, that is annoying.
 
Ibix said:
It's a known issue, I'm afraid. MathJax only loads on pages where there's already LaTeX. That means that new threads, and the first reply on a page to use LaTeX, don't get their maths rendered in preview. Yes, that is annoying.
Is it the case that someone has looked into it and there is no easy solution, or is it just an issue on the backburner?

If the latter, is it possible for a regular user to look into it and possibly create a pull request?
 
  • Like
Likes   Reactions: PeroK
Over the holiday I can look into loading the main MathJax script when the preview button is clicked.
 
  • Like
Likes   Reactions: George Keeling, Wrichik Basu, zenterix and 3 others
That would be great if it's possible, Greg, thanks.
 
  • Like
Likes   Reactions: zenterix
zenterix said:
Is it the case that someone has looked into it and there is no easy solution, or is it just an issue on the backburner?

If the latter, is it possible for a regular user to look into it and possibly create a pull request?
What I do is: copy the text so I don't lose it; hit the browser screen refresh; then hit the PF preview.
 
  • Informative
Likes   Reactions: berkeman and Ibix
PeroK said:
What I do is: copy the text so I don't lose it; hit the browser screen refresh; then hit the PF preview.
Well whaddaya know... Thanks. Doesn't seem to work quite right in the Post new thread screen, though. I just tried it and got the rendered LaTeX in the editor, which was not what I wanted.
 
  • Sad
Likes   Reactions: PeroK
Ibix said:
Well whaddaya know... Thanks. Doesn't seem to work quite right in the Post new thread screen, though. I just tried it and got the rendered LaTeX in the editor, which was not what I wanted.
This needs to be fixed.
 
  • Like
Likes   Reactions: zenterix and Ibix
  • #10
Ibix said:
It's a known issue, I'm afraid. MathJax only loads on pages where there's already LaTeX. That means that new threads, and the first reply on a page to use LaTeX, don't get their maths rendered in preview. Yes, that is annoying.
Is it possible to include LaTeX on every page of the forum (e.g. in the footer of the page) so that MathJax always loads or would this cause performance issues?
 
  • #11
Ygggdrasil said:
Is it possible to include LaTeX on every page of the forum (e.g. in the footer of the page) so that MathJax always loads or would this cause performance issues?
Performance is the factor. The library is quite large and the fact is most threads don't have equations.
 
  • Like
Likes   Reactions: Ygggdrasil and Ibix
  • #12
Another alternative (I had probably suggested this before) is to show a button in pages in which MathJax is not already loaded. Clicking the button should load the MathJax resource for that page.
 
  • Like
Likes   Reactions: PeroK
  • #13
Would it be possible for a script to search the page for any of the four tags for tex/itex and, if found, load MathJax? Would the search be quite fast?
 
  • #14
DrGreg said:
Would it be possible for a script to search the page for any of the four tags for tex/itex and, if found, load MathJax? Would the search be quite fast?
That is how it works currently, the preview function complicates that a little.
 
  • Like
Likes   Reactions: Wrichik Basu and DrGreg

Similar threads

  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 4 ·
Replies
4
Views
4K
  • · Replies 3 ·
Replies
3
Views
5K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
6K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 4 ·
Replies
4
Views
5K
  • · Replies 2 ·
Replies
2
Views
3K
Replies
15
Views
10K