I've been trying to figure out how latexit works, however, when I enter this simple piece of code, I get a long message of different errors as "LaTeX Error Bad environment delimiter", "You can't use `\eqno' in math mode", "Missing \endgroup inserted." ... etc.

Here is the code:

\begin{equation} \label{xx}
x^2 - 5 x + 6 = 0

What am I doing wrong?

  • 5
    It's because LaTeXit has some code written before and after where you write. Under the space where you write, you have four buttons (align, text, ...). You are probably in align (which means that everything you write is between \begin{align} and \end{align}. If you select text it works.
    – Manuel
    Commented Dec 15, 2012 at 13:51

2 Answers 2


Latexit will have a preamble and a postamble of its own which you can access through its preferences (Edit > Preferences)

enter image description here

The standard preamble contains a \begin{displaymath} and the postamble \end{displaymath}:

enter image description here

Hence if you add \begin{equation} and \end{equation} in your code, you will get an error:

! LaTeX Error: \begin{document} ended by \end{displaymath}.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.

l.11 \end{displaymath}

! Extra \endgroup.
<recently read> \endgroup 

l.11 \end{displaymath}

Remove \begin{equation} and \end{equation}, you get the result:

enter image description here

PS: Since the equations are exported as images from latexit and inserted elsewhere, I feel that it is not a good idea to use equation number (which is inserted by equation environment) and a label. It is better if they are included in the main document. However, for your own reasons if you want them, replace \begin{displaymath} with \begin{equation} in the preamble and \end{displaymath} with \end{equation} in the postamble of latexit.

  • 2
    Thanks, it works know. Just one last question. I'm using latexit for MAC. Where do I find the postamble? I only have a preamble in the preferences pane! Commented Dec 16, 2012 at 9:16
  • @FrederikBrinckJensen: Sorry. I don't use MAC. For me in windows, it comes as in the picture above (It is not exactly what you get on MAC). Probably it might be hidden under some other menu which I can't help :-(
    – user11232
    Commented Dec 16, 2012 at 9:25

On a Mac, you can change the mode of LaTeXiT by clicking on one of the buttons above the main window. It should avoid problems with the preamble and postamble.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .