List Structures
Convenient and predictable list formatting is one of the many advantages of using LaTeX. Users of WYSIWYG word processors can sometimes be frustrated by the software's attempts to determine when they intend lists to begin and end. As a mark-up language, LaTeX gives more control over the structure and content of lists.
Basic List Environments
Lists often appear in documents, especially academic, as their purpose is often to present information in a clear and concise fashion. List structures in LaTeX are simply environments which essentially come in three types:
- itemize for a bullet list
- enumerate for an enumerated list
- description for a descriptive list
All lists follow the basic format:
\begin{list_type}
\item {The first item}
\item The second item
\item The third etc \ldots
\end{list_type}
All three of these types of lists can have multiple paragraphs per item: just type the additional paragraphs in the normal way, with a blank line between each.
\documentclass{article}
\usepackage{blindtext}
\begin{document}
\begin{itemize}
\item \blindtext
\item \blindtext
\end{itemize}
\begin{enumerate}
\item \blindtext
\item \blindtext
\end{enumerate}
\begin{description}
\item [Ant] \blindtext
\item [Elephant] \blindtext
\end{description}
\end{document}
LaTeX will happily allow you to insert a list environment into an existing one (up to a depth of four, more levels are available using packages):
\begin{enumerate}
\item The first item
\begin{enumerate}
\item Nested item 1
\item Nested item 2
\end{enumerate}
\item The second item
\item The third etc \ldots
\end{enumerate}
Some Special Lists
Labeling Environment
If you are using a KOMA-script class (or package scrextend), the labeling environment is handy:
\documentclass[twocolumn]{article}
\usepackage{blindtext}
\usepackage{scrextend}
\addtokomafont{labelinglabel}{\sffamily}
\begin{document}
\blindtext
\begin{labeling}{alligator}
\item [ant] really busy all the time
\item [chimp] likes bananas
\item [alligator] very dangerous animal, sharp teeth, long
muscular tail and a bit of text that is longer than one
line and shows the alignment of text quite nicely
\end{labeling}
\end{document}
Inline Lists
If you are on tight space limitations and only have short item descriptions, you may want to have the list inline:
\documentclass[twocolumn]{article}
\usepackage{blindtext}
\usepackage[inline]{enumitem}
\usepackage{xcolor}
\begin{document}
\blindtext Coco likes fruit. Her favorites are:
\begin{enumerate*}[label={\alph*)},font={\color{red!50!black}\bfseries}]
\item bananas
\item apples
\item oranges and
\item lemons.
\end{enumerate*}
\blindtext
\end{document}
Horizontal Lists
If you want a horizontal list, package tasks can be handy:
\documentclass[12pt]{article}
\usepackage{tasks}
\usepackage{exsheets}
\SetupExSheets[question]{type=exam}
\begin{document}
\begin{question}
Which one of the entries does not fit with the others?
\begin{tasks}(4)
\task mercury
\task iron
\task lead
\task zinc
\end{tasks}
\end{question}
\end{document}
Customizing Lists
When dealing with lists containing just a few words per item, the standard lists often take up too much space. Package enumitem provides you a simple interface to customize the appearance of lists.
You can change the appearance of lists globally in the preamble, or just for single lists using the optional argument of the environment:
\documentclass[twocolumn]{article}
\usepackage{blindtext}
\usepackage{enumitem}
\begin{document}
\blindtext
\begin{itemize}
\item more work
\item more responsibility
\item more satisfaction
\end{itemize}
\blindtext
\newpage
\blindtext
\begin{itemize}[noitemsep]
\item more work
\item more responsibility
\item more satisfaction
\end{itemize}
\blindtext
\end{document}
An example for alignment and the width of the label:
\begin{description}[align=left]
\item [Kate] some detail
\item [Christina]some detail
\item [Laura]some detail
\end{description}
\begin{description}[align=right]
\item [Kate] some detail
\item [Christina]some detail
\item [Laura]some detail
\end{description}
\begin{description}[align=right,labelwidth=3cm]
\item [Kate] some detail
\item [Christina]some detail
\item [Laura]some detail
\end{description}
Easylist Package
The easylist package allows you to create list using a more convenient syntax and with infinite nested levels. Load the package with the control character as optional argument:
\usepackage[ampersand]{easylist}
The easylist environment will default to enumerations:
\begin{easylist}
& Main item~:
&& Sub item.
&& Another sub item.
\end{easylist}
It features predefined styles which you can set as optional argument:
\begin{easylist}[itemize]
% ...
\end{easylist}
Available styles:
tractatuschecklist- All items have empty check boxes next to thembooktoc- Approximately the format used by the table of contents of the book classarticletoc- Approximately the format used by the table of contents of the article classenumerate- The defaultitemize
Example of custom enumerate:
\begin{easylist}[enumerate]
\ListProperties(Style2*=,Numbers=a,Numbers1=R,FinalMark={)})
& Main item~:
&& Sub item.
&& Another sub item.
\end{easylist}