[Tex/LaTex] What’s the absolute largest paper size permissible with pdflatex

geometrypaper-sizepdftex

I've had occasion to typeset extraordinarily large matrices, which I didn't seriously expect anyone to expect in detail (without a computer) or print, but I needed it to be obvious that they were completely explicit and written down somewhere.

By trial and error, I found a really large paper size that would compile (about 5.5m) in pdflatex and fit my matrices on a reasonable number of sheets. (I used the geometry package to choose custom page sizes.) But it would have been easier if I'd been able to find out:

What are the limitations on paper sizes in pdflatex?

Best Answer

From the immensely useful TeX by Topic:

\maxdimen 16383.99999pt; the largest legal dimension.

and

Internally TEX works with multiples of a smallest dimension: the scaled point. Dimensions larger (in absolute value) than 2^30 − 1sp, which is about 5.75 metres or 18.9 feet, are illegal.

Knuth delivered a beautiful extended dig at "modern" software development practices at the 2010 TUG meeting, during the early part of which he referred to the value of \maxdimen. I can't work out if he was serious when he suggested it had been a mistake to fix the largest dimension in TeX at this rather small value.


Perhaps it is worth mentioning that as far as I know, pdflatex does not apply any more restrictive limits than TeX itself for this application. So the limitation that is relevant here is the internal TeX one.