1

I have a wrapfigure, and as shown on the image below, the image and the caption go outside of the page and overlap the space where the page number is. Is there a way to fix it?

image overflowing the page and going near the page number

Minimal reproducible example (with lipsum text and blank image)

\documentclass[a4paper,12pt]{article}

\usepackage[T2A]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english,russian,ukrainian]{babel}
\usepackage[a4paper,top=1.3cm,bottom=2cm,left=1.5cm,right=1.5cm,marginparwidth=0.75cm]{geometry}
\usepackage[utf8]{inputenc}
\usepackage[OT1]{fontenc}
\usepackage{graphicx, wrapfig, float}
\usepackage{subfigure}
\usepackage{lipsum}

\graphicspath{ {./images/} }

\begin{document}

\lipsum[150]\lipsum[150]\lipsum[150]\lipsum[150]\lipsum[150]\lipsum[150]\lipsum[150]\lipsum[150]

\subsection{subsection}

\begin{wrapfigure}{l}{0pt}
    \centering
    \rule{8cm}{8cm} 
    \caption{image}
\end{wrapfigure}

\lipsum[150]

\end{document}
8
  • 1
    Welcome to TSE. Please post a Minimal Working Example, instead of a code snippet. Feb 1, 2023 at 20:25
  • hard to say as you provided no example but \begin{wrapfigure}{L}{0pt} with L not l allows the figure to move at a page break. Or simply move it in the source Feb 1, 2023 at 20:25
  • @JoséCarlosSantos added example Feb 1, 2023 at 20:35
  • thanks for the example, L works here (image goes to next page) Feb 1, 2023 at 20:40
  • @DavidCarlisle thanks, although, is it somehow possible to resize the image to fit the remaining space? Feb 1, 2023 at 20:41

1 Answer 1

3

It is usually best to move wrapfig by hand in the source so it ends up in a "good" position, however it does support moving at a page break to avoid this problem if you use uppercase position. So {L} here not {l}. The image goes to the next page in this example.

enter image description here

Alternatively you can adjust the size and position here just by eye, stealing as much space above and below as possible.

enter image description here

\documentclass[a4paper,12pt]{article}

\usepackage[T2A]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english,russian,ukrainian]{babel}
\usepackage[a4paper,top=1.3cm,bottom=2cm,left=1.5cm,right=1.5cm,marginparwidth=0.75cm]{geometry}
\usepackage[utf8]{inputenc}
\usepackage[OT1]{fontenc}
\usepackage{graphicx, wrapfig, float}
\usepackage{subfigure}
\usepackage{lipsum}

\graphicspath{ {./images/} }

\begin{document}

\lipsum[150]\lipsum[150]\lipsum[150]\lipsum[150]\lipsum[150]\lipsum[150]\lipsum[150]\lipsum[150]

\subsection{subsection}

\begin{wrapfigure}{l}{0pt}
    \centering
    \raisebox{-1.2cm}[3cm]{\rule{8cm}{5cm}}
    \caption{image}
\end{wrapfigure}

\lipsum[150]

\end{document}

You must log in to answer this question.

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