@slide(layout=chapter-slide) @number 7 @title Enumerations @slide(layout=content-and-preview) @title Unordered lists 📜 @content ``` {.lang-tex .hljs} \begin{itemize} \item lasagna noodles \item crushed tomatoes, % … \item oregano, basil, % … \item mozzarella cheese \item flour \item milk \end{itemize} ``` We mark each bullet point with `\item`. This pattern is the same for all kinds of enumerations. @preview ![](svg/chapter-08/itemize-english-crop.svg) @slide(layout=content-and-preview) @title Ordered and definition lists @content ``` {.lang-tex .hljs} \begin{enumerate} \item cook onions over medium % … \item add crushed tomatoes, carrots % … \item add herbs and spices % … % \item … \end{enumerate} ``` ``` {.lang-tex .hljs .fragment} \begin{description} \item [Béchamel sauce] Béchamel % … \item [Lasagne] Lasagne (singular % … \end{description} ``` @preview @slide(layout=content-and-preview) @title Nested lists @content ``` {.lang-tex .hljs} \begin{itemize} % … \item vegetables \begin{itemize} \item crushed tomatoes \item carrots \end{itemize} \item herbs \begin{enumerate} \item oregano \item basil \end{enumerate} % … \end{itemize} ``` @preview ![](svg/chapter-08/nested-lists-english-crop.svg) @slide(layout=task) @task-number 7 @title Adding enumerations @content * Turn the recipe in `lists.tex` into an **unordered list** consisting of the elements *Ingredients* and *Instructions*. You can find the file in the directory `exercises/lists`. Use the `itemize` command. * Within this list, create a **unordered list** for the ingredients and a **ordered list** for the instructions. @slide(layout=extra-content-and-preview) @title Compact lists @content The package `paralist` offers enumerations with less line spacing. ``` {.lang-tex .hljs} \section{Ingredients} \begin{compactitem} % \item … \end{compactitem} \section{Preparation} \begin{compactenum} % \item … \end{compactenum} \section{Glossary} \begin{compactdesc} % \item … \end{compactdesc} ``` @preview ![](svg/chapter-08/compact-english-crop.svg) @slide(layout=extra-content-and-preview) @title In-line enumerations @content Another feature provided by `paralist` enables us to integrate enumerations into paragraphs. ``` {.lang-tex .hljs} The following herbs are % … \begin{inparaitem} \item lovage \item parsley \item chives \end{inparaitem} ``` Of course, there is an accompanying list type called `inparaenum` for ordered lists. @preview @slide(layout=extra-content-and-preview) @title List styles @content The list style type can be set using the optional parameter `label`. To accomplish this, we need to include the package `enumitem` first. ``` {.lang-tex .hljs} % Roman numerals \begin{enumerate}[label=\roman*] % … % Arabic numerals \begin{enumerate}[label=\arabic*] % … % Alphabetical \begin{enumerate}[label=\alph*] % … ``` @preview ![](svg/chapter-08/list-style-types-english-crop.svg)