1

There is a way to dynamically enlarge a page in a LaTeX document? the thing I want is to have a document which will always have a single page, so the page should increase in height to hold all the document contents.

1

Of course it is possible :)

You can use the standalone class with the varwidth option to make the size automatically adjustable.

It can't get infinitely big (no computer can handle infinity) but this example code makes a 2.1 m wide and 5.6 m high page (in less than 7 seconds):

\documentclass[varwidth=500cm,margin=1cm]{standalone}
\usepackage{lipsum}
\begin{document}
\lipsum[1-150]
\lipsum[1-150]
\lipsum[1-150]
\lipsum[1-150]
\lipsum[1-150]
\lipsum[1-150]
\lipsum[1-150]
\lipsum[1-150]
\lipsum[1-150]
\end{document}

The argument you pass to varwidth is the width of the page, and its height grows dynamically.

If the page goes beyond 5.7 m tall TeX will complain, but long before that your PDF viewer will hang and you won't be able to read anything:

enter image description here

enter image description here

Your turn MS Office :)

| improve this answer | |
  • 1
    wow, that is just what I was looking for, perfect. Thanks. – Alysson Cirilo Mar 8 '19 at 12:07

Not the answer you're looking for? Browse other questions tagged or ask your own question.