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.

I want to use a two-column layout in my slides and place a block in each of these columns. Whenever I do this, the two boxes have a bigger distance from the top than when using a single box without columns.

See these two slides:

Bug

When not looking closely, one might not recognize the difference but when switching slides it is clearly visible that the distance between the frame-title and the start of the boxes is bigger on the two-column version.

Why is this the case? I checked multiple themes, it occured with each of them.

I want the two-column version to have the same distance from the top as the one column version. I think the spacing above the two column version is to big. By inserting \hspace{-0.5cm} in each of the columns (before the \begin{block}) I can achieve what I want but this is very hacky in my opinion.

Minimal working example (generating the two slides):

\documentclass[18pt]{beamer}
\usetheme{Frankfurt}

\begin{document}

\begin{frame}[t]{Frame with Columns}
 \begin{columns}[t]
   \begin{column}{0.4\textwidth}
      \begin{block}{Block 1}
        Text here
      \end{block}
    \end{column}
    \begin{column}{0.4\textwidth}
      \begin{block}{Block 2}
        More text here
      \end{block}
    \end{column}
  \end{columns}
\end{frame}

\begin{frame}[t]{Frame without Columns}
  \begin{block}{Block}
    Even more text here
  \end{block}
\end{frame}

\end{document}
share|improve this question
    
I would say this can be considered as a bug. –  tohecz Sep 22 '12 at 6:54
add comment

1 Answer

It's a feature: a switch between vertical and horizontal mode.

Here is your MWE with a call to \leavevmode:

example with a call to <code>\leavevmode</code>

\documentclass[18pt]{beamer}
\usetheme{Frankfurt}

\begin{document}

\begin{frame}[t]{Frame with Columns}
 \begin{columns}[t]
   \column{0.4\textwidth}
   \begin{block}{Block 1}
     Text here
   \end{block}
   \column{0.4\textwidth}
   \begin{block}{Block 2}
     More text here
   \end{block}
 \end{columns}
\end{frame}

\begin{frame}[t]{Frame without Columns}
  \leavevmode\begin{block}{Block}
    Even more text here
  \end{block}
\end{frame}

\end{document}

As suggested by percusse, to keep a minimal top margin you can use \vspace with a negative distance (here, I choose -\baselineskip):

second version

\documentclass[12pt]{beamer}
\usetheme{Frankfurt}

\begin{document}

\begin{frame}[t]{Frame with Columns}

  \vspace{-\baselineskip}
  \begin{columns}[t]
    \column{0.4\textwidth}
    \begin{block}{Block 1}
      Text here
    \end{block}
    \column{0.4\textwidth}
    \begin{block}{Block 2}
      More text here
    \end{block}
  \end{columns}
\end{frame}

\begin{frame}[t]{Frame without Columns}
  \begin{block}{Block}
    Even more text here
  \end{block}
\end{frame}

\end{document}
share|improve this answer
    
Thanks for your comment, but now I have the big margins on both frames. Can I somehow get the narrow margins? I think the wide spacing is to big. –  theomega Sep 21 '12 at 15:16
1  
@theomega Then you can introduce a \vspace{-2.75ex} just before the columns environment to level. –  percusse Sep 21 '12 at 22:38
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.