# How to modify caption of a wrapped figure?

I have the following code :

    \begin{wrapfigure}{r}{0.3 \textwidth}
\includegraphics[scale=0.9]{tulipmatlab.png}
\caption{Synthesis tools}
\end{wrapfigure}


Which gives an output of :

I would like the text to fit better than how it looks now. Maybe remove justification ? How can I do this ?

-

One option would be to use justification=raggedright, from the caption package:

\documentclass{article}
\usepackage{caption}
\usepackage{wrapfig}
\usepackage{graphicx}

\begin{document}

\begin{wrapfigure}{r}{0.3 \textwidth}
\captionsetup{justification=raggedright}
\includegraphics[scale=0.9]{tulipmatlab.png}
\caption{Synthesis tools}
\end{wrapfigure}

\end{document}


To have this setting for all wrapfigure environments, instead of using \captionsetup{justification=raggedright} inside each wrapfigure environment, it's enough to add

\captionsetup[wrapfigure]{justification=raggedright}


to the preamble.

-
Perfect thank you very much ! –  Razor Apr 16 '13 at 16:18
Also, is there a way to push it a bit to the right ? Or is the caption location fixed ? –  Razor Apr 16 '13 at 16:21
@NLed you could use margin=20pt (or any other length) inside \captionsetup: \captionsetup{justification=raggedright,margin=20pt} Is something like that what you need? –  Gonzalo Medina Apr 16 '13 at 16:24
yes, perfect, thank you very much –  Razor Apr 16 '13 at 16:27
If you don't want to repeat \captionsetup{justification=raggedright} for every wrapfigure you could use \captionsetup[wrapfigure]{justification=raggedright} within your document preamble instead. (See caption doc, section "wrapfig") –  Axel Sommerfeldt Apr 16 '13 at 17:44