3

After using {wrapfigure} and choosing the number of lines to wrap, a new paragraph still behaves as if I told it to continue wrapping. I'm sure that sounds confusing, here is an example. How can I fix my paragraphs to go back to normal after {wrapfigure}?

\documentclass[10pt]{article}
\usepackage{wrapfig}
\usepackage{graphicx}
\usepackage{lipsum}
\begin{document}
\lipsum
\begin{wrapfigure}[18]{l}{0.5\textwidth}
    \begin{center}
        \includegraphics[width=61mm]{example-image-a}
    \end{center}
    \caption{this is my caption}

\end{wrapfigure}

\section*{Study Site}
\lipsum

\end{document}

this is how the pdf looks

2
  • Welcome to TeX.SE! Please, when posting, try to give a MWE (an example that demonstrates your problem, and has as minimum code as needed, but is compilable). See the code in your question now.
    – koleygr
    Oct 19, 2017 at 6:45
  • Welcome. Do you really want to start a starred section just after the figure? And what is there just before your figure? I found somewhere that wrapfigure has to be inside paragraphs to work as expected. So please, add some of your real text around the image. The fill will be to start the wrapfigure exactly after the last paragraph (no empty line) and possibly to inclyde this paragraph and the weapfigure in braces ({})... But we need an example without lipsum.
    – koleygr
    Oct 19, 2017 at 7:10

1 Answer 1

3

With real text before:

The next code has the same problem as your question's:

\documentclass[10pt]{article}
\usepackage{wrapfig}
\usepackage{graphicx}
\usepackage{lipsum}

\begin{document}
After using {wrapfigure} and choosing the number of lines to wrap, a new paragraph still behaves as 
if I told it to
continue wrapping. I'm sure that sounds confusing, here is an example. How can I fix my paragraphs to go 
back to normal after {wrapfigure}?

\begin{wrapfigure}[15]{l}{.5\textwidth} 
    \begin{center}
        \includegraphics[width=61mm]{example-image-a}
    \end{center}
    \caption{this is my caption}
\end{wrapfigure}



\section*{Study Site}
\lipsum

\end{document}

Output:

enter image description here

By removing the empty line before the wrapfigure, the problem is solved because our figure is inside the previous paragraph. (it will be moved to the next but it will not remain out of a paragraph that causes the specific peroblem)

Output:

enter image description here

2
  • 1
    \lipsum ends with a \par I believe, but the starred version \lipsum* doesn't. Oct 19, 2017 at 7:26
  • Thanks for the information @TorbjørnT. I did not knew there is a starred version of it.
    – koleygr
    Oct 19, 2017 at 7:32

You must log in to answer this question.

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