Vladar's Blog

LaTeX lists

Another element often present in tabletop game books is lists. Let's see what LaTeX offers us in this regard.

📝 NOTE: The font used for the examples is accanthis.1

Contents


Basics

There are three basic list environments in LaTeX: itemize, enumerate, and description. All three work the same and are generally pretty straightforward.

\begin{itemize}
    \item first item;
    \begin{itemize}
    	\item sub-item;
    \end{itemize}
    \item second item;
    \item third item.
\end{itemize}

list-itemize

\begin{enumerate}
    \item first item;
    \begin{enumerate}
    	\item sub-item;
    \end{enumerate}
    \item second item;
    \item third item.
\end{enumerate}

list-enumerate

\begin{description}
    \item[First] item;
    \begin{description}
    	\item[Sub] item;
    \end{description}
    \item[Second] item;
    \item[Third] item.
\end{description}

list-description


Labels

You can define custom labels (\item[label]) in all three of them, or just redefine the whole labeling system:

% redefining itemize labels
\renewcommand{\labelitemi}{$\bullet$}
\renewcommand{\labelitemii}{$\circ$}
\renewcommand{\labelitemiii}{$\diamond$}
\renewcommand{\labelitemiv}{$\cdot$}

% redefining enumerate labels
\renewcommand{\labelenumi}{\Roman{enumi}.}
\renewcommand{\labelenumii}{\roman{enumii} -}
\renewcommand{\labelenumiii}{\Alph{enumiii})}
\renewcommand{\labelenumiv}{(\alph{enumiv})}

list-labels

The default available options for enumerate labels are:

The moreenum package2 provides a bunch of additional ones.


Enumitem package

If you want an expedient way to modify and format your lists, the enumitem package3 will most probably satisfy your needs. As usual, I leave the full exploration of its vast capabilities to you, while highlighting some useful tricks below.

Nosep

To remove line separation in one specific list, you can use a [nosep] option:

\usepackage{enumitem}

...

\begin{enumerate}[nosep]
    \item first item;
    \item second item;
    \item third item.
\end{enumerate}

list-nosep

Margins

As you may have noticed, all lists are indented by default. If you want your lists to start without any margins, you have several options:

\usepackage{enumitem}
\usepackage{framed}

...

\begin{multicols}{2}
\begin{framed}

\paragraph{default}

\begin{enumerate}
    \item[1-9] first item;
    \item[10-99] second item;
    \item[100+] third item.
\end{enumerate}

\paragraph{leftmargin=*}

\begin{enumerate}[leftmargin=*]
    \item[1-9] first item;
    \item[10-99] second item;
    \item[100+] third item.
\end{enumerate}

\paragraph{leftmargin=3em}

\begin{enumerate}[leftmargin=3em]
    \item[1-9] first item;
    \item[10-99] second item;
    \item[100+] third item.
\end{enumerate}

\end{framed}
\begin{framed}

\paragraph{left=1.5em .. 3em}

\begin{enumerate}[left=1.5em .. 3em]
    \item[1-9] first item;
    \item[10-99] second item;
    \item[100+] third item.
    \end{enumerate}

\paragraph{align=left}

\begin{enumerate}[align=left]
    \item[1-9] first item;
    \item[10-99] second item;
    \item[100+] third item.
\end{enumerate}

\paragraph{align=parleft}

\begin{enumerate}[align=parleft,labelwidth=3em,leftmargin=\labelwidth+\labelsep]
    \item[1-9] first item;
    \item[10-99] second item;
    \item[100+] third item.
\end{enumerate}

\end{framed}
\end{multicols}

list-margins

Inline lists

When used with the inline option, the enumitem package provides starred versions of all three lists for the inline mode:

\usepackage[inline]{enumitem}

...

\begin{itemize*}
    \item first item;
    \item second item;
    \item third item.
\end{itemize*}

\noindent
\begin{enumerate*}
    \item first item;
    \item second item;
    \item third item.
\end{enumerate*}

\noindent
\begin{description*}
    \item[First] item;
    \item[Second] item;
    \item[Third] item.
\end{description*}

list-inline

Labels

You can redefine the current list's label format using the label option:

\begin{enumerate}[label=\underline{\Roman*}]
    \item first item;
    \begin{enumerate}[label*=\emph{(\alph*)}]
    	\item sub-item;
    \end{enumerate}
    \item second item;
    \item third item.
\end{enumerate}

list-label-option

Global settings

Using the \setlist command, you can set global options for specific types of lists and their levels:

\setlist[enumerate,<levels>]{<format>}
\setlist[itemize,<levels>]{<format>}
\setlist[description,<levels>]{<format>}
\setlist[<levels>]{<format>}

For example, the following command redefines the formatting for all three types of lists globally:

\setlist{noitemsep,topsep=0pt,parsep=0pt,partopsep=0pt}

Discuss this post on Reddit

  1. https://tug.org/FontCatalogue/accanthis/

  2. https://www.ctan.org/pkg/moreenum

  3. https://www.ctan.org/pkg/enumitem

#gamedev #guide #latex #software #ttrpg