Lazy Loading with LaTeX - Performance and UX

  • Context: LaTeX 
  • Thread starter Thread starter Greg Bernhardt
  • Start date Start date
Click For Summary

Discussion Overview

The discussion revolves around the implementation and performance of a lazy loading extension for rendering LaTeX equations using MathJax on a forum. Participants explore the impact of this feature on user experience and performance, particularly in relation to different browsers and devices.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested
  • Experimental/applied

Main Points Raised

  • One participant describes a lazy load extension created by MathJax developers that aims to improve performance by rendering equations only when they enter the viewport.
  • Another participant notes issues with rendering, mentioning that equations did not render at all until their post was quoted.
  • A participant reports inconsistent rendering of LaTeX expressions in different orientations on an iPad, indicating potential device-specific issues.
  • One user experiences navigation problems on LaTeX-heavy pages, where links to posts do not direct to the expected location after rendering occurs.
  • Another participant describes a peculiar jumping behavior when opening posts in an older version of Firefox, suggesting possible local buffering issues affecting rendering.
  • A participant mentions implementing a conditional loading mechanism to prevent MathJax from loading if no equations are present on the page, seeking feedback on rendering issues.
  • One user reports that LaTeX formulas are not rendering at all on their PC across multiple browsers, raising concerns about the functionality of the feature.
  • Another participant suggests clearing the browser cache as a potential solution to rendering issues, which is later confirmed to help by another user.
  • A user describes problems with the New Thread editor where LaTeX is rendered unexpectedly when saving drafts, leading to issues when previewing the thread.

Areas of Agreement / Disagreement

Participants express various experiences with the lazy loading feature, indicating that multiple competing views and unresolved issues remain regarding its performance and reliability across different platforms and scenarios.

Contextual Notes

Participants highlight limitations such as device-specific rendering issues, inconsistencies in navigation after rendering, and the impact of browser versions on performance. There are also unresolved questions about the conditions under which MathJax resources are loaded.

Messages
19,873
Reaction score
10,876
To help with performance on threads heavy with equations I got the MathJax dev to create a lazy load extension that only renders the equations if it enters your viewport instead of rendering everything on page load. At the moment it can be a little choppy. The MathJax devs said they'll work on polishing it up for an official release sometime this summer. Let me know your thoughts on the performance improvement and user experience.
 
  • Like
Likes   Reactions: Twigg, DrClaude, Wrichik Basu and 4 others
Physics news on Phys.org
I noticed in a PM that the it didn’t render at all but when my post was quoted it did.

##(r, \theta, \phi)##
 
The post above renders the r, theta, phi expression in portrait mode in Safari on my iPad but only renders the bottom half When in landscape mode.
 
  • Like
Likes   Reactions: Greg Bernhardt
I'm finding (Android Firefox) that sometimes links to posts part way down a LaTeX-heavy page don't go to the top of the post now. For example, this post by sophiatev initially opens at the top, but when the LaTeX renders it jumps to halfway down the post.

I note that she's quoted a lot of LaTeX. Did the stuff she quoted get rendered in the post she quoted it from too or something?
 
Slightly different action here. (Very old Firefox, 43.0.1 on Win XP)

Opens at top
Jumps (part? way) down
Then IMMEDIATELY jumps back to top

A page reload (F5) causes a jump to show the last few lines of the preceeding post for about 1/4 second, then back to top of selected post.

Most curious.

Further trials show suspicion of a local buffering situation. The first anomaly is dependent on the elapsed time between trials.

Arrgh! Now the 1st anomaly has been replaced with the 2nd one.

I give up! Good Luck.
 
I've made a conditional so that if equations aren't found on the page, it won't load the mathjax resource. Let me know if anyone is seeing rendering issues.
 
Since today, PF Latex formulas are not rendered at all on my PC, in all postings. I tried Firefox (v 89,0, Java script enabled) and Edge (v 91.0.864.41). Both show this issue.
 
  • Like
Likes   Reactions: weirdoguy
Clearing browser cache helped. Thanks!
 
  • Like
Likes   Reactions: Greg Bernhardt
  • #10
I am trying to write a new thread in the Other Physics Topics section, and after writing some LaTeX, when I am clicking on Preview, the equations are not rendered, likely because the MathJax resource is not loaded:

1623932856219.png


Now, suppose I save the draft, go to some other page, and again come back to the New Thread editor. I find that LaTeX has been rendered even though I have not selected the preview option:

1623932907781.png


In this situation, if I click on the Preview button, it becomes a mess:

1623932967815.png
 
Last edited:
  • Informative
Likes   Reactions: Greg Bernhardt

Similar threads

  • · Replies 3 ·
Replies
3
Views
2K
Replies
3
Views
5K
  • Sticky
  • · Replies 48 ·
2
Replies
48
Views
68K
  • · Replies 1 ·
Replies
1
Views
10K