11

I want to add a graphic plot to my slide, but if I do it with wrapfigure, I get no error massages, but the plot simply does not appear?

Code of the TeX file, which uses beamerdefs.sty, I have also added the wrapfig package:

\begin{frame}{EWMA Plot}
\begin{wrapfigure}{r}{5cm}
  \begin{center}
    \includegraphics[scale=0.4]{ewma2.jpg}
  \end{center}
  \caption{EWMA}
\end{wrapfigure}
\end{frame}

As I said, no error message, it just does not appear, if I do it without wrapfigure the graphic appears? Can anyone help?

topskip
  • 37,020

2 Answers2

11

You can use the cutwin package instead of wrapfig; a little example showing also the settings to provide a caption consistent with regular captions:

\documentclass{beamer}
\usepackage{cutwin}
\usepackage{lipsum}

\begin{document}

\begin{frame}
\renewcommand\windowpagestuff{%
  \includegraphics[height=4cm, width=3cm]{ctanlion}
  \par{\usebeamercolor[fg]{caption name}%
  \usebeamerfont*{caption name}\figurename%
  \usebeamertemplate{caption label separator}}%
  \raggedright%
  \usebeamerfont*{caption}%
  A figure with wrapping text.%
}
\opencutleft
\vfill

\begin{cutout}{0}{0pt}{.65\linewidth}{13}
\lipsum[1]
\end{cutout}
\end{frame}

\end{document}

enter image description here

CTAN lion drawing by Duane Bibby.

Gonzalo Medina
  • 505,128
  • 1
    seems nice! But text will not take into account the beamer themes upper bands, lower bands etc? Try adding \usetheme{Berkeley} to your example... any idea how to fix that? Thanks! – Matifou Dec 12 '18 at 00:30
  • When my text had new lines it caused the text to disappear off the right-hand side :( – JStrahl Jul 03 '20 at 10:22
  • This does not work with environments such as itemize and has the issue raised by @JStrahl – user3236841 Sep 07 '23 at 14:39
1

I had the same problem. It seems that the includegraphics command in the wrapfigure environment comes out blank if it is the first includegraphics of the document.

You can work around it by creating a blank image (e.g. blank.pdf) and including it before the wrapfigure environment. This works for me:

\includegraphics[width=0pt]{blank.pdf}

\begin{wrapfigure}{r}{0.5\textwidth}
\centering
\includegraphics[width=0.48\textwidth]{Figure_Clinical_Correlation.pdf}
\label{clincorr}
\end{wrapfigure}