0

I have the picture of a computer generated in TikZ (source), and I'm using this image in a Beamer presentation. I need to wrap text around it, and I thought about using the wrapfig package. If I use a long text (no itemize), I obtain the following: wrapping around a computer, long text but if I use itemize, the computer dissapears! wrapping around a computer, with itemize I'm totally lost as to how to solve this. I provide a MWE below. Thank you very much in advance.

EDIT: I've just realized that the computer image is printed in the next slide!

\documentclass[10pt]{beamer}
\usepackage{tikz}
\usepackage{wrapfig}
\usepackage{lipsum}
\usetikzlibrary{fit}
\tikzset{
comp/.style = {
    minimum width  = 8cm,
    minimum height = 4.5cm,
    text width     = 8cm,
    inner sep      = 0pt,
    text           = green,
    align          = center,
    font           = \Huge,
    transform shape,
    thick
},
monitor/.style = {draw = none, xscale = 18/16, yscale = 11/9},
display/.style = {shading = axis, left color = black!60, right color = black},
ut/.style      = {fill = gray}
}
\tikzset{
computer/.pic = {
    % screen (with border)
    \node(-m) [comp, pic actions, monitor]
    {\phantom{\parbox{\linewidth}{\tikzpictext}}};
    % display (without border)
    \node[comp, pic actions, display] {\tikzpictext};
    \begin{scope}[x = (-m.east), y = (-m.north)]
        % filling the lower part
        \path[pic actions, draw = none]
        ([yshift=2\pgflinewidth]-0.1,-1) -- (-0.1,-1.3) -- (-1,-1.3) --
        (-1,-2.4) -- (1,-2.4) -- (1,-1.3) -- (0.1,-1.3) --
        ([yshift=2\pgflinewidth]0.1,-1);
        % filling the border of the lower part
        \path[ut]
        (-1,-2.4) rectangle (1,-1.3)
        (-0.9,-1.4) -- (-0.7,-2.3) -- (0.7,-2.3) -- (0.9,-1.4) -- cycle;
        % drawing the frame of the whole computer
        \path[pic actions, fill = none]
        (-1,1) -- (-1,-1) -- (-0.1,-1) -- (-0.1,-1.3) -- (-1,-1.3) --
        (-1,-2.4) coordinate(sw)coordinate[pos=0.5] (-b west) --
        (1,-2.4) -- (1,-1.3) coordinate[pos=0.5] (-b east) --
        (0.1,-1.3) -- (0.1,-1) -- (1,-1) -- (1,1) -- cycle;
        % node around the whole computer
        \node(-c) [fit = (sw)(-m.north east), inner sep = 0pt] {};
    \end{scope}
}
}

\begin{document}
\begin{frame}{Title}
    \begin{wrapfigure}{l}{0pt}
        \begin{tikzpicture}
        \pic(compc) [
        draw,
        fill = green!30,
        display/.append style = {left color=green!80!black!80},
        scale = 0.5,
        pic text = {Text}
        ]
        {computer};
        \end{tikzpicture}
    \end{wrapfigure}

    \begin{itemize}
        \item \lipsum[1]
    \end{itemize}
\end{frame}
\end{document}

1 Answers1

1

If you need wrapfigure in a presentation, there is too much text on your slides.

But back to your question: I would simply place the itemize and the image in columns and resume a new itemization outside.

\documentclass[10pt]{beamer}

\begin{document} \begin{frame}{Title} \begin{columns}[b, onlytextwidth] \begin{column}{.4\textwidth} \includegraphics[width=\textwidth, height=5cm]{example-image} \end{column} \begin{column}{.58\textwidth} \begin{itemize} \item Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut, placerat ac. \item Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis. \item Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut, placerat ac felis. \end{itemize} \end{column} \end{columns} \begin{itemize} \item Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut, placerat ac. \item Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis. \end{itemize} \end{frame} \end{document}

enter image description here

Works the same way with the image on the right side:

\documentclass[10pt]{beamer}

\begin{document} \begin{frame}{Title} \begin{columns}[b, onlytextwidth] \begin{column}{.6\textwidth} \begin{itemize} \item Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut, placerat ac. \item Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis. \item Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut, placerat ac felis. \end{itemize} \end{column} \begin{column}{.4\textwidth} \includegraphics[width=\textwidth, height=5cm]{example-image} \end{column} \end{columns} \begin{itemize} \item Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut, placerat ac. \item Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis. \end{itemize} \end{frame} \end{document}

enter image description here

  • Thank you for this simple solution. After giving it some thought I do not need the wrapfig package, and yours is a healthier solution. I'll mark it as accepted. – Ignacio Correa Mar 17 '17 at 15:46
  • But this is not working if you want the image on the right side. Because the items won't be aligned... For those who need a solution, read this: https://tex.stackexchange.com/questions/53998/beamer-how-text-wrapping-around-a-graphic-right-aligned – ThibThib Mar 12 '24 at 22:04
  • @ThibThib Works fine with the image on the right side, too. – samcarter_is_at_topanswers.xyz Mar 12 '24 at 23:28