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?

  • 4
    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 Dec 15 '12 at 13:51

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.

| improve this answer | |
  • 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! – Frederik Brinck Jensen Dec 16 '12 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 Dec 16 '12 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.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.