0

This question already has an answer here:

Given a file master.tex:

\documentclass{article}

\usepackage{standalone}

\begin{document}
\input{sub}
\end{document}

and a file sub.tex:

\documentclass{standalone}

\begin{document}
\[
        0
\]
\end{document}

the command pdflatex master.tex runs as expected, but the command pdflatex sub.tex gives the error

Bad math environment delimiter.

Can anyone explain what is going on and/or how to solve this?

marked as duplicate by LaRiFaRi, Andrew Swann, user31729, jmc, egreg math-mode Jun 12 '14 at 11:41

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • I agree about the possible duplicate. This question can be closed. Or should I delete it myself? – jmc Jun 12 '14 at 11:23
1

Standalone is not meant to be used with the environments displaymath or equation as it would not know, where to put the labelling number. You should do it the following way.

% arara: pdflatex 

\documentclass{standalone}

\begin{document}
$\displaystyle
        0
$
\end{document}

If you want to mimic a real document equation, you should use the prewiev option of the standalone class.

  • The preview option seems to be what I need. – jmc Jun 12 '14 at 11:18

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