tags:

views:

86

answers:

2

When I wrap my text around a figure I cannot get it to wrap around the correct text. Basically, I want to have the text in the section the figure is in wrap around it, but when I compile it my figure ends up being farther down the page next to text in another section. 1. How do I change this? 2. (kind of a minor point) How do I make the label for the caption, such as "Figure 1.", bold?

\usepackage{graphicx}
\usepackage{wrapfig}

...

\begin{wrapfigure}{r}{40mm}
  \begin{center}
    \includegraphics[scale=0.5]{image}
  \end{center}
  \caption{This is the image.}
\end{wrapfigure}
+3  A: 

Question #1

It may depend on the fact that the width specified as the option of \includegraphics may be greater than the width specified at the beginning of the wrapfigure environment.

It is always better to specify widths in relation to the \textwidth. Furthermore, since the wrapfig box is slightly larger than the figure box, it should always be a little larger:

\begin{wrapfigure}{r}{.3\textwidth}
  \centering
    \includegraphics[.27\textwidth]{image}
  \caption{This is the image.}
\end{wrapfigure}

Question #2

Using the caption package, you can change the layout of the labels as you prefer. If you just want them to be bold, type in your preamble:

\usepackage[labelfont=bf]{caption}
Alessandro C.
Getting the width wrong shouldn't affect the placement of the wrapfigure: wrapfigure with the r option just issues a parbox, which must be placed right away. I'm guessing that the effect would be to display the text above the image,
Charles Stewart
Looking at the package documentation, it seems that the wrapfig placement really depends on what is around the figure you want to wrap. Formulas, lists and so on may compromise the correct placement. Maybe providing the rest of the text may help in finding a solution.
Alessandro C.
+1  A: 
aioobe