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.
 

What is the purpose of the preview mode for Latex diagrams?

The preview mode for Latex diagrams allows users to see a rendered version of their code, giving them a better idea of how the final diagram will look.

Do Latex diagrams work in the preview mode for all types of diagrams?

No, the preview mode for Latex diagrams may not work for all types of diagrams. Some more complex diagrams, such as those with animations or interactive elements, may not be fully rendered in the preview mode.

Are there any limitations to using the preview mode for Latex diagrams?

Yes, there may be some limitations when using the preview mode for Latex diagrams. These limitations may include certain features not being fully rendered or the diagram appearing differently when exported to another platform.

Is the preview mode for Latex diagrams accurate?

The accuracy of the preview mode for Latex diagrams may vary depending on the complexity of the diagram and the specific code used. It is always best to test the diagram in the final platform or format to ensure accuracy.

Can I make changes to my Latex diagram in the preview mode?

Yes, you can make changes to your Latex diagram in the preview mode. However, it is recommended to make any major changes in the actual code rather than the preview mode to ensure accuracy and consistency.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
7
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
9
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
352
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
955
  • 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