Chapter 04 – Creating Lists

Creating a bulleted list

\documentclass{article}
\begin{document}
\section*{Useful packages}
LaTeX provides several packages for designing the layout:
\begin{itemize}
  \item geometry
  \item typearea
  \item fancyhdr
  \item scrpage-scrlayer
  \item setspace
\end{itemize}
\end{document}

A bulleted list with two levels

\documentclass{article}
\begin{document}
\section*{Useful packages}
LaTeX provides several packages for designing the layout:
\begin{itemize}
  \item Page layout
    \begin{itemize}
      \item geometry
      \item typearea
    \end{itemize}
  \item Headers and footers
    \begin{itemize}
      \item fancyhdr
      \item scrpage-scrlayer
    \end{itemize}
  \item Line spacing
    \begin{itemize}
      \item setspace
    \end{itemize}
\end{itemize}
\end{document}

Building an enumerated list

\documentclass{article}
\begin{document}
\begin{enumerate}
  \item State the paper size by an option to the
        document class
  \item Determine the margin dimensions using one
        of these packages:
    \begin{itemize}
      \item geometry
      \item typearea
    \end{itemize}
  \item Customize header and footer by one
        of these packages:
    \begin{itemize}
      \item fancyhdr
      \item scrpage-scrlayer
    \end{itemize}
  \item Adjust the line spacing for the whole document
    \begin{itemize}
      \item by using the setspace package
      \item or by the command
            \verb|\linespread{factor}|
  \end{itemize}
\end{enumerate}
\end{document}

Producing a definition list

\documentclass{article}
\begin{document}
\begin{description}
  \item[paralist] provides compact lists and list
    versions that can be used within paragraphs,
    helps to customize labels and layout.
  \item[enumitem] gives control over labels
    and lenghts in all kind of lists.
  \item[mdwlist] is useful to customize description
    lists, it even allows multi-line labels.
    It features compact lists and the capability
    to suspend and resume.
  \item[desclist] offers more flexibility in
    definition list.
  \item[multenum] produces vertical enumeration in
    multiple columns.
\end{description}
\end{document}

Getting compact lists

\documentclass{article}
\usepackage{paralist}
\begin{document}
\begin{compactenum}
  \item State the paper size by an option to
        the document class
  \item Determine the margin dimensions using one
        of these packages:
  \begin{compactitem}
    \item geometry
    \item typearea
  \end{compactitem}
  \item Customize header and footer by one
        of these packages:
  \begin{compactitem}
    \item fancyhdr
    \item scrpage-scrlayer
  \end{compactitem}
  \item Adjust the line spacing for the whole document
  \begin{compactitem}
    \item by using the setspace package
    \item or by the command \verb|\linespread{factor}|
  \end{compactitem}
\end{compactenum}
\end{document}

A list within a paragraph

\documentclass{article}
\usepackage{paralist}
\begin{document}
\begin{compactenum}
  \item State the paper size by an option to
        the document class
  \item Determine the margin dimensions using one
        of these packages:
  \begin{compactitem}
    \item geometry
    \item typearea
  \end{compactitem}
  \item Customize header and footer by one
        of these packages:
  \begin{compactitem}
    \item fancyhdr
    \item scrpage-scrlayer
  \end{compactitem}
  \item Adjust the line spacing for the whole document
  \begin{compactitem}
    \item by using the setspace package and one
          of its options:
      \begin{inparaenum}
        \item singlespacing
        \item onehalfspacing
        \item double spacing
      \end{inparaenum} 
    \item or by the command \verb|\linespread{factor}|
  \end{compactitem}
\end{compactenum}
\end{document}

Choosing bullets and numbering format

\documentclass{article}
\usepackage{enumitem}
\setlist{nosep}
\setitemize[1]{label=---}
\setenumerate[1]{label=\textcircled{\scriptsize\Alph*},
    font=\sffamily}
\begin{document}
\begin{enumerate}
  \item State the paper size by an option to the
        document class
  \item Determine the margin dimensions using one of
        these packages:
    \begin{itemize}
    \item geometry
    \item typearea
  \end{itemize}
  \item Customize header and footer by one of these
        packages:
  \begin{itemize}
    \item fancyhdr
    \item scrpage-scrheader
  \end{itemize}
  \item Adjust the line spacing for the whole document
  \begin{itemize}
    \item by using the setspace package
    \item or by the command \verb|\linespread{factor}|
  \end{itemize}
\end{enumerate}
\end{document}

Resuming a list

\documentclass{article}
\usepackage{enumitem}
\setlist{nosep}
\setitemize[1]{label=---}
\setenumerate[1]{label=\textcircled{\scriptsize\Alph*},
    font=\sffamily}
\begin{document}
\begin{enumerate}
  \item State the paper size by an option to the
        document class
  \item Determine the margin dimensions using one of
        these packages:
    \begin{itemize}
    \item geometry
    \item typearea
  \end{itemize}
  \item Customize header and footer by one of these
        packages:
  \begin{itemize}
    \item fancyhdr
    \item scrpage-scrheader
  \end{itemize}
\end{enumerate}
\noindent\textbf{Tweaking the line spacing:}
\begin{enumerate}[resume*]
  \item Adjust the line spacing for the whole document
  \begin{itemize}
    \item by using the setspace package
    \item or by the command \verb|\linespread{factor}|
  \end{itemize}
\end{enumerate}
\end{document}
\documentclass[12pt]{article}
\usepackage{layouts}
\begin{document}
\listdiagram
\end{document}