# [texhax] compile to a small PDF

Philip TAYLOR P.Taylor at Rhul.Ac.Uk
Mon Sep 8 17:25:25 CEST 2008


ap wrote:

> But that's not satisfactory when I want, for some reasons, to compile
> using the pdflatex engine. So my question is, how can I generate a PDF
> using pdflatex in a way that acts like (latex + dvips -E + epstopdf) ?

An idea (untested) : typeset into a box, measure
the box, then set PdfTeX's page dimensions to the
box dimensions before shipping the box out.

Something like :

\setbox 0 = \hbox {$x = {-b \pm \sqrt {b^2 - 4ac} \over 2a}$}
\hsize = \wd 0
\vsize = \ht 0