Why Doesn't LaTeX Render in Preview Mode as It Does After Posting?

  • Thread starter paulb203
  • Start date
  • Tags
    Latex
  • #1
paulb203
64
24
I've been checking out the guide, and practicing but I have a question before I actually post a thread using it. I did go to the LaTeX thread but it's closed.
When I hit the Preview button I was given a preview of what the main body of my text would look like when posted, but the text I'd put in the Homework Statement box, and in the Relevant Equations box, remained with the ## eliminators still attached; any thoughts?
 
Physics news on Phys.org
  • #2
Note that you put double-$ delimiters at the start and end of each stand-alone line of LaTeX, and double-# delimiters at the start and end of in-line LaTeX that does not need to be on its own line.

Example of in-line LaTeX: ##v(t) = L \frac{di(t)}{dt}##

Example of stand-alone LaTeX:
$$v(t) = L \frac{di(t)}{dt}$$
Also, if you right-click on a LaTeX equation in a post, you get a pop-up menu to let you view the LaTeX source or view it in other formats.

LaTeX isn't supported in thread titles, so you can use simple text math in titles if you want.

Note also that PF uses a feature called "lazy LaTeX rendering" that speeds up page loads. When you first post your LaTeX in a thread, you will not see it rendered that first time. Just refresh your browser page to force it to be rendered, and then it should render whenever you come back to that page/thread in the future.

If you have trouble using the Preview feature to check your LaTeX, you can use a website such as https://www.quicklatex.com/ to preview your LaTeX before you post it.

Was your LaTeX rendering okay in some sections of the Homework Help Template and not others? Did you try refreshing your browser?
 
  • Like
  • Informative
Likes paulb203, dextercioby, Mark44 and 1 other person
  • #3
I just ran a test of posting a new Homework Help thread, and LaTeX seems to work in all 3 sections. I did have trouble getting Preview to work, but that's always problematic for me.

1709324866364.png
 
  • #4
berkeman said:
If you have trouble using the Preview feature to check your LaTeX, you can use a website such as https://www.quicklatex.com/ to preview your LaTeX before you post it.
I find it easy and convenient to use this online LaTeX interpreter, which translates and displays the formulas as you write the LaTeX expression. When done, I just copy and paste and add the delimiters.
 
  • Like
  • Informative
Likes dextercioby and berkeman
  • #5
paulb203 said:
the text I'd put in the Homework Statement box, and in the Relevant Equations box, remained with the ## eliminators still attached; any thoughts?
It's a bug. If you are the first person to use LaTeX on a page it doesn't render. If you are replying to a thread you just need to preview and then hit refresh while previewing - that wakes up the renderer and it'll work from there. (The wise poster takes a copy of the post text before preview-and-refresh, although it's not usually a problem.) Unfortunately that hack doesn't work in new thread posts. I just write my new post as a reply to some random thread, then copy to a new thread start when I'm ready.
 
  • Informative
Likes berkeman
  • #6
Ibix said:
Unfortunately that hack doesn't work in new thread posts.
Yeah, when I was doing my test thread, I clicked Preview and refreshed my browser and *poof* my new thread start got deleted. o0)
 
  • #7
berkeman said:
Yeah, when I was doing my test thread, I clicked Preview and refreshed my browser and *poof* my new thread start got deleted. o0)
Actually, I just tried creating a new thread and the preview-and-refresh did work for me (Firefox on Android). @Greg Bernhardt seems to have made some changes.
 
  • #8
Ibix said:
Actually, I just tried creating a new thread and the preview-and-refresh did work for me (Firefox on Android).
In which forum? I was using my Win10 laptop with Firefox when I created the test thread in the Homework Help forum.
 
  • #9
berkeman said:
In which forum? I was using my Win10 laptop with Firefox when I created the test thread in the Homework Help forum.
Here, and the Advisor Lounge. And I just tried Introductory Physics Homework Help and it worked there too.
 
  • Informative
Likes berkeman
  • #10
berkeman said:
Note that you put double-$ delimiters at the start and end of each stand-alone line of LaTeX, and double-# delimiters at the start and end of in-line LaTeX that does not need to be on its own line.

Example of in-line LaTeX: ##v(t) = L \frac{di(t)}{dt}##

Example of stand-alone LaTeX:
$$v(t) = L \frac{di(t)}{dt}$$
Also, if you right-click on a LaTeX equation in a post, you get a pop-up menu to let you view the LaTeX source or view it in other formats.

LaTeX isn't supported in thread titles, so you can use simple text math in titles if you want.

Note also that PF uses a feature called "lazy LaTeX rendering" that speeds up page loads. When you first post your LaTeX in a thread, you will not see it rendered that first time. Just refresh your browser page to force it to be rendered, and then it should render whenever you come back to that page/thread in the future.

If you have trouble using the Preview feature to check your LaTeX, you can use a website such as https://www.quicklatex.com/ to preview your LaTeX before you post it.

Was your LaTeX rendering okay in some sections of the Homework Help Template and not others? Did you try refreshing your browser?
Thanks, berkeman. Does 'in-line' mean as part of a sentence, i.e, with words and the equation? And what's the difference between the two examples you gave of the equation ##v(t) = L \frac {di(t)} {dt}## apart from one being centred and one not being centred?
 
  • #11
Inline is quite literally inline, as in ##A=B## which was written withe the hash delimiters.
The alternative using the dollar-sign delimiters $$a=b$$ gets its own line, centered.
 
  • #12
If you click the "Reply" button on Nugatory's post (but don't click the "Post Reply" button on the resulting page), you can see the LaTeX code exactly as he wrote it. In his original code, both equations are inline with the rest of his text. The $$ delimiters on the second equation turn it into a standalone equation when the code is rendered after posting.

Nugatory said:
Inline is quite literally inline, as in ##A=B## which was written withe the hash delimiters.
The alternative using the dollar-sign delimiters $$a=b$$ gets its own line, centered.

(added) Upon posting this, the equations in the quote were rendered properly.
 
Last edited:

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
9
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
948
  • MATLAB, Maple, Mathematica, LaTeX
Replies
12
Views
797
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
822
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
906
  • MATLAB, Maple, Mathematica, LaTeX
Replies
23
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
801
  • Feedback and Announcements
Replies
3
Views
1K
Back
Top