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 use the wrapfigure package for placing images in my text at the right side.

Now my problem is, that my image is really small and my caption is larger then the image. Instead of a line break at the end of the line it adds the chars below each other. This looks like the following:

Error on wrapfigure package

So is it possible to add a line break after "Abbildung 4.3:" with the content of \caption?

My code looks like this:

\begin{wrapfigure}{R}{2,76cm}
\includegraphics[]{./bilder/mockup-endtimeError}
\caption{Error Start- Endzeit}
\label{mockup-endtime-error}
\end{wrapfigure}

BR & Thanks, mybecks

share|improve this question

1 Answer 1

up vote 3 down vote accepted

You can use the caption package to format the way the captions are displayed. Yo can also use the ragged2e package to set your caption as ragged right to avoid bad hyphenations.

\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage{wrapfig}
\usepackage{caption}
\usepackage{lipsum}
\usepackage{ragged2e}
\DeclareCaptionFormat{myformat}{#1#2\\#3}
\captionsetup[wrapfigure]{name=Figure, justification=RaggedRight, format=myformat}
\begin{document}
\begin{wrapfigure}{R}{2,76cm}
\rule{3cm}{5cm}
\caption{Error Start- Endzeit}
\label{mockup-endtime-error}
\end{wrapfigure}

\lipsum

\end{document}

For such small images, I would recommend you use Fig. rather than the full Figure or the equivalent in German. For more details see the caption manual Section 4.1 Further examples.

share|improve this answer
    
that works like charm. Thanks a lot. –  mybecks Jan 30 '12 at 15:21

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.