7

Here is a snippet of a beamer frame which is divided in three top-aligned columns.

Each column contains:

some top text

an image

some bottom text

The problem is:

because "some top text" in column #2 contains a "g" both the following image (which is the same in all 3 columns) and the "bottom text" are slightly more down-shifted. In fact the "little hook" of the "g" letter is not aligned with the very bottom of all previous capital letters.

So, is there any way to get all three images perfectly aligned across the three columns?

\documentclass{beamer}
\usepackage{graphics}
\begin{document}
\begin{frame}{What is SLURM?}
\begin{columns}[t]
  \begin{column}{0.30\textwidth}
  \begin{center}
    COLUMN NUMBER 1

    \vspace{1cm}
    \includegraphics[scale=0.4]{image.jpg}
    \bigskip

    SOME TEXT1
  \end{center}
  \end{column}
  \begin{column}{0.30\textwidth}
  \begin{center}
    COLUMN NUMBER 2g

    \vspace{1cm}
    \includegraphics[scale=0.4]{image.jpg}
    \bigskip

    SOME TEXT2
  \end{center}
  \end{column}
  \begin{column}{0.30\textwidth}
  \begin{center}
    COLUMN NUMBER 3

    \vspace{1cm}
    \includegraphics[scale=0.4]{image.jpg}
    \bigskip

    SOME TEXT3
  \end{center}
  \end{column}
\end{columns}
\end{frame}
\end{document}
2

2 Answers 2

4

One option to exactly align material in the three columns is to use overlayarea environments and specify the desired height:

\PassOptionsToPackage{demo}{graphicx}% just for the example
\documentclass{beamer}
\usepackage{graphics}

\begin{document}
\begin{frame}{What is SLURM?}
\begin{columns}[t]
\begin{column}{0.30\textwidth}
\begin{overlayarea}{\linewidth}{1cm}
  \centering
  COLUMN NUMBER 1\par
\end{overlayarea}
\begin{overlayarea}{\linewidth}{5cm}
  \centering\vfill
  \includegraphics[height=4cm,width=3cm]{image.jpg}
\end{overlayarea}
\begin{overlayarea}{\linewidth}{1cm}
  \centering
  SOME TEXT1\par
\end{overlayarea}
\end{column}
\begin{column}{0.30\textwidth}
\begin{overlayarea}{\linewidth}{1cm}
  \centering
  COLUMN NUMBER 2g\par
\end{overlayarea}
\begin{overlayarea}{\linewidth}{5cm}
  \centering\vfill
  \includegraphics[height=4cm,width=3cm]{image2.jpg}
\end{overlayarea}
\begin{overlayarea}{\linewidth}{1cm}
  \centering
  SOME TEXT2\par
\end{overlayarea}
\end{column}
\begin{column}{0.30\textwidth}
\begin{overlayarea}{\linewidth}{1cm}
  \centering
  COLUMN NUMBER 3\par
\end{overlayarea}
\begin{overlayarea}{\linewidth}{5cm}
  \centering\vfill
  \includegraphics[height=4cm,width=3cm]{image3.jpg}
\end{overlayarea}
\begin{overlayarea}{\linewidth}{1cm}
  \centering
  SOME TEXT3\par
\end{overlayarea}
\end{column}
\end{columns}
\end{frame}

\end{document}

enter image description here

The line \PassOptionsToPackage{demo}{graphicx} simply replaces actual figures with black rectangles; delete this line in your actual document.

3
  • That's exactly what I was looking for, thanks!
    – mguglielmi
    Nov 6, 2012 at 16:11
  • @Gonzalo Medina Could you explain how I can shift the columns up or down the slide? I would rather have them in the center of the slide instead of in the top. Thanks in advance!
    – Funzies
    May 13, 2014 at 20:02
  • @Funzies Please feel free to open a new question. May 13, 2014 at 21:05
2

The use of minipages is one way, but a lot of times I prefer \phantom or\vphantom, just because it is so easy to use. (And also great for overlays)

Just add a \phantom{g} to the text above the pictures. The g wont be visible, but the spacing is just as if there was one.

\vphantom does the same, just for the vertical space only.

2
  • 1
    \vphantom{g} may work better, depending on the desired final effect.
    – lhf
    Nov 2, 2012 at 1:55
  • yes, of course.
    – jens_bo
    Nov 2, 2012 at 6:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .