9

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?

  • 2
    Inside column or block, \textwidth is not \linewidth! – Paul Gaborit Jun 27 '12 at 16:08
11
\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}
| improve this answer | |
2

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}
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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