LaTeX Do Latex diagrams work in the preview mode?

  • Thread starter Thread starter Stephen Tashi
  • Start date Start date
  • Tags Tags
    Diagrams Latex
AI Thread Summary
The discussion centers on the challenges of displaying commutative diagrams and LaTeX code in the message editor's preview mode. Users report that some LaTeX examples do not display correctly, raising the question of whether valid examples should work in preview mode. One user successfully displayed a commutative diagram while another encountered errors with a different example. The conversation highlights that MathJax, which processes LaTeX, has specific quirks, including lazy loading that may prevent rendering until the page is refreshed. To improve reliability, users are advised to include LaTeX in replies to existing posts, as this can trigger rendering, and to refresh the page if it doesn't display correctly. Overall, the thread emphasizes the need for better understanding and troubleshooting of LaTeX in the message editor.
Stephen Tashi
Science Advisor
Homework Helper
Education Advisor
Messages
7,864
Reaction score
1,602
I pasted examples (taken from old threads) of doing commutative diagrams in LaTex into the message editor and tried them in the preview mode. They didn't display. Should a correct example work in the preview mode?

I'll paste a couple in this message and see if they show up in the final post.

##\begin{array}{ccccc} ~ & ~ & f & ~ & ~ \\ ~ & A & \longrightarrow & B & ~ \\ g & \downarrow & ~ & \downarrow & h \\ ~ & C & \longrightarrow & D & ~ \\ ~ & ~ & k & ~ & ~ \end{array}##

##
\documentclass{article}
\usepackage{graphics}
\begin{document}
\begin{figure}
\includegraphics{sin}
\caption{\label{sin}The sine function.}
\end{figure}
\end{document}
##
 
Physics news on Phys.org
Stephen Tashi said:
I pasted examples (taken from old threads) of doing commutative diagrams in LaTex into the message editor and tried them in the preview mode. They didn't display. Should a correct example work in the preview mode?

I'll paste a couple in this message and see if they show up in the final post.

##\begin{array}{ccccc} ~ & ~ & f & ~ & ~ \\ ~ & A & \longrightarrow & B & ~ \\ g & \downarrow & ~ & \downarrow & h \\ ~ & C & \longrightarrow & D & ~ \\ ~ & ~ & k & ~ & ~ \end{array}##

##
\documentclass{article}
\usepackage{graphics}
\begin{document}
\begin{figure}
\includegraphics{sin}
\caption{\label{sin}The sine function.}
\end{figure}
\end{document}
##
This one worked for me in preview mode (Win 11, Chrome).

##\begin{array}{ccccc} ~ & ~ & f & ~ & ~ \\ ~ & A & \longrightarrow & B & ~ \\ g & \downarrow & ~ & \downarrow & h \\ ~ & C & \longrightarrow & D & ~ \\ ~ & ~ & k & ~ & ~ \end{array}##

The other one gives me the same error.
 
Compare the underlying Latex and you'll see why one works and the other does not - our MathJax implementation has some idiosyncracies. A second confounding factor is that MathJax is loaded lazily so that sometimes the Latex won't be processed at all (neither the typesetting you expected nor an error) until the page is refreshed.
 
Are there hints for getting Latex to work reliably in the message editor's preview mode?
 
Stephen Tashi said:
Are there hints for getting Latex to work reliably in the message editor's preview mode?
If you are starting a new thread, no, you're stuck. Try laying out your post as a reply to something then cut and paste it to your new thread.

If you are replying the put some LaTeX in your post and preview it. If there's already LaTeX in the page it should render. If not, it won't render. In that case, refresh the page while still in preview mode. Preview again and the LaTeX should render.
 

Similar threads

Replies
7
Views
3K
Replies
3
Views
2K
Replies
5
Views
3K
Replies
7
Views
3K
Replies
2
Views
3K
Back
Top