Latex: Squeezing the Vertical White Space

Here are some tips on how to “compress” your paper vertically by minimizing white space gaps between elements. I had to do this few days ago when school refused to duplicate my syllabus because it was 14 pages long. I got it down to 6 without any cuts, and then down to 3 after doing some reductions in text.

So how do we squeeze the vertical whitespace? There are many ways to do this, and some are more complicated than the other. My tips range on the easy side, so you won’t need to write custom .sty files or redefine commands using intricate tex sequences.

First we want to set the spacing between paragraphs as small as possible. The commands below should kill just about any space inducing setting in your paper unless you are doing something fancy:

\setlength{\parskip}{0pt}
\setlength{\parsep}{0pt}
\setlength{\headsep}{0pt}
\setlength{\topskip}{0pt}
\setlength{\topmargin}{0pt}
\setlength{\topsep}{0pt}
\setlength{\partopsep}{0pt}

Now the paragraphs are snugly against each other so let’s take a look at line spacing. The \linespread command is usually used to increase the line spacing but we can exploit it to make it smaller by passing in a value smaller than 1:

\linespread{0.5}

You may want to play around with that value – if you set it to small, LaTex will just reject it. Below certain threshold some lines may start running into each other. For me 0.5 value did the trick, and slurped up swaths of white space.

Our next offender are section headings. By default they have huge gaps above and below them. Totally wasteful, especially if you are trying to save trees by decreasing your page count without sacrificing content. So what do you do? There are very complex ways to change the spacing above and below the section headings but we are lazy bums and don’t feel like using them. So let’s use the titlesec package and zero out all the spaces:

\usepackage[compact]{titlesec}
\titlespacing{\section}{0pt}{*0}{*0}
\titlespacing{\subsection}{0pt}{*0}{*0}
\titlespacing{\subsubsection}{0pt}{*0}{*0}

If you look int the documentation, the attributes to \titlespacing are command, left margin, above-skip and below-kip respectively. The * notation replaces the formal notation using plus/minus and etc. If you set it to zero, headings will snug up to the paragraphs above and below them.

Enumerations and itemizations are horrible space wasters too. By default, all the lists are double-spaced. Why? Don’t ask me, but it’s easy to get rid of that by using “compacted” lists provided by the mdwlist package. In your preamble add:

\usepackage{mdwlist}

Then instead of using normal lists use:

\begin{enumerate*}
	\item
\end{enumerate*}
 
\begin{itemize*}
	\item
\end{itemize*}

This is not as straightforward as the other steps, as it will require some search and replace in a pre-existing text. If you know a better way to do this, please let me know.

Last thing I did was to change my margins using the geometry package. My command looked like this:

\usepackage[left=2cm,top=1cm,right=2cm,nohead,nofoot]{geometry}

My document had no headers or footers so I was able to disable them. You should probably experiment a bit with the values above to see what is the maximum range of your printer. Most devices won’t print all the way to the paper edge so you must set margins appropriate to your printer.

My document had no formulas or figures, but had several long item lists. Some of them were very narrow – 2-3 words per item. These types of lists are major space wasters so I set them in multi-column mode. Depending on your list you can either use 2, 4 or either 4 columns. For me 2 columns were the right fit. I recommend using the multicol package. In your preamble add:

\usepackage{multicol}

Then surround your text to be “columnized” (shut up, it’s a new word I just mad up) using:

\begin{multicols}{2}
	% your stuff goes here
\end{multicols}

Once I did all of that, the page count of my document was cut roughly in half. Feel free to add your vertical space squeezing tips in the comments.

Related Posts:

  • LaTex Annoyances
  • Lyx – Easy LaTex without Spell Check
  • Installing LaTex on Windows
  • LaTex: Fixing Wrong Figure Numbers
  • Latex: Rotate Inserted Images
  • Latex: Numbered Subsubsections
  • Code Segments in Latex
  • Convert JPG and PNG to EPS on Windows
  • LaTex: Making Floatng Text Boxes
  • Latex Conditionals

  • 16 Responses to “Latex: Squeezing the Vertical White Space”

    1. Brian UNITED STATES Mozilla Firefox Mac OS says:

      Thanks for these tips. Your method for eliminating space around sections is nice and clean. To get closer spacing in lists, you can also try redefining the enumerable environment as follows:

      % redefine enumerate env for closer spacing
      \renewenvironment{enumerate}%
        {\begin{list}{\arabic{enumi}.}%
           {\topsep=0in\itemsep=0in\parsep=0in\partopsep=0in\usecounter{enumi}}%
         }{\end{list}}
      
      Reply  |  Quote
    2. Mikaël BELGIUM Mozilla Firefox Windows says:

      Another possibility is to include the line

      “\setlength{\itemsep}{1ex or some other latex measure of length}”

      after the “\begin{enumerate}” or “\begin{list}” command. (Also works with the \begin{enumerate*} command from the mdwlist package)

      This allows you to choose the amount of spacing between the items for each separate itemization or enumeration. That way you can still have some spacing without it eating the whole page. This can also be more pleasant on the eyes if some of the items are comprised of a few lines of text.

      Reply  |  Quote
    3. Luke Maciak UNITED STATES Mozilla Firefox Ubuntu Linux says:

      Nice! Thanks for the tip!

      Reply  |  Quote
    4. Serguei CANADA Mozilla Firefox Windows says:

      This:

      \usepackage{savetrees}

      does most if not all of that is described above. The package is pretty much standard and is carried by most LaTeX distributions (I used in in Fedora’s tetex, MacOS, and Windows (MiKTeX) standard distributions on a several occasions.

      Also, I’ve found this useful:

      http://www-h.eng.cam.ac.uk/help/tpl/textprocessing/squeeze.html

      Personally, what I could not find yet is how to reduce the blank space on the title page before the title and the top margin when using the standard article class. All I want is just that — no extra slack space between the top
      margin and the title on the title page.

      Thanks,

      -s

      Reply  |  Quote
    5. Luke Maciak UNITED STATES Mozilla Firefox Ubuntu Linux says:

      Hey, thanks for the tip. I didn’t really know about the savetrees package. Heh. this is yet another example how comments can often be better than the contents of a blog post! :P

      Reply  |  Quote
    6. pravin INDIA Mozilla Firefox Linux says:

      You’re brilliant! Thank you. Saved me a lot of time.

      Reply  |  Quote
    7. Alexmart UNITED STATES Mozilla Firefox Windows says:

      Very helpful tips. Thanks a lot!

      Reply  |  Quote
    8. JGU UNITED STATES Mozilla Firefox Windows says:

      If you have figures and tables then \usepackage{wrapfig} which defines the wrapfigure and wraptable environments, is essential. It wraps the text around the typeset figure or table, allowing placement either at either left or right margins, or centered.

      Reply  |  Quote
    9. Fatima OMAN Internet Explorer Windows says:

      How can you reduce the space following the table of contents title “Contents”, i.e., the space between “Content” and the first item in the table of contents?

      Also, how can you reduce the space following the List of Figures and List of Tables titles?

      Thanks

      Reply  |  Quote
    10. Sam CYPRUS Mozilla Firefox Windows says:

      Thanks a bunch man!

      Reply  |  Quote
    11. MPF ITALY Mozilla Firefox Mac OS says:

      It works! Many thanks! :-)

      Reply  |  Quote
    12. Anne UNITED STATES Mozilla Firefox Ubuntu Linux says:

      Thank you! This is much simpler and more comprehensive than most explanations I’ve seen on the subject.

      Reply  |  Quote
    13. bhargav INDIA Mozilla Firefox Windows says:

      excellent …. thank you very much sir…..

      Reply  |  Quote
    14. santiago UNITED STATES Mozilla Firefox Ubuntu Linux says:

      It seems to me that there is an easier way to descrease the space between lists (or at least, one which does not incllude renaming every list).

      Take a look at: http://dcwww.camd.dtu.dk/~schiotz/comp/LatexTips/LatexTips.html#tweakl ist

      Reply  |  Quote
    15. [...] A few more tricks are explained here and here. [...]

    16. Lauren AUSTRALIA Mozilla Firefox Windows says:

      Thanks very much for the tips, they solved my space issues :)

      Reply  |  Quote

    Leave a Reply