Graphics, Figures & Tables ⇒ wrapfig: prevent wrapping from running to next page
wrapfig: prevent wrapping from running to next page
The environment should be placed so as to not run over a page boundary.
In such case the result would be an empty space of unpredictable length at the next page as if the figure was been continued to the next page.
The question is how to prevent that i.e. how to "stop" wrapping at some specific line.
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
wrapfig: prevent wrapping from running to next page
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
wrapfig: prevent wrapping from running to next page
I apologize
Code: Select all
\documentclass[12pt]{book}
\begin{document}
Lorem Ipsum Lorem Ipsum ...
Lorem Ipsum Lorem Ipsum ...
\begin{wrapfigure}{r}{0.8\textwidth}
\vspace{-20pt}
\begin{center}
\includegraphics[width=1\textwidth]{image}
\end{center}
\vspace{-20pt}
\caption{foobar}
\vspace{-15pt}
\end{wrapfigure}
Last paragraph of current page
First paragraph of next page, wrapping will occur here too leaving a blank page to the right.
\end{document}
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
wrapfig: prevent wrapping from running to next page
But looking at your code, there are some strange things. You try to include an external image file and specify its width to \textwidth. Why then use wrapfig? Furthermore you specify the width of the wrapfigure environment to 0.8\textwidth, which doesn't make any sense if the width of the included image occupies the full text width.
Finally the advice to replace the center environment with the \centering declaration to avoid unwanted vertical space (which you then don't have to balance with negative vertical spaces).
[1] View topic: Avoidable mistakes
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10