12

I have a document that is about 1/3 to 1/2 page long. I want to compile it to a PDF document. That PDF document will be included in another document, so I want it to be short - it should contain only the contents of the document, without white space below it. How can I do this?

1

2 Answers 2

12

You could use the standalone class in combination with a minipage of the same width as the text in your main document:

\documentclass{standalone}

\usepackage{lipsum}

\begin{document}

\begin{minipage}{345pt}
\lipsum[2]
\end{minipage}

\end{document}

To find out what the width of the text in your main document is, the showdim package offers the \tenthpt macro:

\documentclass{article}

\usepackage{graphicx}
\usepackage{lipsum}
\usepackage{showdim}

\begin{document}

\tenthpt{\textwidth}

\lipsum[2]

\noindent\includegraphics[width=\textwidth]{document}

\end{document}

enter image description here

(the vertical space between the text and the image might need a bit of adjustment)

10

Use pdfcrop:

\documentclass{article}

\usepackage{lipsum} % for mock text

\pagestyle{empty} % no page ornaments

\begin{document}

\lipsum[1]

\end{document}

Save this as shortdoc.tex and run

pdflatex shortdoc
pdfcrop shortdoc

This will produce shortdoc-crop.pdf, that you can include with \includegraphics.

You must log in to answer this question.

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