How to preview latex formulas?

  • LaTeX
  • Thread starter Heidi
  • Start date
In summary, the "Toggle BB code" button toggles whether or not the LaTeX code is rendered in the edit box. If it is not rendered, clicking Preview will result in gibberish.
  • #1
Heidi
411
40
Hi Pfs,
I do not succeed to preview the latex formulas that i type in this forum.
I tried with formulas between: $$ \epsilon_j $$ or between sharp characters and then i click on the preview icon.
I see that something has changed: i can more modify my text. but i do not see the result
if i click one more time then i can modify my formulas.
Was something wrong? If i post my thread , i see the resultins formulas with latex but without previewing.
edit
thanks
 
Physics news on Phys.org
  • #2
Interesting. For me the "Preview" button works fine. If I click it once it goes to preview mode and shows the post with the LaTeX correctly rendered, and if I click it again then it goes back to edit mode with the LaTeX code.

@Greg Bernhardt any ideas what may prevent the Preview button from working?
 
  • Like
Likes jedishrfu
  • #3
Heidi said:
I do not succeed to preview the latex formulas that i type in this forum.
In a newly-opened tab, the preview often doesn't work. Reloading the tab and clicking preview again cures that (in my Firefox browser). Once the preview works in a tab, it keeps working.

UPDATE: @Wrichik Basu has posted some cautions and a safer procedure here.
 
Last edited:
  • Like
Likes mfb, hmmm27, jedishrfu and 2 others
  • #4
FactChecker said:
In a newly-opened tab, the preview often doesn't work. Reloading the tab and clicking preview again cures that (in my Firefox browser). Once the preview works in a tab, it keeps working.
I was able to replicate this behavior too. Must be some sort of lazy loading where the LaTeX rendering component only loads if the page contains LaTeX on loading.
 
  • Like
Likes jedishrfu and FactChecker
  • #5
FactChecker said:
In a newly-opened tab, the preview often doesn't work. Reloading the tab and clicking preview again cures that (in my Firefox browser). Once the preview works in a tab, it keeps working.
Same in Chrome.

Another possible explanation is an unintentional double click, a problem I currently have with my mouse.
 
  • Like
Likes jedishrfu, Dale and FactChecker
  • #6
I've seen on some browsers where the tools when posting are all red and don't respond. I figured it had something to do with browser security ie disabling javascript support or some javascript incompatibility. I switch to another browser when that happens.
 
  • #7
Dale said:
I was able to replicate this behavior too. Must be some sort of lazy loading where the LaTeX rendering component only loads if the page contains LaTeX on loading.
As per the current configuration, a page that does not have any ##\LaTeX## does not load the MathJax resources. See this post of mine in a thread on the exact same issue: https://www.physicsforums.com/threa...oes-it-work-for-you-here.1006363/post-6531460

There's a bug that you need to be careful of before refreshing the page; otherwise the entire LaTeX will get rendered in the edit box itself, and clicking on Preview will result in gibberish, and you will likely lose what you have written. See the above link for a possible workaround.

This is a known issue for a long time. In fact, I had brought it up after the MathJax config was changed to lazy load: https://www.physicsforums.com/threads/latex-now-lazy-loading.1003734/post-6504644
 
  • Like
  • Informative
Likes jedishrfu, Heidi, mfb and 2 others
  • #8
Thanks you Wrichik Basu.
It works now.
 
  • Like
Likes Wrichik Basu
  • #9
jedishrfu said:
I've seen on some browsers where the tools when posting are all red and don't respond.

That can happen if you click the "Toggle BB code" button. . .
1663414726087.png
That might not be what you mean, though ?
 
Last edited:
  • Like
Likes Wrichik Basu

1. How do I preview latex formulas in a document?

To preview latex formulas in a document, you can use a latex editor or a plugin for your document editor. These tools will allow you to view the formulas as they will appear when the document is compiled.

2. What is the best tool for previewing latex formulas?

The best tool for previewing latex formulas depends on personal preference and the document editor you are using. Some popular options include Overleaf, TeXworks, and MathJax.

3. Can I preview latex formulas without installing additional software?

Yes, some document editors, such as Microsoft Word and Google Docs, have built-in support for latex formulas. This allows you to preview the formulas without installing any additional software.

4. How can I check for errors in my latex formulas?

Most latex editors and plugins have a built-in feature to check for errors in your formulas. Alternatively, you can use an online latex validator tool to check for errors before compiling your document.

5. Is there a way to preview latex formulas on a mobile device?

Yes, there are several mobile apps, such as TexPad and TeX Writer, that allow you to preview and edit latex formulas on your smartphone or tablet. These apps also have features to check for errors and compile your document.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
847
  • MATLAB, Maple, Mathematica, LaTeX
Replies
12
Views
795
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
23
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
819
  • MATLAB, Maple, Mathematica, LaTeX
Replies
9
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
799
Back
Top