8

I know about geometry and savetrees, but what I have in mind is something else. I'd like to be able to \usepackage something that would leave the size of the text block but decrease the margins (equivalently paper size), so that a pdf viewer that is set to "fit to width" or even "fit to page" would display as much as possible without wasting screen real estate (which - contrary to the situation with paper - is extremely expensive in terms of productivity, especially when I have a laptop screen with moderate resolution) on the one hand and additional scaling on the other (which is a bit cumbersome as I don't "focus" my pdf viewer).

9
  • \documentclass{standalone} leaves no margins, but I'm guessing this is not quite what you are looking for?
    – user49901
    Sep 24, 2016 at 6:17
  • It leaves them for me...
    – mbork
    Sep 24, 2016 at 6:18
  • Ah, sorry, I tried \usepackage{standalone}. Of course, \documentclass{standalone} is no use - I want to preserve all settings of e.g. amsart (text block size among other things). Thanks anyway.
    – mbork
    Sep 24, 2016 at 6:20
  • geometry lets you set the paper size as well, so if you do some calculations, I suppose it wouldn't be hard to get very small margins with the same textblock. You can find some useful numbers with \documentclass{amsart} \usepackage{layout} \begin{document} \layout \end{document}. Sep 24, 2016 at 6:28
  • 2
    On a viewer like SumatraPDF, this is called fit to contents. I suppose many other viewers have this functionality.
    – Bernard
    Sep 24, 2016 at 10:19

1 Answer 1

12

Here is a trick

\documentclass{amsart}
\usepackage{lipsum}% just for the example

\edef\mtht{\the\textheight}
\edef\mtwd{\the\textwidth}
\usepackage[paperwidth=\mtwd,paperheight=\mtht,text={\mtwd,\mtht}]{geometry}

\begin{document}
\lipsum[1-14]
\end{document}

Edit It could be better with \let

\let\mtht\textheight
\let\mtwd\textwidth

one can make small margins

\usepackage[paperwidth=1.04\mtwd,paperheight=1.02\mtht,text={\mtwd,\mtht}]{geometry}

Update following comments below, one can try

\usepackage[paperwidth=\dimexpr\mtwd+0.5cm\relax,
            paperheight=\dimexpr\mtht+2cm\relax,
            text={\mtwd,\mtht}]{geometry}

\documentclass{amsart}
\usepackage{lipsum}% just for the example

\edef\mtht{\the\textheight}
\edef\mtwd{\the\textwidth}

\usepackage[paperwidth=\dimexpr\mtwd+0.5cm\relax,
            paperheight=\dimexpr\mtht+1.5cm\relax,
            text={\mtwd,\mtht},
            top=1cm]{geometry}

\begin{document}
\lipsum[1-14]
\end{document}
8
  • the first version looks safer (the \let version depends on the order geometry sets things internally, I didn't look to check. Sep 24, 2016 at 9:30
  • @DavidCarlisle you're right i forgot this point (may be better means shorter or quicker :-)) i did not look too, but it seems natural or let's hope that.
    – touhami
    Sep 24, 2016 at 9:43
  • 1
    very cute! i have tested this with an actual submission to an ams journal, and found a small problem. it cuts off anything that descends below the baseline of the last text line on a page; this includes descenders, some math subscripts, and the page number on the first page; it would also cut off anything produced by \enlargethispage. and it would cut off any overfull boxes at the right; but that might reasonably be ignored. however, the length really is a problem; add the equivalent of two baselines, and i think you're good. Sep 24, 2016 at 13:38
  • 1
    more testing with actual submission. the top is a bit tight to the running head, and there's also more space than needed at the bottom. if you change the options for geometry to be paperheight=\dimexpr\mtht+1.5cm and add top=1cm the result is nicely centered with just a bit of "air" on all sides. since the folio on the first page is a drop folio, that automatically leaves a bit more than one blank line on other pages, which would easily accommodate an \enlargethispage{1\baselineskip}. (i'm saving this for future reference.) Sep 24, 2016 at 17:18
  • @barbarabeeton thank you again and feel free to edit my answer.
    – touhami
    Sep 24, 2016 at 17:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .