LaTeX by Example: Lists
LaTeX supports unordered (bulleted) and ordered (numbered) lists. This example demonstrates `itemize`, `enumerate`, and nested lists.
Code
\documentclass{article}
\begin{document}
% Unordered list (bullets)
\begin{itemize}
\item Apples
\item Bananas
\item Oranges
\end{itemize}
% Ordered list (numbers)
\begin{enumerate}
\item First step
\item Second step
\item Third step
\end{enumerate}
% Nested lists
\begin{enumerate}
\item Preparation
\begin{itemize}
\item Buy ingredients
\item Preheat oven
\end{itemize}
\item Cooking
\item Serving
\end{enumerate}
\end{document}Explanation
Lists are created using environments. The itemize environment creates an unordered list with bullet points, while the enumerate environment creates an ordered list with numbers. Each item in the list is marked with the \item command. You don't need to worry about the specific bullet character or number formatting; LaTeX handles that based on the document class and nesting level.
Lists can be nested to arbitrary depth. LaTeX automatically changes the bullet style (e.g., from dot to dash) or numbering style (e.g., from 1 to a) for nested lists to indicate hierarchy. This makes creating complex outlines or structured procedures very straightforward.
You can customize the label of a specific item by passing an optional argument to the item command, like \item[Important]. This replaces the default bullet or number with the text "Important". For global customization of list formatting, the enumitem package is highly recommended.
Code Breakdown
\begin{itemize} starts the bulleted list.\item creates a new entry. It automatically increments the counter in an enumerate environment.
