5

I have a problem which can be solved one of two ways:

  1. Typeset a given chunk of TeX in an "infinitely wide" space, then scale the result so that its width is the width of the page.

  2. Typeset a given chunk of TeX in an "infinitely wide" space, then set the page size to the width of the result.

Can anybody suggest how to do this with pdflatex? Unfortunately I can't use other TeXes like XeTeX, etc.

lockstep
  • 250,273
Adam
  • 293
  • FWIW, my document consists of several display-mode math ($$xyz$$) elements which are extremely wide, and nothing else. This appears to make the problem more difficult: many of the packages designed for this purpose can't use math-mode stuff in the detection of the proper page dimensions. – Adam Apr 01 '11 at 17:38
  • Second question is https://tex.stackexchange.com/q/452/250119. – user202729 Mar 05 '24 at 23:26

1 Answers1

5
  1. can be done using the graphics package and \resizebox{\paperwidth}{!}{<content>}

  2. can be done using the preview package (or with the standalone class using it). You need to set the preview border to 0 for that. For overly large material use:

    \usepackage[paperwidth=\maxdimen,paperheight=\maxdimen]{geometry}
    

    to set the page size first to maximum.

Martin Scharrer
  • 262,582
  • Hrm, neither of these work if the contents are larger than the page size. For example, I tried \usepackage[paperwidth=200in,centering]{geometry}\usepackage[displaymath,tightpage,active]{preview}\begin{preview} and the page is still 200in wide. Removing the \usepackage{geometry} crops off the sides of my content. – Adam Apr 01 '11 at 17:34
  • Perhaps I ought to mention that my document consists only of display-mode ("$$xyz$$") maths which are very wide, and nothing else. I need to set the page width based on the math -- there's no text body to use. – Adam Apr 01 '11 at 17:37
  • @Adam: You should have mentioned that it is display math from the beginning. Have a look at http://tex.stackexchange.com/questions/13981/crop-equations-with-preview-package/13983#13983 and http://tex.stackexchange.com/questions/13213/can-i-make-the-page-as-big-as-my-picture/13214#13214. – Martin Scharrer Apr 01 '11 at 17:52
  • Sorry! At the time I didn't know it made a difference. – Adam Apr 02 '11 at 18:18