1

is there a way to generate a (single-page) PDF with pagesize that is just large enough for the text that I want to display?

Perhaps something along these lines:

  \documentclass{article}
  \pagestyle{empty}
  \usepackage[papersize=minimal]{geometry}
  \begin{document}
  \[
     Some beautiful formula
  \]
  \end{document}

And then produce a PDF with a pagesize that is just enough for the "beautiful formula".

2
  • 4
    See the standalone class. Feb 13, 2020 at 14:21
  • @UlrikeFischer That seems indeed to be the solution. I'll "play" with it. Danke!
    – pe1aqp
    Feb 13, 2020 at 14:31

1 Answer 1

1

For a single line and no equation number, use \displaystyle:

\documentclass{standalone}
\begin{document}
\( \displaystyle E=mc^2 \)
\end{document}

For multiple lines with no equation numbers, you can abuse a tabular.

\documentclass{standalone}
\usepackage{array}

\begin{document}
\begin{tabular}{@{}>{$\displaystyle}r<{\null$}@{}>{$\displaystyle\null}l<{$}@{}}
E &= mc^2 \\
e^{i\theta} &= \cos\theta + i\sin\theta
\end{tabular}
\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .