These default lists and settings are great. But it’s easily possible that you need different amounts of space between items, or more horizontal distance between label and item text. Similarly, paragraphs can sometimes be too close to each other or too far apart for your liking.

There are countless commands that have a default amount of space, or default length, attached to certain properties. As expected, you can change these easily using some general syntax.

By now, you’ve probably realized that typography and markup is all about size and (white space). That’s the reality, albeit perhaps boring. It’s not about fancy colors or flashy layout: design and typography is simply about space.

Units

When specifying some kind of length, you can’t just provide a number. You need to add a unit that gives meaning to that number.

(Like when a Mathematics teacher asks “how fast is James running?” And a kid responds “10”. They will ask “10 what?” “10 apples?” “10 windows?” 😜)

These units are supported:

UnitDescriptionUnitDescription
ininchespcpica (12pt)
mmmillimetresbpbig pt (1.00375 pt)
cmcentimetresdddidôt (1.07pt)
ptpoints (1/72 inch)cccicero (12dd)
emthe width of an “M”spscaled point (0.000015 point)
exthe height of an “x”

Lengths may be negative. The number 0 needs a unit as well. (As opposed to some other languages, like CSS.)

These units can just be added directly behind the number.

Spacing

White space can be added either horizontally or vertically.

Horizontal

The \hfill command fills the rest of the current line with white space. Alternatively, the \dotfill command fills it with dots, and \hrulefill with a rule.

1Fill this line with whitespace! \hfill This is what happens.
Code left > output right
Code left > output right

The \hspace*{length} command adds length amount of white space in the current line. By default, LaTeX removes white spaces after a line break. The optional parameter * overrides this behaviour, and makes LaTeX keep inserting space over a line break.

1This is a very interesting paragraph. Now fill this line with whitespace! \hspace{10mm} And the paragraph continues.
2
3This is a very interesting paragraph. Now fill this line with whitespace! \hspace*{10mm} And the paragraph continues.
Code left > output right
Code left > output right

The commands \enskip, \quad and \qquad are shortcuts for adding half an em, one em, or two ems of horizontal white space.

Vertical

The \vfill command fills the rest of the current page with white space. The \vspace*{length} adds length amount of white space to the current page.

1Lorem ipsum... \par
2\vspace*{15mm} Lorem ipsum...
3\vfill Lorem ipsum...
Code left > output right
Code left > output right

The \addvspace{length} command also adds length amount of white space. But, if there’s already some other command adding vertical white space, it will only add that amount that is necessary to bring the total vspace to length.

This is useful, for example, if you want to distribute a fixed amount of whitespace over mulitple areas Pick some amounts for all areas, but use this command at the last one to make sure everything adds up to your fixed amount.

Lastly, the \smallskip, \medskip and \bigskip commands are shortcuts for adding small, medium and big amounts of vertical white space.

1Lorem ipsum... \par
2\smallskip Lorem ipsum... \par
3\bigskip Lorem ipsum...
Code left > output right
Code left > output right

Alternatively, the \smallbreak, \medbreak and \bigbreak commands do the same. But they automatically terminate the paragraph for you and mark good places for LaTeX to break the page.

Indentation

Indenting a paragraph means adding some horizontal space to the left of the first line only. It’s very common in print, and I think it’s the best way to typeset fiction. It’s less common in digital media.

To indent a paragraph, use \indent. To prevent indentation, use \noindent.

1A standard paragraph \par
2\noindent A paragraph that doesn't want to be indented
Code left > output right
Code left > output right

Line Spacing

Line spacing refers to the white space between two lines underneath each other.

To change this for the whole document, use \linespread{factor}. Here, a factor of 1 means regular line spacing, while 1.3 means one-and-a-half line spacing, and 1.6 double spacing. Confusing, I know.

1\linespread{1.6}
2
3\begin{document}
4    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis bibendum metus sit amet ligula dictum feugiat. In laoreet consequat accumsan. Fusce id lectus commodo, fermentum lorem at, aliquam nunc. Integer sed volutpat nunc. Quisque sem turpis, blandit ac ultricies in, tempus vitae turpis. Praesent fringilla eu massa non feugiat. Maecenas et lectus at massa rhoncus interdum eget at felis. Curabitur in convallis elit, vel maximus velit. Aliquam bibendum rhoncus leo euismod blandit. Donec cursus, ante at vehicula fringilla, dolor elit tristique lectus, vel ullamcorper eros turpis vitae augue. Morbi augue odio, aliquet quis scelerisque vel, egestas quis dolor. Mauris pellentesque tellus quis eleifend finibus. Sed auctor suscipit placerat. Suspendisse nec ex vestibulum erat laoreet pellentesque ac sed dui.
5\end{document}
Code left > output right
Code left > output right

Custom Line Spacing

Alternatively, you can use the package setspace. It provides the commands

1\doublespacing \onehalfspacing \singlespacing \setstretch{stretchFactor}

These influence everything from the moment they are used, until another command is used.

Furthermore, the following environments are available to change line spacing on (small) parts:

1doublespace onehalfspace singlespace spacing{stretchFactor}
1\usepackage{setspace}
2
3\begin{document}
4    \singlespacing Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis bibendum metus sit amet ligula dictum feugiat. 
5    
6    \doublespacing  In laoreet consequat accumsan. Fusce id lectus commodo, fermentum lorem at, aliquam nunc. Integer sed volutpat nunc. Quisque sem turpis, blandit ac ultricies in, tempus vitae turpis. Praesent fringilla eu massa non feugiat.
7\end{document}
Code left > output right
Code left > output right
Remark

You can’t change line spacing halfway a paragraph. If you don’t start a new paragraph before using this command, the whole paragraph you’re currently in will change its line spacing.

Line Breaks

We’ve already seen the \\ command to force a line break. We can use it with an optional parameter, \\[extra space], to set a custom line spacing between the current and next line.

1A regular line break is\\like this.  But a longer one is\\[10mm]like this.
Code left > output right
Code left > output right

Another way to force a line break is with the \break command. But, it doesn’t fill the rest of the line with white space, which means words will have large spaces between them to keep the text justified.

1This is a very short paragraph \break Oh noes, we didn't go to a new line properly. \hfill\break That was a proper linebreak!
Code left > output right
Code left > output right
Continue with this course
Support me and this website!

Want to support me?

Buy one of my projects. You get something nice, I get something nice.

Donate through a popular platform using the link below.

Simply giving feedback or spreading the word is also worth a lot.