Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Wrapping text around a figure in LaTeX

Tags:

latex

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}
like image 658
manapo Avatar asked May 17 '10 01:05

manapo


1 Answers

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[width=.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}
like image 93
Alessandro Cuttin Avatar answered Oct 22 '22 01:10

Alessandro Cuttin