# Bad math environment delimiter in standalone class [duplicate]

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

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 StackExchange.ready(function() { if (StackExchange.options.isMobile) return; $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() { var$hover = $(this).addClass('hover-bound'),$msg = $hover.siblings('.dupe-hammer-message');$hover.hover( function() { $hover.showInfoMessage('', { messageElement:$msg.clone().show(), transient: false, position: { my: 'bottom left', at: 'top center', offsetTop: -7 }, dismissable: false, relativeToBody: true }); }, function() { StackExchange.helpers.removeMessages(); } ); }); }); Jun 12 '14 at 11:41

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

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