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 section 3.10 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 section 12.7, 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 section 12.7) 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

3 Answers 3

up vote 9 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

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

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.

share|improve this answer

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.