25

Many PDFs are never printed but are read in electronic form, where, for at least some readers and reading styles, it would be advantageous to have a single page through which the reader could continuously scroll.

Is there a way to adjust "paper" size so that the entire document fits on a single "page"? Are there aspects of the TeX architecture that would make this difficult; features of packages or popular document styles that would break?

In particular, I'd be interested in doing this for Tufte-LaTeX, which (with it's sidenotes in place of footnotes and citations) is well-suited for this scenario.

20

There was a solution given by Veytsman and Ware in Tugboat 32 (2011) 261 in an article titled "Ebooks and paper sizes: Output routines made easier" to be found at https://www.tug.org/members/TUGboat/tb32-3/tb102veytsman-ebooks.pdf (Access to the content is restricted to members of the TeX Users Group until the end of 2012.)

Their idea is not to make one big page for the whole document, but one page for each section, and they found a trick to set the page size dynamically to the actual size of the text without white space.

I worked out a preliminary version of a package using their idea. At http://www.phys.psu.edu/~collins/screenread/ you can find the package, a test file and an example of the resulting pdf file. You could try modifying it to give one page for the whole of a document.

  • Thanks. I'll have a look at that. The real real question for me though will me: does it work with Tufte-LaTeX. – orome Mar 27 '12 at 22:02
  • No joy with Tufte-LaTeX, unfortunately. But this seems to be the state of the art, so I'll take this as the answer. – orome Mar 30 '12 at 15:18
  • @JohnCollins: Nice package! Are you planning to publish this properly, e.g. on CTAN? – Joachim Breitner Mar 18 '15 at 14:30
9
\documentclass{article}
\setlength\textheight{30\textheight}

produces

! Dimension too large.
<recently read> \textheight 

so simply making a very tall page causes problems for even quite modest documents.

TeX's architecture generally tries to clear out pages as quickly as possible, unlike line breaking which does a least cost analysis of the breaking over a whole paragraph, page breaking (usually) only considers one potential break at a time, and the memory taken up by the scroll for the page shipped out is recycled. This enabled TeX to process arbitrarily long documents even in the small memory available at the time.

Now of course, there is more memory available but it's not clear to see how TeX could adapt. Probably the thing to do would be to have a simplified output routine that continuously shipped out pages without adding header or footer at all; and then a simple post process with a pdf tool could stitch the pages back together.

  • Header and footer would be fairly easy as would the stitching. What settings are equivalent to telling TeX: "take the first possible page break that you can"? – Loop Space Mar 27 '12 at 18:54
  • just a default output routine, with no floats/footnotes does essentially that. (Assuming you don't mean what you said, or it would break after every line and leave every page underfull, so you want some of the usual aspects of breaking within badness tolerances) but you'd also want to do some trick code so that the white space that is normally discarded when a break occurs is never discarded (usual dance with penalties and rules, probably, ie make sure TeX never breaks before vertical glue. – David Carlisle Mar 27 '12 at 19:03
1

I believe that modyfing some properties of your document will get you very close to what you want, even without the need of one long page. It will happen that there will be an empty vertical space, but not that often with these settings. See the commented MWE:

\documentclass[a4paper]{article}

\usepackage[margin=1mm]{geometry} % no margins
\usepackage[bottomtitles]{titlesec} % allow titles to be at the bottom of the page
\widowpenalty=0\relax % no empty lines at the end of page
\clubpenalty=0\relax % no empty lines at the end of page
\pagestyle{empty} % no headers or footers

\usepackage{lipsum}
\begin{document}
\lipsum[1-60]
\end{document}
0

You can try the following 5 metre page and see the problems. Your users will have no idea or orientation as to where the document will end, can you scroll at the end?

\vsize500cm
\vbox to 575cm{
\vrule height500cm
}
\bye

(Most readers will fail to display this properly)

  • I'm not sure I understand: I want it to end where the text ends. – orome Mar 27 '12 at 19:25
  • @raxacoricofallapatorius Sorry maybe I misunderstood you. Approach in plain TeX, declare a large value of \vsize500cm. Provided you text is less than 5meters long it would compile. – Yiannis Lazarides Mar 27 '12 at 19:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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