Do Latex diagrams work in the preview mode?

  • Context: LaTeX 
  • Thread starter Thread starter Stephen Tashi
  • Start date Start date
  • Tags Tags
    Diagrams Latex
Click For Summary

Discussion Overview

The discussion revolves around the functionality of LaTeX diagrams in the preview mode of the message editor on a forum. Participants explore issues related to the display of commutative diagrams and other LaTeX elements, examining whether correct examples should work in preview mode and discussing potential solutions or workarounds.

Discussion Character

  • Technical explanation
  • Debate/contested
  • Meta-discussion

Main Points Raised

  • One participant reports that LaTeX diagrams do not display in preview mode and questions if correct examples should work.
  • Another participant confirms that a specific LaTeX example worked for them in preview mode, while another example did not, indicating variability in functionality.
  • A third participant notes that the MathJax implementation has idiosyncrasies that may affect the rendering of LaTeX, mentioning that sometimes LaTeX is not processed until the page is refreshed.
  • Some participants seek hints for reliably getting LaTeX to work in preview mode, suggesting that the presence of existing LaTeX on the page may influence whether new LaTeX renders correctly.
  • One suggestion includes laying out a post as a reply to ensure LaTeX renders before starting a new thread.

Areas of Agreement / Disagreement

Participants express varying experiences with LaTeX rendering in preview mode, indicating that there is no consensus on a reliable method for ensuring it works consistently.

Contextual Notes

Participants mention that MathJax is loaded lazily, which may lead to inconsistent rendering of LaTeX depending on the state of the page and whether it has been refreshed.

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 ·
Replies
7
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 9 ·
Replies
9
Views
6K
  • · Replies 5 ·
Replies
5
Views
1K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 11 ·
Replies
11
Views
8K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K