Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

According to p. 25 of the beamer manual, the t option top-aligns either every frame (when used as a class option) or a single frame (when used as optional argument of a frame environment). According to p. 127, t can also be used to top-align the columns of a columns environment (a multi-column area within a frame). However, I didn't succeed to combine the two tasks, i.e. to top-align columns within a top-aligned frame. Did I miss something? How can the correct alignment be achieved?

Note: For columns, there's also a T option that (quoting p. 127) should be tried "[i]f strange things seem to happen in conjunction with the t option". Adding T to the second column comes close to the desired result, but doesn't achieve it (the second column is positioned somewhat higher than the first column).

\documentclass{beamer}

\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}% Alternative A doesn't work
%     \begin{column}[T]{0.5\textwidth}% Alternative B comes close
      \begin{itemize}
      \item Second column, first item
      \end{itemize}
    \end{column}
  \end{columns}
\end{frame}

\end{document}

EDIT: Thanks to Stefan for posting a workaround solution. I'm still interested in why such a workaround is necessary resp. why top-aligned columns work within centered frames by default. Is this a bug in beamer?

share|improve this question
add comment

2 Answers

up vote 7 down vote accepted

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}

enter image description here

share|improve this answer
add comment

This problem was reported (issue #78) at Bitbucket 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}
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.