beamer: Top-aligning columns within a top-aligned frame
Update
This known bug was solved some time ago. There is no need for workaround solutions or including special lines of code in preambles.
\documentclass{beamer}
\begin{document}
\begin{frame}[t]{Test Columns}
\begin{columns}
\column{.5\linewidth}
First Column
\begin{itemize}
\item First Item First Item First Item First Item
\item Second Item Second Item Second Item Second Item
\end{itemize}
\column{.5\linewidth}
Second Column
\begin{itemize}
\item First Item First Item First Item First Item
\item Second Item Second Item Second Item Second Item
\end{itemize}
\end{columns}
\end{frame}
\begin{frame}{Test Columns}
\begin{columns}
\column{.5\linewidth}
First Column
\begin{itemize}
\item First Item First Item First Item First Item
\item Second Item Second Item Second Item Second Item
\end{itemize}
\column{.5\linewidth}
Second Column
\begin{itemize}
\item First Item First Item First Item First Item
\item Second Item Second Item Second Item Second Item
\end{itemize}
\end{columns}
\end{frame}
\end{document}
works as expected
Original answer
This problem was reported (issue #78) at Github beamer development repository. The suggested solution was:
I know how to fix it, and it's quite easy, but I'm not sure if it will break something else. If you need the fix badly, replace lines 256--260 in
beamerbaseframe.sty
which read:
\def\beamer@initfirstlineunskip{%
\def\beamer@firstlineitemizeunskip{%
\vskip-\partopsep\vskip-\topsep\vskip-\parskip%
\global\let\beamer@firstlineitemizeunskip=\relax}%
\everypar{\global\let\beamer@firstlineitemizeunskip=\relax}}
with
\def\beamer@initfirstlineunskip{}%
Its state is still 'on hold'.
Instead of modifying beamer files, we can include some lines in our preamble.
\documentclass{beamer}
\makeatletter
\define@key{beamerframe}{t}[true]{% top
\beamer@frametopskip=.2cm plus .5\paperheight\relax%
\beamer@framebottomskip=0pt plus 1fill\relax%
\beamer@frametopskipautobreak=\beamer@frametopskip\relax%
\beamer@framebottomskipautobreak=\beamer@framebottomskip\relax%
\def\beamer@initfirstlineunskip{}%
}
\makeatother
\begin{document}
\begin{frame}[t]{Frame title}
\begin{columns}[t]
\begin{column}{0.5\textwidth}
\begin{itemize}
\item First column, first item
\item First column, second item
\end{itemize}
\end{column}
\begin{column}{0.5\textwidth}
\begin{itemize}
\item Second column, first item
\end{itemize}
\end{column}
\end{columns}
\end{frame}
\end{document}
You could set \topsep
and \partopsep
to zero. Here's a definition of an itemize version with this in mind, achieving vertical top alignment. It's similar to a solution I remember which Uwe Lück posted some time ago to a mailing list.
\documentclass{beamer}
\makeatletter
\newenvironment{myitemize}{%
\setlength{\topsep}{0pt}
\setlength{\partopsep}{0pt}
\renewcommand*{\@listi}{\leftmargin\leftmargini \parsep\z@ \topsep\z@ \itemsep\z@}
\let\@listI\@listi
\itemize
}{\enditemize}
\makeatother
\begin{document}
\begin{frame}[t]{Frame title}
\begin{columns}[t]
\begin{column}{0.5\textwidth}
\begin{myitemize}
\item First column, first item
\item First column, second item
\end{myitemize}
\end{column}
\begin{column}{0.5\textwidth}
\begin{myitemize}
\item Second column, first item
\end{myitemize}
\end{column}
\end{columns}
\end{frame}
\end{document}
It may be worth trying minipage
, instead of creating the custom modifications in the preamble, especially if it is going to be something that is not used a lot of times:
\documentclass{beamer}
\begin{document}
\begin{frame}[t]{Frame title}
\begin{minipage}[t]{0.45\textwidth}
\vspace{0pt}
\begin{itemize}
\item First column, first item
\item First column, second item
\end{itemize}
\end{minipage}%
\hfill
\begin{minipage}[t]{0.45\textwidth}
\vspace{0pt}
\begin{itemize}
\item Second column, first item
\end{itemize}
\end{minipage}
\end{frame}
\end{document}
where the \vspace{0pt}
is there just to give LaTeX a common reference to align the contents in both minipage
.