Making Space in LaTeX Documents
by eric
A recent major proposal deadline gave me a chance to brush up on my LaTeX skills. As a rule, it’s better to make your proposal more concise than to play formatting tricks to squeeze more text in. For this proposal, though, I needed the big guns–for some sections the instructions alone were a significant fraction of the allotted space! Below are some tested methods for cramming more material into your page limit:
- Choose your text size. As a first step, be sure your text is set to the minimum allowed point size.
\documentclass[11pt]{article}
- Get the margins right. The geometry package provides the easiest means to specify margins.
\usepackage[paper=letterpaper, margin=1in, nohead, pdftex]{geometry}
If there aren’t firm margin requirements, the fullpage package is an alternative:
\usepackage[cm]{fullpage}
- Compress your lists. Standard LaTeX list environments leave lots of whitespace between the items. The paralist package provides
compactitem
andcompactenum
, drop-in replacements foritemize
andenumerate
.\usepackage{paralist} \begin{compactitem} \item Item text. \end{compactitem}
- Use runin headers. If your document is of any length, it’s helpful to organize it into parts, sections, subsections, and possibly even subsubsections. Standard LaTeX classes give each of these large headings on their own lines. The titlesec package provides an alternative: run-in headers. These appear in-line in the text, saving space. You can adjust the format and numbering with the
\titleformat
command. The commands below set up small-caps part headers on their own lines (“hang”), and variously sized run-in bold headings for sections.\usepackage[compact,medium]{titlesec} \titleformat{\part}[hang] {\Large\scshape}{}{0pt}{} \titleformat{\section}[runin] {\large\fontseries{b}\selectfont\filright}{}{0pt}{} \titleformat{\subsection}[runin] {\normalfont\fontseries{b}\selectfont\filright}{}{0pt}{} \titleformat{\subsubsection}[runin] {\fontshape{it}\selectfont\filright}{}{0pt}{}
- Use superscript citations. If your field allows it, no citation notation uses less space than superscripted numbers. The natbib package makes it easy.
\usepackage[super,sort&compress]{natbib} \bibpunct{}{}{,}{s}{}{,}
- Put captions beside floats. Figures and tables can end up with unused whitespace on the sides. The excellent LaTeX Wikibook provides several suggestions, including using the wrapfig package to wrap the text or using a minipage or the sidecap package to move the caption beside the text. I have used floatrow to accomplish the same task:
\usepackage{floatrow} \begin{figure} \floatbox[{\capbeside\thisfloatsetup{capbesideposition={right,center},capbesidewidth=0.46\textwidth}}]{figure}[\FBwidth] {\caption{ {\small Caption text here. \label{fig:myfig} }}} {\includegraphics[width=0.52\textwidth]{myfig.pdf}} \end{figure}
- Single-space the bibliography. The code below removes the bibliography section label and single-spaces the entries: put it in the document header.
% no title on bibliography header: this duplicates the section of % article.cls, removing the refname section \makeatletter \renewenvironment{thebibliography}[1]{% \list{\@biblabel{\@arabic\c@enumiv}}% {\settowidth\labelwidth{\@biblabel{#1}}% \leftmargin\labelwidth \advance\leftmargin\labelsep \@openbib@code \usecounter{enumiv}% \let\p@enumiv\@empty \renewcommand\theenumiv{\@arabic\c@enumiv}}% \sloppy \clubpenalty4000 \@clubpenalty \clubpenalty \widowpenalty4000% \sfcode`\.\@m} {\def\@noitemerr {\@latex@warning{Empty `thebibliography' environment}}% \endlist} \makeatother % make bibliography single-spaced \let\oldthebibliography=\thebibliography \let\endoldthebibliography=\endthebibliography \renewenvironment{thebibliography}[1]{% \begin{oldthebibliography}{#1}% \setlength{\parskip}{0ex}% \setlength{\itemsep}{0ex}% }% {% \end{oldthebibliography}% }
- Use or make a compact bibliography style. Exclude anything you can from the reference list. I made a BibTeX style file which defaults to “et al.” anytime there is more than one author.
- Discourage floats from getting their own pages. LaTeX uses a number of numeric weights to calculate where to position floats. Fiddling these parameters in the document header will encourage LaTeX to place them closer to each other and the text.
% discourage floats from getting their own page \renewcommand\floatpagefraction{.9} \renewcommand\topfraction{.9} \renewcommand\bottomfraction{.9} \renewcommand\textfraction{.1} \setcounter{totalnumber}{50} \setcounter{topnumber}{50} \setcounter{bottomnumber}{50} % shrink space between/after figures: \setlength{\textfloatsep}{10pt plus 1.0pt minus 2.0pt} \setlength{\floatsep}{10pt plus 1.0pt minus 2.0pt} \setlength{\intextsep}{10pt plus 1.0pt minus 2.0pt}
- Vacuum up the extra whitespace. Several more header parameters adjust white space between document elements.
% Reduce space between section titles % Arguments are space before, vertical space, and space after \titlespacing{\part}{0pt}{*0}{2ex} \titlespacing{\section}{0pt}{2pt}{1ex} \titlespacing{\subsection}{0pt}{2pt}{1ex} \titlespacing{\subsubsection}{0pt}{*0}{1ex} % suck up extra white space \setlength{\parskip}{0pt} \setlength{\parsep}{0pt} \setlength{\headsep}{0pt} \setlength{\topskip}{0pt} \setlength{\topmargin}{0pt} \setlength{\topsep}{0pt} \setlength{\partopsep}{0pt}
- Encourage paragraphs to consolidate words on their own lines. Individual paragraphs can be tweaked with
\looseness=-1
or simply set
\linepenalty=1000
at the beginning of the document.
- (Adjust or remove indentation.) Changing the paragraph indentation level can recover a few characters, but it makes the text harder to scan.
\setlength{\parindent}{0in}
- (Black Hat: Shrink the inter-line spacing.) While I’m not comfortable with this measure and it makes the text hard to read, it is possible to make the line spacing less than one.
\linespread{0.8}
As usual with LaTeX, there are multiple ways to accomplish the same goals–these are methods I personally have found convenient. The savetrees package provides an all-in-one solution which may be sufficient if you don’t want to tune the document style yourself.