4

I`m trying to make an itemized list, where only one of the items has an image to the right. I tried this

\documentclass{beamer}
\usetheme{Dresden}
\begin{document}
\begin{frame}{Problem}
  \begin{itemize}
     \item 
     \begin{columns}
        \column{.7\linewidth}
        Here I want some text with an image to the right, all in the same item
        \column{.3\linewidth}
        \rule{.2\linewidth}{.2\linewidth}
     \end{columns}
     \item Some more text here that is long enough to continue bellow the image
 \end{itemize}
\end{frame}
\end{document}

But this is what I get instead

columns not inside item

5

You can use columns only for first item and close it before the second item.

Next code shows the solution. I has a little problem, columns don't use the complete \linewidth, first one is .65\linewidth and second .25\linewidth in order to align first and second item symbols. I think I've read something about this problem somewhere but I don't remember where now. If I find it I'll explain the solution.

\documentclass{beamer}
\usetheme{Dresden}

\begin{document}
    \begin{frame}{Solution}
        \begin{columns}
            \column{.65\linewidth}
            \begin{itemize}
                \item Here I want some text with an image to the right, all in the same item
            \end{itemize}
            \column{.25\linewidth}
            \rule{.2\linewidth}{.2\linewidth}
        \end{columns}
        \begin{itemize}
            \item Some more text here that is long enough to continue bellow the image
        \end{itemize}
    \end{frame}
\end{document}

enter image description here

Update

The reference I was looking for is provide more usable columns environment, an issue discussion in beamer's github place.

My conclusion is: it's safer to use totalwidth option to columns environment if you want to avoid problems with intercolumns spaces and margins. And more important: don't confuse \linewidth with \textwidth as I did in previous example.

\documentclass{beamer}
\usetheme{Dresden}

\begin{document}
    \begin{frame}{Solution}
        \begin{columns}[onlytextwidth] %<---
            \column{.7\textwidth} %<---
            \begin{itemize}
                \item Here I want some text with an image to the right, all in the same item
            \end{itemize}
            \column{.3\textwidth} %<---
            \rule{.2\linewidth}{.2\linewidth}
        \end{columns}
        \begin{itemize}
            \item Some more text here that is long enough to continue bellow the image
        \end{itemize}
    \end{frame}
\end{document}
2

You can do this with minipages too:

\documentclass{beamer}
\usetheme{Dresden}
\begin{document}
\begin{frame}{Problem}
  \begin{itemize}
     \item
     \begin{minipage}[t]{0.7\linewidth}
        Here I want some text with an image to the right, all in the same item
     \end{minipage}%
     \begin{minipage}{.3\linewidth}
        \centering
        \rule{.2\linewidth}{.2\linewidth}
     \end{minipage}
     \item Some more text here that is long enough to continue bellow the image
 \end{itemize}
\end{frame}
\end{document}

enter image description here

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.