2

Using the code below, my figure moves out of the paper borders. As I understand, correction of figure position is best to do when writting is finished. But is it possible to forces figures - a wrapfigure in this case - to stay on paper?

How to avoid (wrap) figures moving out of sight?

Wrapfigure

Update:

Float fails to do page jump properly

\begin{wrapfigure}[17]{ht}[0]{0.525\linewidth}
\centering
    \includegraphics[width=.8\textwidth]{fig/ZeitkurveSF/ZeitkurveSF_hs.pdf}
\caption{Zeitkurve einer schnellsten Fahrt in der Ebene}
\label{fig:ZeitkurveSF}
\end{wrapfigure}%%

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[draft]{graphicx}
\usepackage{wrapfig}
\usepackage{lipsum}

\begin{document}

\lipsum[1-3]

Nam dui ligula, fringilla a, euismod sodales, sollicitudin vel, wisi. Morbi
auctor lorem non justo. Nam lacus libero, pretium at, lobortis vitae, ultricies et,
tellus. Donec aliquet, tortor sed accumsan bibendum, erat ligula aliquet magna,
vitae ornare odio metus a mi. Morbi ac orci et nisl hendrerit mollis. Suspendisse
ut massa. Cras nec ante. Pellentesque a nulla. Cum sociis natoque penatibus et
magnis dis parturient montes, nascetur ridiculus mus. Aliquam tincidunt urna.
Nulla ullamcorper vestibulum turpis. Pellentesque cursus luctus mauris

\begin{wrapfigure}{r}[0pt]{0pt}%0.525\linewidth
\centering
    \includegraphics[width=.525\textwidth]{fig/ZeitkurveSF/ZeitkurveSF_hs.pdf}
\caption{Zeitkurve einer schnellsten Fahrt in der Ebene}
\label{fig:ZeitkurveSF}
\end{wrapfigure}%%

\lipsum[1-3]

\end{document} 

enter image description here

1 Answer 1

3

Your syntax seems erroneous: it should be something like:

\begin{wrapfigure}[17]{r}[0pt]{0.525\linewidth}

The first mandatory argument can be r, l, o, i (for ‘right’, ‘left’, ‘outside’, ‘inside’) or, if you want the wrapped figure to float, R,L,O,I. Outside (inside) means on the side of the outer (inner) margin for two-sided documents.

The second optional argument specifies how much the figure can overhang in the margin.

On another hand, are the values of the widths for wrapfigure and \includegraphics compatible?

I suggest you set the width of the figure (last argument of the environment) to 0pt. Thus, the environment will calculate the exact width of the figure. I suppose the following code provides what you want:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[draft]{graphicx}
\usepackage{wrapfig}
\usepackage{lipsum}

\begin{document}

\begin{wrapfigure}{r}[0pt]{0pt}%0.525\linewidth
\centering
    \includegraphics[width=.525\textwidth]{fig/ZeitkurveSF/ZeitkurveSF_hs.pdf}
\caption{Zeitkurve einer schnellsten Fahrt in der Ebene}
\label{fig:ZeitkurveSF}
\end{wrapfigure}%%

\lipsum[1-3]

\end{document} 

enter image description here

8
  • Whats the r,l,o and i and {0pt} for?
    – embert
    Feb 26, 2015 at 10:27
  • Sorry, I thought it was clear from the context. Please see my completed answer.
    – Bernard
    Feb 26, 2015 at 10:34
  • On another hand, are the values of the widths for wrapfigure and \includegraphics compatible I'm not sure. How to test this? I tried removing the width option, but then the figure gets far to big. Applying your corrections did not help unfortunately. The figure still hangs off the paper while the spacing reserved for it spans up to the page that follows.
    – embert
    Feb 26, 2015 at 11:02
  • 1
    @embert: See my updated answer. Note the first optional argument (17 in your case) sets the number of lines that will be indented on the right side is… optional: normally, you don't have to use it, the environment calculates this number. In some specific cases only, you'll have to it, to fine-tune the placement of the image. Also, don't use the environment in a list environment.
    – Bernard
    Feb 26, 2015 at 12:42
  • 1
    Towards the end of pages, you may have problems, as around lists (there are many structures that use hidden list environments, such as theorem-like environments, quotations, &c.). Indeed, you'll have to do some corrections on finishing your document.
    – Bernard
    Feb 26, 2015 at 15:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .