Learn how to create and customize ordered and unordered lists in beamer using itemize and enumerate environments
Contents :
There are two types of lists in LaTeX and beamer, they are broadly classified as ordered lists and unordered lists. Let us discuss how to create an ordered and unordered list in our presentation :
1. Ordered lists
Ordered lists have a numbering before every list item. To create an ordered list in beamer, we use enumerate environment. Inside this environment, the list entries can be updated using the \item
command. A simple ordered list example is presented below.
% Ordered Lists in beamer \documentclass{beamer} % Theme choice: \usetheme{Warsaw} \begin{document} \begin{frame}{Ordered Lists in Beamer} \begin{enumerate} \item Item 1 \item Item 2 \item Item 3 \end{enumerate} \end{frame} \end{document}
Compiling this code yields the following frame:
In this illustrative example, we have used Warsaw
theme and created an enumerate
environment inside a frame environment. The latter has the title “Ordered Lists in Beamer” which has been done by adding it between curly braces.
2. Unordered lists
Unordered lists have a marker, such as a bullet, before every list item. To create an unordered list in beamer, we use the itemize
environment. Inside this environment, the list entries can be updated using the \item
command.
A simple unordered list example is presented below.
% Unordered Lists in beamer \documentclass{beamer} % Theme choice: \usetheme{Warsaw} \begin{document} \begin{frame}{Unordered Lists in Beamer} \begin{itemize} \item Item 1 \item Item 2 \item Item 3 \end{itemize} \end{frame} \end{document}
Output:
3. Nested lists
Sometimes you also have to list things, which have some kind of sub-category. For this reason, LaTeX allows you to nest list environments and it will fix the indentation and numbering accordingly.
A simple nested list example is presented below.
% Nested Lists in beamer \documentclass{beamer} % Theme choice: \usetheme{Warsaw} \begin{document} \begin{frame}{Nested Lists in Beamer} \begin{enumerate} \item One \begin{itemize} \item Sub-category \item Sub-category \item Sub-category \end{itemize} \item Two \item Three \end{enumerate} \end{frame} \end{document}
Compiling this code yields:
4. Shifting the list entries to next frame
The idea is to define a counter currentenumi
that stores the value of the last enumerated item in a given frame. Then on the next frame, the enumi
counter can easily be set to the value of currentenumi
to continue numbering.
% Shifting the list entries to next frame \documentclass{beamer} % Theme choice: \usetheme{Warsaw} % Define a counter \newcounter{currentenumi} \begin{document} \begin{frame}{Lists in multiple frames}{Frame 1} \begin{enumerate} \item Item 1 \item Item 2 \item Item 3 % Store the actual item number \setcounter{currentenumi}{\theenumi} \end{enumerate} \end{frame} \begin{frame}{Lists in multiple frames}{Frame 2} \begin{enumerate} % Use the previous stored item number \setcounter{enumi}{\thecurrentenumi} \item Item 4 \item Item 5 \end{enumerate} \end{frame} \end{document}
which yields the following result:
5. Spacing between list items
The spacing between the list items can be easily altered using the \vspace
command. The other way to change the spacing globally is to use the following command \setbeamertemplate
. Here is an illustrative example:
% Add space between items \documentclass{beamer} % Theme choice: \usetheme{Warsaw} \begin{document} \begin{frame}{Add space between items} \begin{itemize} \item Item one \vspace{0.5cm} \item Item two \vspace{1cm} \item Item three \end{itemize} \end{frame} \end{document}
Output:
Here is another version of spacing between nested lists:
% Add space between items \documentclass{beamer} % Theme choice: \usetheme{Warsaw} % Item spacing \setbeamertemplate{itemize/enumerate subbody begin}{\vspace{0.5cm}} \setbeamertemplate{itemize/enumerate subbody end}{\vspace{1cm}} \begin{document} \begin{frame} \begin{itemize} \item Item one \begin{itemize} \item Sub item \end{itemize} \item Item two \end{itemize} \end{frame} \end{document}
Compiling this code yields:
6. Changing the marker appearance
There are various templates in beamer to change this itemized list appearance. The most important template is Parent Beamer-Template { itemize items}
. This template deals with the appearance of marker symbols of the itemized list. The command \setbeamertemplate{itemize items}[default]
is used on itemize items to change the shape of item markers.
The [default]
item marker is triangle. [circle]
uses little circles (or dots) , [square]
uses little squares, and [ball]
uses little balls as item markers. Please refer to this example below for better understanding.
Pifont package: You can use the optional argument of \item[]
to set the marker. With this method we can use the pifont package which provides several symbols that can be used as item markers. Check the following code:
% Change bullets style \documentclass{beamer} % Theme choice: \usetheme{Warsaw} % Custom bullets \usepackage{pifont} \begin{document} \begin{frame}{Pifont symbols for Beamer lists} \begin{itemize} \item[\ding{51}] Code 51 \item[\ding{56}] Code 56 \item[\ding{43}] Code 43 \item[\ding{118}] Code 118 \item[\ding{170}] Code 170 \end{itemize} \end{frame} \end{document}
Output:
- We used
\ding{}
as an option inside brackets of\item[]
command.\ding{51}
creates the correct symbol,\ding{56}
creates the false symbol, etc.
Here is a full list of symbols provided by pifont package and can be used in itemize environment:
Alphabet, Roman and Arabic style
Under the enumerate environment, the numbering style can be changed using the enumitem package. From the next example, you can notice that three different styles, alphabet, Roman, and Arabic are used to denote the list item numbers. Meanwhile, you can also separate the enumeration from the item content by enclosing them inside bracket/brackets or a dot.
Example:
% Enumeration styles \documentclass{beamer} % Theme choice: \usetheme{Warsaw} % Change numbers style \usepackage{enumitem} \begin{document} \begin{frame}{Enumerate} \begin{enumerate}[label={\alph*)}] \item Alphabet one \item Alphabet two \end{enumerate} \begin{enumerate}[label={\roman*.}] \item Roman number one \item Roman number two \end{enumerate} \begin{enumerate}[label={(\arabic*)}] \item Arabic number one \item Arabic number two \end{enumerate} \end{frame} \end{document}
Output:
Summary
- In this lesson, we have learned how to create lists in Beamer LaTeX.
Itemize
environment is used for creating an unordered list.Enumerate
environment is used for creating an ordered list.- We have learned how to change bullets’ style and access to more than 150 symbols provided by
pifont
package. - Alphabet, roman and arabic styles can be used thanks to the
enumitem
package.
Next Lesson: 06 Create and Customize Columns in Beamer