# Standalone: unique page per equation without white space

I'd like to create a document with several formulas and each formula is supposed to stand alone on a page. Here is an example:

\documentclass[preview,varwidth ,multi,border=1pt]{standalone}
\usepackage{amsmath}
\def\D{\mathrm{d}}

\begin{document}
%(i)
\preview
$\int^{10}_0{\frac{1}{2}\D t}$
\endpreview

%%(ii)
\preview
$$\int^{10}_0{\frac{1}{2}\D t}$$
\endpreview

%%(iii)
\preview
\begin{align}
\int^{10}_0{\frac{1}{2}\D t}\\
\int^{10}_0{\frac{1}{2}\D t}
\end{align}
\endpreview

\end{document}


The first version (i) works actually quite fine, however I don't like the compressed int sign of the inline math mode. While in the second version (ii) there is a white space. Is it possible to get a standalone equation without white space? Regards

\edit: Thanks for the quick response. It works fine. I just relized that I have to deal with systems of equations as well. That is some equations are supposed to stand alone and some should stand together on one page. See the additional (iii) above, where the white space still occurs. Any suggestions?

-
I have edited my answer to deal with (iii). – Ian Thompson Aug 25 '14 at 14:08

Just use your first version, with \displaystyle.

\documentclass[preview,varwidth ,multi,border=1pt]{standalone}
\usepackage{amsmath}
\def\D{\mathrm{d}}
\begin{document}
%(i)
\preview
$\displaystyle\int^{10}_0{\frac{1}{2}\D t}$
\endpreview
\end{document}


For systems of equations, you can use aligned inside single dollar signs.

\documentclass[preview,varwidth ,multi,border=1pt]{standalone}
\usepackage{amsmath}
\def\D{\mathrm{d}}
\begin{document}
%%(iii)
\preview
\begin{aligned} \int^{10}_0{\frac{1}{2}\D t}\\ \int^{10}_0{\frac{1}{2}\D t} \end{aligned}
\endpreview
\end{document}

-
you can handle the multi-line requirement with aligned, which works in-line (with \displaystyle, of course) as well as in display. – barbara beeton Aug 25 '14 at 14:05
sweet. thanks guys. – simon Aug 25 '14 at 14:39
@simon I would like to bring to your attention that barbara is a lady ;) – yo' Aug 25 '14 at 14:43
no offense intended. non-native detected. I thought in plural it's unisex ;-) – simon Aug 25 '14 at 15:30

You can also extract each inline math into a separate tight page as follows. The border can be adjusted, see my comment in the code.

This approach frees you from manually copying and pasting each inline equation from your original TeX input file to a new input file as you did in your minimal working example. Does it sound much better approach?

\documentclass[12pt]{article}
\usepackage{amsmath}

\usepackage[active,tightpage,textmath]{preview}
\PreviewBorder=12pt\relax% you can set this border to zero if needed.

\def\D{\mathrm{d}}

\begin{document}
This is a dummy text just for fun, $\displaystyle\int^{10}_0{\frac{1}{2}\D t}$.

Cyanide-based food is good for our health, $\displaystyle\int^{10}_0{\frac{1}{2}\D t}$

And the following equation are \ldots
\displaystyle \begin{aligned} \int^{10}_0{\frac{1}{2}\D t}\\ \int^{10}_0{\frac{1}{2}\D t} \end{aligned}

\end{document}


-