34

I want to include a graphic in beamer presentation with right alignment and this graphic should be wrapping by text. I tried three packages but non of them works correct (minimal example below).

picins: the text superimposed on the graphic.

wrapfig: the graphic is inserted in principle to a new page following

floatflt: the graphic is moved to the area where the frametitle is

Another possibility to achieve this is to put the graphic into a column, but then it's not wrapping by text.

Is there anyone who knows how I can solve this?

    \documentclass[11pt,t,handout]{beamer}

    \usepackage[utf8]{inputenc}
    \usepackage[T1]{fontenc}
    \usepackage{lmodern}
    \usepackage[ngerman]{babel}
    \usepackage{graphicx}
    \usepackage{amsmath,amssymb}

    \usepackage{picins}
    \usepackage{wrapfig}
    \usepackage{floatflt}

    \author{Max Mustermann}

    \begin{document}

    \begin{frame}
    \frametitle{Folientitel}
    \piccaption{Caption}
    \parpic[r]{\includegraphics{grafik}}
    \begin{itemize}[<+->]
      \item Punkt 1 = text blah blah foo bar, text blah blah foo bar, text blah blah         foo bar
      \item Punkt 2
      \item Punkt 3
    \end{itemize}
    \end{frame}


    \begin{frame}
    \frametitle{Folientitel}
    \begin{wrapfigure}{r}{5cm}
    \includegraphics{grafik}
    \end{wrapfigure}
    \begin{itemize}[<+->]
      \item Punkt 1
      \item Punkt 2
      \item Punkt 3
    \end{itemize}
    \end{frame}


    \begin{frame}
    \frametitle{Folientitel}
    \begin{floatingfigure}[r]{5cm}
    \includegraphics{grafik}
    \end{floatingfigure}
    \begin{itemize}[<+->]
      \item Punkt 1
      \item Punkt 2
      \item Punkt 3
    \end{itemize}
    \end{frame}

    \end{document}
percusse
  • 157,807
André
  • 1,892
  • 2
    If you're still interested in an automate solution, please see my answer here: http://tex.stackexchange.com/a/56228/3954 . – Gonzalo Medina May 17 '12 at 13:00
  • 1
    @Gonzalo Medina: Thanks for the answer. The issue described here is different, because the text consists in itemize environment. And what I know now -- and it's a question to this issue in general -- in LaTeX it's impossible that text in itemize environment wrapping around something like a picture. – André May 19 '12 at 09:19

4 Answers4

23

One basic idea could be use a minipage and divide it in two columns: on the right put the image and on the left the text. This method is not perfect, but gives you at least something similar to a wrapped figure.

Here is my code with a test image:

\documentclass[11pt,t,handout]{beamer}

\usepackage{graphicx}
\usetheme{EastLansing}
\author{Max Mustermann}

\begin{document}
\begin{frame}
\frametitle{Folientitel}

\begin{minipage}[0.2\textheight]{\textwidth}
\begin{columns}[T]
\begin{column}{0.8\textwidth}
\begin{itemize}[<+->]
\item Punkt 1 = text blah blah foo bar, text blah blah foo bar, text blah blah foo bar
\item Punkt 2= text blah blah foo bar, text blah blah foo bar, text blah blah foo bar
\item Punkt 3= text blah blah foo bar, text blah blah foo bar, text blah blah foo bar
\end{itemize}
\end{column}
\begin{column}{0.2\textwidth}
\includegraphics[width=2.5cm]{logopolito}
\end{column}
\end{columns}
\end{minipage}

\begin{itemize}[<+->]
\item Punkt 1 = text blah blah foo bar, text blah blah foo bar, text blah blah foo bar
\item Punkt 2= text blah blah foo bar, text blah blah foo bar, text blah blah foo bar
\item Punkt 3= text blah blah foo bar, text blah blah foo bar, text blah blah foo bar
\end{itemize}
\end{frame}
\end{document}

which gives you as result:

enter image description here

  • 3
    Grazie! It's a possibility, but not what I'm searching for. Because it depends on how large (height) the graphic is and so it's not automatable -- and this is normally the great advantage of LaTeX. Maybe, there is another solution? – André May 02 '12 at 16:21
  • 5
    Is there a way to get the bullet points to line up properly without having to manually adjust the column width parameters or \hspace? – xvtk Oct 24 '13 at 13:54
  • I think you have to play with the column parameters, but this really depends on your real needs and consequently on how the frame should have to be built. – Claudio Fiandrino Oct 24 '13 at 13:58
14

For proper alignment of the items in the list you can set the items that require wrapping inside a \parbox of pre-specified width. This allows you to put all the items in the same list:

enter image description here

\documentclass[11pt,t]{beamer}% http://ctan.org/pkg/beamer
\let\Tiny\tiny% http://tex.stackexchange.com/q/58087/5764
%\usepackage{graphicx} Already loaded by beamer
\usetheme{EastLansing}
\author{Max Mustermann}

\newcommand{\lenitem}[2][.7\linewidth]{\parbox[t]{#1}{\strut #2\strut}}
\begin{document}
\begin{frame}
\frametitle{Folientitel}

  \mbox{}\hfill\raisebox{-\height}[0pt][0pt]{\includegraphics[width=.25\linewidth]{example-image-a}}
  \vspace*{-\baselineskip}

  \begin{itemize}[<+->]
  \item \lenitem{Punkt 1: text blah blah foo bar, text blah blah foo bar, text blah blah foo bar}
  \item \lenitem{Punkt 2: text blah blah foo bar, text blah blah foo bar, text blah blah foo bar}
  \item \lenitem{Punkt 3: text blah blah foo bar, text blah blah foo bar, text blah blah foo bar}
  \item Punkt 1: text blah blah foo bar, text blah blah foo bar, text blah blah foo bar
  \item Punkt 2: text blah blah foo bar, text blah blah foo bar, text blah blah foo bar
  \item Punkt 3: text blah blah foo bar, text blah blah foo bar, text blah blah foo bar
\end{itemize}
\end{frame}
\end{document}

Remember that these are slides that don't contain a large amount of text, so manual interference/setting is okay at times (at least in my opinion).

Werner
  • 603,163
6

If someone is looking for another way to hack around this problem, I found a method using negative space. This does not solve the wrapping problem so if the image overlaps the text, you have to manually insert newlines. But it's a quick and ugly way to insert the image where you want.

\begin{columns}[T]
 \column{0.99\textwidth}
  \begin{itemize}
   \item blah
   \item blah
   \item blah
  \end{itemize}

 \column{0.01\textwidth}
 \hspace*{-2cm}
 \includegraphics[width=2cm]{image}
\end{columns}
piotrdz
  • 61
1

Here is an option with textpos

% !Mode:: "TeX:UTF-8"
% !TEX TS-program = xelatex
\documentclass[UTF8]{beamer}
\usetheme{Warsaw}
\usepackage[absolute, overlay]{textpos}

\usefonttheme{serif}

\begin{document}

\begin{frame}
\frametitle{title}

\begin{textblock}{8}(1.0, 3.0)
\begin{itemize}
\item<1-> this is an example
\item []
\item<2-> this is an example
\item []
\item<3-> this is an example
\end{itemize}
\end{textblock}

\begin{textblock}{14}(1.0, 9.0)
\begin{itemize}
\item<4-> this is an example this is an example this is an example
\item []
\item<5-> this is an example this is an example this is an example
\item []
\item<6-> this is an example this is an example this is an example
\end{itemize}
\end{textblock}

\begin{textblock}{5}(9.0, 3.5)
\includegraphics[width=1.0 \textwidth]{example-image-golden}
\end{textblock}
\end{frame}

\end{document}

which needs some manual adjustment, here it is

wrap figure

zyy
  • 2,146