4

I'm getting whitespace on the left of a standalone document when rendering equations in the mode in which they are surrounded by [ and ] (I think that's the mode in which they are supposed to be on their own line. Any ideas how to prevent this?

\documentclass[preview]{standalone}
\usepackage{amsmath,array}    
\begin{document}    
\[ 2x + 8 + 3x = 6x \]    
\end{document}
  • 4
    Don't use preview and type the equation as $\displaystyle ...$ – egreg Jun 5 '17 at 22:41
  • That worked. Can you add it as an answer? Also, why do so many standalone examples I've seen specify to use 'preview' (just curious). – composerMike Jun 5 '17 at 23:53
  • I've never seen it before. According to the manual: If enabled the class options varwidth, preview and beamer require the package or class of the same name. See also tex.stackexchange.com/questions/244348/… – John Kormylo Jun 6 '17 at 3:36
1

As far as I can see, preview is not able to crop the part at the left of the display.

To be honest, I never use that option; it's easier to use inline math mode, with \displaystyle to emulate a display.

\documentclass{standalone}
\usepackage{amsmath,array}
\begin{document}
$\displaystyle 2x + 8 + 3x = 6x$
\end{document}

For alignments you can use the inner forms, for instance

\documentclass{standalone}
\usepackage{amsmath,array}
\begin{document}
$\begin{gathered}
  2x + 8 + 3x = 6x \\
  5x + 8 = 6x
\end{gathered}$

\end{document}

No \displaystyle is needed, because it's done by default in these environments.

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.