Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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 :

enter image description here

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

share|improve this question

1 Answer 1

up vote 3 down vote accepted

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.

share|improve this answer
    
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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.