There are two ways (and possibly more) to place content side-by-side in a beamer presentation, the columns
and the minipage
environments. The first is a beamer-specific environment and is therefore only available in a beamer
presentation. Whereas the latter has other applications and is available in all document-classes.
General considerations
In any LaTeX document, there is a predefined width available for text, \textwidth
. In order to place content side-by-side, this width has to be split in such a way that the total width of all elements does not exceed \textwidth
. Otherwise, LaTeX will automatically break the line and place elements on top of each other, which is usually not desired. The value \textwidth
can be used to define the width of a column
or minipage
. For example, 0.33\textwidth
takes a third of width of a page available for content. LaTeX also adds a small horizontal space between elements. Therefore, in order to split a page into three equal parts, 0.3\textwidth
might be a more reasonable number. If required, one can add more horizontal white-space between two elements using \quad
or \qquad
.
The columns environment
The columns environment is only available in the beamer
document-class and might therefore be lesser known.
Basic command structure:
\begin{columns} \begin{column}{0.48\textwidth} %Content \end{column} \begin{column}{0.48\textwidth} %Content \end{column} \end{columns}
And here is a complete minimal working example:
\documentclass{beamer} \begin{document} \begin{frame}{The columns environment} \begin{columns} \begin{column}{0.47\textwidth} \begin{itemize} \item First item \item Second item \item Third item \end{itemize} \end{column} \begin{column}{0.5\textwidth} \rule{\textwidth}{0.75\textwidth} \end{column} \end{columns} \end{frame} \end{document}
The minipage environment
I wrote an article on the minipage
environment quite some time ago. In beamer
, the usage is not different.
The command is used as follows:
\begin{minipage}{0.45\textwidth} %Content \end{minipage}
Below is a complete minimal working example:
\documentclass{beamer} \begin{document} \begin{frame}{The minipage environment} \begin{minipage}{0.47\textwidth} \begin{itemize} \item First item \item Second item \item Third item \end{itemize} \end{minipage} \begin{minipage}{0.5\textwidth} \rule{\textwidth}{0.75\textwidth} \end{minipage} \end{frame} \end{document}
Final note
Even though there are differences, I don’t know of any advantage of one method over the other when placing content side-by-side. However, I suggest choosing one environment and sticking to it throughout a presentation.
soumya04
Thank you for the post. Dividing the width into several parts has solved my problem of putting two images side by side in a presentation.
Arthur
I want to do this with a tikz picture on one side and an itemized list on the other. My suspicion is that the minipage approach is better for this application. Have you any experience with this use case?
tom
Both approaches should work just fine. Why do you think
minipage
is more suitable in this case?Thanks, Tom
Alvis
One reason to use minipage is this: https://tex.stackexchange.com/questions/16447/beamer-top-aligning-columns-within-a-top-aligned-frame