0

I used wrapfig package in my LaTeX. But it showed:

enter image description here

Of course, the picture had not been displayed in full. Below the picture is the page boundary. How can it be put here? How can I change its position? My code is

\begin{wrapfigure}{r}{0.5\linewidth}
    \centering
    \includegraphics[angle=270,width=0.5\textwidth]{three.JPG}
    \caption{two}
    \label{fig:one}
  \end{wrapfigure}
9
  • 2
    First, using {R} instead of {r} will delay wrapfig until a paragraph start where the image will fit. Second, IIRC inside wrapfig (as with a minipage) \textwidth changes to the width of the wrapfig. Apr 13, 2022 at 15:04
  • @JohnKormylo Using R can make it showed in full. May you tell me what is the IIRC? If I don't use \textwidth, the picture will be distorted to too hight.
    – Y. zeng
    Apr 13, 2022 at 15:14
  • @JohnKormylo There is too much blank before and after the picture wrapped. May you tell how to reduce the gap before and after the picture with text?
    – Y. zeng
    Apr 13, 2022 at 15:26
  • I stand corrected. A quick experiment showed that \the\textwidth was unchanged. Sorry about that. Apr 13, 2022 at 15:29
  • @JohnKormylo Thanks for your reply. You help me a lot. Thanks.
    – Y. zeng
    Apr 13, 2022 at 15:31

1 Answer 1

1

They work fine for me:

\documentclass{article}
\usepackage{graphicx, wrapfig}
\usepackage{showframe}
\usepackage{lipsum}

\begin{document}
\lipsum[2]

\begin{wrapfigure}{R}{0.5\textwidth}
\vskip-\intextsep
\includegraphics[width=\linewidth]{example-image}
\vskip-\intextsep
\end{wrapfigure}

\lipsum[1]

{\intextsep=0pt
\begin{wrapfigure}{R}{0.5\textwidth}
\includegraphics[width=\linewidth]{example-image}
\end{wrapfigure}

\lipsum[1]\par}
\end{document}
1
  • Thanks for your example. Your example shows the result I wanted. Maybe my template my classmate made and sent to me, has some limits on this function.
    – Y. zeng
    Apr 13, 2022 at 16:48

You must log in to answer this question.

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