Reader small image

You're reading from  LaTeX Beginner's Guide - Second Edition

Product typeBook
Published inOct 2021
PublisherPackt
ISBN-139781801078658
Edition2nd Edition
Tools
Right arrow
Author (1)
Stefan Kottwitz
Stefan Kottwitz
author image
Stefan Kottwitz

Stefan Kottwitz studied mathematics in Jena and Hamburg. He works as a network and IT security engineer both for Lufthansa Industry Solutions and for Eurowings Aviation. For many years, he has been providing LaTeX support on online forums. He maintains the web forums LaTeX and goLaTeX and the Q&A sites TeXwelt and TeXnique. He runs the TeX graphics gallery sites TeXample, TikZ, and PGFplots, the TeXlive online compiler, the TeXdoc service, and the CTAN software mirror. He is a moderator of the TeX Stack Exchange site and matheplanet. He publishes ideas and news from the TeX world on his blogs LaTeX and TeX. Before this book, he authored the first edition of LaTeX Beginner's Guide in 2011, and LaTeX Cookbook in 2015, both published by Packt.
Read more about Stefan Kottwitz

Right arrow

Chapter 4: Creating Lists

Arranging text in the form of a list can be very reader-friendly. You can present several key points in a clear structure that is easy to survey. Commonly, three types of lists are used:

  • Bulleted lists, to emphasize several points standing out from the text
  • Enumerated lists, to present points in an order
  • Definition lists, to explain several points in a structured way

In this chapter, we shall learn how to create such lists. We will cover the following:

  • Building lists
  • Customizing lists

First, we will learn how to create these lists, and then later in the chapter, we will see how to customize them.

Technical requirements

You need to have LaTeX on your computer, or you can use Overleaf. You can also run all examples online on the book's web page: https://latexguide.org/chapter-04.

The code is available on GitHub: https://github.com/PacktPublishing/LaTeX-Beginner-s-Guide-2nd-Edition-/tree/main/Chapter_04_-_Creating_Lists.

In this chapter, we will use the following LaTeX packages: enumitem, layouts, and paralist.

Building lists

We will start with unordered lists that are structured by bullet points. Later in this section, we will deal with ordered lists that are enumerated by numbers or characters, and then we will continue with lists of explained keywords and facts.

Creating a bulleted list

We shall start with the simplest kind of list. It contains just the items without numbers. Each item is marked by a bullet. That way, we can organize a list of key points in a much more readable way compared to a long sentence within text in a paragraph.

Let's create a list of packages that we got to know in the previous chapter. Follow these steps to build a bullet list:

  1. Create a new document with some introduction text:
    \documentclass{article}
    \begin{document}
    \section*{Useful packages}
    LaTeX provides several packages for designing the
    layout:
  2. Now write the list, using an itemize environment and \item commands:
    \begin{itemize}
      \item geometry
      \item typearea...

Customizing lists

The default appearance of lists is meaningful regarding the spacing, indentation, and symbols. Nevertheless, it may be required to use another scheme for the enumeration, for the bullets, or to modify the line spacing or their indentation. Some packages help us to save space, as well as to customize the symbols. Let's start with the spacing.

Getting compact lists

A frequently arising question is how to reduce the space in lists. LaTeX's lists are often regarded as being too spacious. We shall see how to implement that.

Let's shrink our list in this tutorial. We shall remove the whitespace around the list items and before and after the whole list as well. Follow these steps:

  1. In our enumerated list example that produced Figure 4.3, add the paralist package and replace enumerate with compactenum and itemize with compactitem:
    \documentclass{article}
    \usepackage{paralist}
    \begin{document}
    \begin{compactenum}
      \item State the paper...

Summary

In this chapter, we got to know a new way to structure our text—lists. Specifically, we learned how to create bulleted lists, numbered lists, and definition lists. Furthermore, we worked with compact and customized versions of such lists, including spacing adjustments and interrupting and resuming.

You may regard those lists as an additional possibility to structure your text. Use it to clarify your ideas.

In the next chapter, we will structure our text concerning specific alignment and work with tables.

lock icon
The rest of the chapter is locked
You have been reading a chapter from
LaTeX Beginner's Guide - Second Edition
Published in: Oct 2021Publisher: PacktISBN-13: 9781801078658
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime

Author (1)

author image
Stefan Kottwitz

Stefan Kottwitz studied mathematics in Jena and Hamburg. He works as a network and IT security engineer both for Lufthansa Industry Solutions and for Eurowings Aviation. For many years, he has been providing LaTeX support on online forums. He maintains the web forums LaTeX and goLaTeX and the Q&A sites TeXwelt and TeXnique. He runs the TeX graphics gallery sites TeXample, TikZ, and PGFplots, the TeXlive online compiler, the TeXdoc service, and the CTAN software mirror. He is a moderator of the TeX Stack Exchange site and matheplanet. He publishes ideas and news from the TeX world on his blogs LaTeX and TeX. Before this book, he authored the first edition of LaTeX Beginner's Guide in 2011, and LaTeX Cookbook in 2015, both published by Packt.
Read more about Stefan Kottwitz