12

I try to put an image in columns environment inside a block environment in beamer.

Somehow my image is shifting outside the block.

Here's an example

\documentclass{beamer}
\usetheme{Darmstadt}
\begin{document}
\begin{frame}{Problem}
\begin{block}{look at that}
\begin{columns}
    \begin{column}{.4\textwidth}
    \rule{.3\textwidth}{.3\textwidth}
    \end{column}
    \begin{column}{.6\textwidth}
    Nothing of great importance
    \end{column}
\end{columns}
\end{block}
\end{frame}

\end{document}

I tried an ugly hack with a flushright environment around the image, however then the image is shifting downwards which only looks slightly better.

(How) can this be solved?

1
  • 2
    Inside column or block, \textwidth is not \linewidth! Jun 27, 2012 at 16:08

2 Answers 2

14
\documentclass{beamer}
\usetheme{Darmstadt}
\begin{document}
\begin{frame}{Problem}
\begin{block}{look at that}
\begin{columns}
    \begin{column}{.3\linewidth}
    \rule{\columnwidth}{\columnwidth}
    \end{column}
    \begin{column}{.6\linewidth}
    Nothing of great importance
    \end{column}
\end{columns}
\end{block}
\end{frame}

\end{document}
0
4

Found a solution (thank you @lumbric) without columns: The advantage of this solution is, that you can use 100 % of linewidth

\documentclass{beamer}
\usetheme{Darmstadt}
\begin{document}
\begin{frame}{Problem}
\begin{block}{look at that}
    \begin{minipage}{.4\linewidth}%
    \rule{\linewidth}{\linewidth}%
    \end{minipage}%
    \begin{minipage}{.6\linewidth}%
    Nothing of great importance%
    \end{minipage}%
\end{block}
\end{frame}

\end{document}

You must log in to answer this question.

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