Skip Navigation.

LaTeX: Spacing

Spacing

Spacing can be altered in LaTeX either throughout the document, by using packages and controls to make the spacing consistent, or by using manual changes for specific spacing needs.

Document Wide Spacing

Changing the spacing on a document-wide basis is done for different document settings using different packages. The sectsty package controls the spacing of section headings; the mdwlist package controls the spacing for lists; the geometry package controls the overall margins and text area of the document. All of these packages must be called in the preamble of the document and specified when called. For instance, the geometry package is called with the use package command, followed by the options, and then the package name, like this:
\usepackage[left=2cm,top=1cm,right=3cm,nohead,nofoot]{geometry}

Specific Area Spacing

There are several command available when you need only specific area spatial changes. These are:

  • Flexible vertical space: This is made using one of three preset commands:
    \smallskip
    \medskip
    and \bigskip
    These commands can only be used after a paragraph break (which is made by one completely blank line or by the command \par). These commands output flexible or rubber space, approximately 3pt, 6pt, and 12pt high respectively, but these commands will automatically compress or expand a bit, depending on the demands of the rest of the page.

  • Fixed vertical space: This will prevent the text height from shrinking or stretching. This must also be used after a paragraph break. Bear in mind that fixed spacing can make for very ugly and odd documents, so please consult the other manuals before implementing fixed spacings. Fixed vertical spacing is called with the command: \vspace{length} The command is followed by a length in curly braces. Extra space will be discarded to make the text exactly fit the text into the correct spaces.

  • Double Spacing: Double spacing is made with the setspace package. Once the setspace package is loaded, you just have to specify the type of spacing you want at the start of your document. The command appears as such for double spacing:
    \usepackage{setspace}
    \doublespacing

    Instead of doublespacing, this same command and syntax can be used to create single spacing with the \singlespacing or to make one half spacing using the command \onehalfspacing

    You can switch from doublespacing to singlespacing by simply changing the command to \singlespacing before the spacing you want switched to singlespacing (this is very helpful when switching from the main text to the notes and indices).

    If a different spacing is required, then the \setstretch{baselinestretch} command can be used in the preamble to set the baselinestretch appropriately. The default spacing with this style option is single spacing. The syntax for this command is \setstretch{baselinestretch}

  • Horizontal space: Horizontal space is automatically flexible in LaTeX so that LaTeX can achieve justification. Horizontal space can also be controlled in the same manner as vertical space, with horizontal space being controlled by the \hspace command. The \hspace command can do things like forcing a 1 inch space in midparagraph. For the \hspace command, there are some predefined spaces available:

    • \thinspace (1/12em), which is used for fine adjustments
    • \enspace (1/2em)
    • \quad (1 em)
    • \qquad (2em)

    There are other ways to modify the spacing using the command \baselinestretch, but this command needs to be handled carefully, so please see the documentation in the ImaGe Lab for more assistance with this.

Back