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

  • Thread starter Thread starter zenterix
  • Start date Start date
  • Tags Tags
    latex
Click For Summary
SUMMARY

The forum discussion addresses a persistent issue with rendering LaTeX equations in new threads using MathJax. Users report that MathJax only activates on pages that already contain LaTeX, leading to equations not being displayed in the preview of new threads or the first replies. Suggestions include loading the MathJax script upon clicking the preview button or implementing a search script to detect LaTeX tags and load MathJax accordingly. This issue remains unresolved and is recognized as a significant annoyance for users relying on LaTeX for mathematical expressions.

PREREQUISITES
  • Understanding of LaTeX syntax for mathematical equations
  • Familiarity with MathJax library and its functionality
  • Basic knowledge of web development concepts, particularly JavaScript
  • Experience with forum software and user interface design
NEXT STEPS
  • Investigate how to implement MathJax loading on demand in web applications
  • Learn about creating JavaScript functions to dynamically load scripts based on user actions
  • Explore performance optimization techniques for loading large libraries like MathJax
  • Research best practices for handling user-generated content in forums
USEFUL FOR

This discussion is beneficial for web developers, forum administrators, and users who frequently utilize LaTeX for mathematical expressions and are seeking solutions to improve the rendering experience in online discussions.

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 PeroK
Over the holiday I can look into loading the main MathJax script when the preview button is clicked.
 
  • Like
Likes George Keeling, Wrichik Basu, zenterix and 3 others
That would be great if it's possible, Greg, thanks.
 
  • Like
Likes 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 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 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 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 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 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 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
4K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
6K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 4 ·
Replies
4
Views
4K
  • · Replies 2 ·
Replies
2
Views
3K
Replies
15
Views
10K