1

This question already has an answer here:

I wanted a frame with an example composed by a description and an image but the result is not what I want and I don't know where the problem is...

\begin{frame}[allowframebreaks]
\frametitle{Classical Definition}
\begin{example}
    \begin{columns}[t]
        \begin{column}{5cm}
            Description
        \end{column}

        \begin{column}{5cm}
            \includegraphics[width=4cm]{fig/nrpexample.png}
        \end{column}
    \end{columns}
\end{example}
\end{frame}

not wanted space marked with red arrow

Thanks for your help

marked as duplicate by LaRiFaRi, Stefan Pinnow, Seamus, Zarko, Jesse Jul 4 '16 at 13:35

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

3

Change t by T

\documentclass{beamer}
\begin{document}
\begin{frame}[allowframebreaks]
\frametitle{Classical Definition}
\begin{example}
    \begin{columns}[T]
        \begin{column}{5cm}
            Description
        \end{column}

        \begin{column}{5cm}
            \includegraphics[width=4cm]{example-image}
        \end{column}
    \end{columns}
\end{example}
\end{frame}
\end{document}

enter image description here

1

I think you want to have this:

% arara: pdflatex

\PassOptionsToPackage{demo}{graphicx}
\documentclass{beamer}

\begin{document}
\begin{frame}[allowframebreaks]
    \frametitle{Classical Definition}
    \begin{example}
        \begin{columns}
            \begin{column}[T]{5cm}
                Description
            \end{column}%       
            \begin{column}[T]{5cm}
                \includegraphics[width=4cm]{fig/nrpexample.png}
            \end{column}
        \end{columns}
    \end{example}
\end{frame}
\end{document}
  • It works, even if I had to add a vertical space at the beginning of each column. I don't understand why my code is does not work as well – Vavou Jul 4 '16 at 11:59
  • "T is similar to the t option, but T aligns the tops of the first lines while t aligns the so-called baselines of the first lines. If strange things seem to happen in conjunction with the t option (for example if a graphic suddenly “drops down” with the t option instead of “going up,”), try using this option instead." (from the manual) – LaRiFaRi Jul 4 '16 at 12:01
  • Ok, thanks for the information. I have chosen to use the T option but applied to the columns environnement, without the use of \PassOptionsToPackage command – Vavou Jul 4 '16 at 12:04
  • @Vavou Yes, that is the same in this case. The \PassOption..... is just added in order to make your code compilable. As I do not have fig/nrpexample.png, I could not compile your code. You should always try to make the MWE as simple as possible. – LaRiFaRi Jul 4 '16 at 12:07

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