How to make unlimited sheet of paper in LaTeX? [duplicate]

How can I make LaTeX to do the unlimited (just as big, as the content) sheet of paper?

So everything goes right on the one page.

1 Answer

The package incgraph provides an environment inctext which does exactly what you look for. The text or graph or whatever determines the paper size. That means, width and height of the paper are both determined by the content. This could be useful e.g. for drawing pictures. I added an example where a tikzpicture is drawn on the second sheet of paper (without using the externalization library which is brillant but often a pain).

\documentclass{article}
\usepackage{incgraph}
\usepackage{tikz}

\begin{document}
\begin{inctext}
Whatever
\end{inctext}

\begin{inctext}
\begin{tikzpicture}
\path[fill=yellow!50!white] (0,0) circle (11mm);
\path[fill=white] (0,0) circle (9mm);
\foreach \w/\c in {90/red,210/green,330/blue}
{\path[shading=ball,ball color=\c] (\w:1cm) circle (7mm);}
\end{tikzpicture}
\end{inctext}
\end{document}


The picture actually shows TWO sheets of paper with the Adobe Reader.

• Using your package also the width of the page is determined by the contents of the document, am I right? – karlkoeller Jul 3 '13 at 7:03
• Also if I add \usepackage{lipsum} and \lipsum inside the document I get ! Dimension too large. error. – karlkoeller Jul 3 '13 at 7:05
• Yes, the contents determine the actual width. If you use \lipsum without anything else, this gives a VERY long line (too long!). If you use e.g. a minipage of a certain width to envelope the lipsum text it should work as you may want to - as long as the contents do not extend TeX's maximal dimensions. – Thomas F. Sturm Jul 3 '13 at 8:31
• Thanks for the info. BTW, why don't you put a more detailed answer (including the explanation in your comment) in those answers of which this one has been made "duplicate of"? – karlkoeller Jul 3 '13 at 8:34
• @ThomasF.Sturm: +1: for incgraph! Looks amazing! :) – Count Zero Jul 3 '13 at 8:45