9

I'm doing beamer slides in the 16:9 aspect ratio, so I want to use a more horizontal flow than I was when I had 4:3 slides. For example, I'd like to place a theorem and its proof side-to-side rather than the proof below the theorem. As in:

\documentclass[aspectratio=169]{beamer}
\usepackage{tikz}
\usetheme{Rochester}
\begin{document}

\begin{frame}{There is no largest prime number}
\begin{columns}
\begin{column}[t]{0.45\textwidth}
\begin{theorem}
 There are infinitely many primes.
\end{theorem}
\end{column}
\begin{column}[t]{0.45\textwidth}
\begin{proof}
 Suppose $p$ were the largest prime number.  
 Let $q$ be the product of the first $p$ numbers.  
 Then $q+1$ is not divisible by any of them.  
 Thus it is prime, but is bigger than $p$.  
 This is a contradiction.
\end{proof}
\end{column}
\end{columns}
\end{frame}
\end{document}

Here is the result:

sample output

As you can see, the theorem box is a lot shorter than the proof box and the effect is kind of ugly. Is there a nice way to add vertical space to the shorter one to make it the same height as the longer one?

lockstep
  • 250,273
Matthew Leingang
  • 44,937
  • 14
  • 131
  • 195

2 Answers2

7

I can provide only a hack ...

\begin{theorem}
 There are infinitely many primes.\rule[-5\normalbaselineskip]{0pt}{0pt}
\end{theorem}

and the complete code to visualize the meaning of the \normalbaselineskip

\documentclass[aspectratio=169]{beamer}
\usepackage{tikz}
\usetheme{Rochester}
\begin{document}

\begin{frame}{There is no largest prime number}
\begin{columns}
\begin{column}[t]{0.45\textwidth}
\begin{theorem}
 There are infinitely many primes.%
\rule[-1\normalbaselineskip]{10pt}{1pt}\kern-10pt%
\rule[-2\normalbaselineskip]{10pt}{1pt}\kern-10pt%
\rule[-3\normalbaselineskip]{10pt}{1pt}\kern-10pt%
\rule[-4\normalbaselineskip]{10pt}{1pt}\kern-10pt%
\rule[-5\normalbaselineskip]{10pt}{1pt}    
\end{theorem}
\end{column}
\begin{column}[t]{0.45\textwidth}
\begin{proof}
 Suppose $p$ were the largest prime number.  
 Let $q$ be the product of the first $p$ numbers.  
 Then $q+1$ is not divisible by any of them.  
 Thus it is prime, but is bigger than $p$.  
 This is a contradiction.
\end{proof}
\end{column}
\end{columns}
\end{frame}
\end{document}

enter image description here

  • But thanks for the hack, at least. I hadn't thought about using \normalbaselineskip as a unit of length. That can make guessing-and-checking a quicker process. – Matthew Leingang Jan 26 '11 at 14:48
  • @Herbert Could you explain how your answer works? As I understand it, it creates a widthless, lengthless rule at a certain position, thus forcing the box to stretch to accommodate it. The rule is moved down (hence the minus sign) 5 times the \normalbaselineskip which is...? A measure of the vertical height of a line of text? Is that along the right lines? – Seamus Jan 26 '11 at 15:52
  • @Seamus: I have no idea how much it is. It is not interesting because it is one line and in the proof we have 5 additional lines. –  Jan 26 '11 at 15:59
  • 1
    @Herbert but it is a measure of the height of a line, right? That is what's important. – Seamus Jan 26 '11 at 16:01
  • @Seamus: yes, from baseline to next baseline and using the default text size. –  Jan 26 '11 at 16:03
  • @Herbert I think it would be helpful if you included this information in your answer: this site should just be about providing code snippets that produce the desired outcome, good answers should teach people stuff about TeX. – Seamus Jan 26 '11 at 16:06
  • @Herbert why not \vspace{4\normalbaselineskip}? – yannisl Jan 26 '11 at 17:22
  • @Yannis: Sorry, but why 4 when I have 5 additional lines? see edited example –  Jan 26 '11 at 18:38
  • @Herbert Using Mathews code on my computer strangely it displays the left line over two lines! MikTeX and TeXworks! – yannisl Jan 26 '11 at 18:56
  • @Yannis: ok, then you are right. I have beamer.cls 2010/06/21 development version 3.10 A class for typesetting ... –  Jan 26 '11 at 18:59
  • @Seamus: I would have liked to upvote your last comment, but I think it's missing a crucial "not". – Hendrik Vogt Jan 26 '11 at 19:48
  • 1
    @Hendrik Yes, you're right. There is a not missing. It should read "this site should not be just about providing code snippets..." – Seamus Jan 27 '11 at 11:22
0

Introducing a dummy column seems to work for me

\begin{block}{blocktitle}
\begin{columns}
% dummy column
\column{0cm}
~
\setlength{\rest}{0.25\textheight}
\vskip\rest
~
% now real column 
\column{\textwidth} 
words 123 \\
more words\\
\end{columns}
David Carlisle
  • 757,742