Trying to write in LaTex and MathJax not picking up

  • #1
giodude
30
1
I'm attempting to use latex to write a question in the physics forum. However, when I click preview to check if the formatting is correct it doesn't reformat to display in its latex form, rather it stays in plain text. Any suggestions on what I may be doing wrong?

I've posted the screenshots of before and after clicking preview below.
 

Attachments

  • Screen Shot 2023-10-03 at 9.17.26 PM.png
    Screen Shot 2023-10-03 at 9.17.26 PM.png
    12.3 KB · Views: 35
  • Screen Shot 2023-10-03 at 9.17.38 PM.png
    Screen Shot 2023-10-03 at 9.17.38 PM.png
    11.9 KB · Views: 35
Physics news on Phys.org
  • #2
Reloaded the page and seems to have been fixed now.
 
  • Like
Likes berkeman
  • #3
It's a known bug that seems to be hard to fix.

The parser doesn't load on a page update (like when you reply to a thread), only on the initial load. So if there isn't already LaTeX on a page it doesn't render in a new post. Refresh the page to render.

Likewise, it doesn't work in reply preview unless there's already LaTeX. You can fix this by writing some LaTeX, going into preview, and then refreshing (it's a good idea to take a copy of your text first, just in case...).

LaTeX doesn't work at all in the new thread editor. My advice is to compose an opening post in the reply box of a thread with LaTeX, then paste it into the new thread start when you're happy.
 
Last edited:
  • Like
Likes mfb, berkeman and giodude
  • #4
The bug is actually worse than LaTeX not rendering. After writing some LaTeX, when you refresh the page, inline LaTeX will be rendered in the text editor itself. The moment you click Preview or Post Thread, the rendered LaTeX will be transformed into garbled text. You won't have the source code anymore.

A list of threads reporting the same issue is available here: https://www.physicsforums.com/threa...equation-rendering-issue.1046932/post-6816969

A workaround is mentioned here: https://www.physicsforums.com/threa...iew-on-this-forum-please.1050518/post-6862199
 
  • Informative
  • Like
Likes mfb and berkeman

1. Why is my LaTex code not showing up correctly in MathJax?

There could be a few reasons for this. First, make sure you are using the correct syntax for LaTex in MathJax. Also, check for any typos or missing symbols in your code. Additionally, if you are using MathJax in a website, make sure the MathJax script is correctly linked in your HTML document. If none of these solutions fix the issue, it is possible that MathJax may not support the specific LaTex code you are trying to use.

2. How do I write fractions or other mathematical expressions in LaTex?

To write fractions in LaTex, use the \frac{}{} command and place the numerator in the first set of curly braces and the denominator in the second set. For other mathematical expressions, refer to a LaTex guide or use online converters to generate the code.

3. Can I use LaTex in Microsoft Word or Google Docs?

No, LaTex is not compatible with Microsoft Word or Google Docs. However, there are plugins and extensions available that allow you to type LaTex code and convert it into a graphical representation in these programs.

4. How do I add equations or formulas to my LaTex document?

To add equations or formulas in LaTex, use the equation environment or the \begin{equation} command. For inline equations, use the $ symbol before and after the equation. It is important to note that MathJax may not support all LaTex commands, so it is best to check its documentation before using a specific command.

5. Why is my LaTex document not compiling?

If your LaTex document is not compiling, check for any errors in your code. Common errors include missing or mismatched curly braces, incorrect syntax, and missing packages. Also, make sure you have specified a document class at the beginning of your document. If you are still having trouble, try compiling your document on a different LaTex editor or online compiler to see if the issue persists.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
275
  • MATLAB, Maple, Mathematica, LaTeX
Replies
16
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
9
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
8
Views
13K
Replies
15
Views
5K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
2K
Back
Top