Do Latex diagrams work in the preview mode?

In summary, there are some issues with using LaTeX in the message editor's preview mode. It may not render properly until the page is refreshed, and it may not work at all if you are starting a new thread. One workaround is to lay out your post as a reply to something and then cut and paste it to your new thread.
  • #1
Stephen Tashi
Science Advisor
7,861
1,598
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
  • #2
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.
 
  • #3
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.
 
  • #4
Are there hints for getting Latex to work reliably in the message editor's preview mode?
 
  • #5
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

  • MATLAB, Maple, Mathematica, LaTeX
Replies
7
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
9
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
371
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
997
  • MATLAB, Maple, Mathematica, LaTeX
Replies
7
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
8
Views
11K
Back
Top