Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question
    
your columns are together 1.1\textwidth. Makes no sense here. –  Herbert Jun 27 '12 at 9:01
    
thank you! didn't notice –  Marcel Jun 27 '12 at 9:11
1  
Inside column or block, \textwidth is not \linewidth! –  Paul Gaborit Jun 27 '12 at 16:08

2 Answers 2

up vote 6 down vote accepted
\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}
share|improve this answer

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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