0

I have a figure which is inline with text: inline figure

However, after making a new page, the formating of inline maintains (it should reset):

How can I reset the formatting there?

Here is the code:

\documentclass[11pt, a4paper]{article}


%Set packages to use
\usepackage[hidelinks]{hyperref}
\usepackage{geometry}
\usepackage{setspace}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{graphicx}
\usepackage{marvosym}
\usepackage{soul}
\usepackage{wrapfig}
\usepackage{lipsum}
\usepackage{longtable}
\usepackage[table]{xcolor}
\usepackage{fancyhdr}




%Set commands to use
\geometry{left=3cm, right=3cm}
\renewcommand{\baselinestretch}{1.3} 
\setlength{\parindent}{0em}






\begin{document}

\textbf{Dr. John Doe, President of blabla Inc.}

\begin{wrapfigure}{r}{0.45\textwidth}
    \begin{center}
        \includegraphics[width=0.38\textwidth]{shutterstock-651447943.png}
    \end{center}
\end{wrapfigure}Test text Test textTest text Test textTest textTest textTest textTest textTest textTest textTest textTest textTest textTest textTest textTest textTest textTest textTest textTest textTest textTest textTest textTest textTest textTest textTest textTest textTest text

\newpage
\section{Test section}
\lipsum[1]

\end{document}
2

In the wrapfig manual the optional parameter number of narrow lines is described, which controls the number of narrow lines. You can set this to 6 for example to cover only the lines of the section with the wrapfigure.

MWE:

\documentclass[11pt, a4paper]{article}
\usepackage{geometry}
\usepackage{setspace}
\usepackage[demo]{graphicx}
\usepackage{wrapfig}
 %Set commands to use
\geometry{left=3cm, right=3cm}
\renewcommand{\baselinestretch}{1.3} 
\setlength{\parindent}{0em}

\begin{document}

\textbf{Dr. John Doe, President of blabla Inc.}

\begin{wrapfigure}{r}{0.45\textwidth}
    \begin{center}
        \includegraphics[width=0.38\textwidth]{shutterstock-651447943.png}
    \end{center}
\end{wrapfigure}Test text Test textTest text Test textTest textTest textTest textTest textTest textTest textTest textTest textTest textTest textTest textTest textTest textTest textTest textTest textTest textTest textTest textTest textTest textTest textTest textTest textTest text

\section{Test section}
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna.

\section{With number of narrow lines}
\textbf{Dr. John Doe, President of blabla Inc.}

\begin{wrapfigure}[6]{r}{0.45\textwidth}
    \begin{center}
        \includegraphics[width=0.38\textwidth]{shutterstock-651447943.png}
    \end{center}
\end{wrapfigure}Test text Test textTest text Test textTest textTest textTest textTest textTest textTest textTest textTest textTest textTest textTest textTest textTest textTest textTest textTest textTest textTest textTest textTest textTest textTest textTest textTest textTest text

\section{Test section}
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna.

\end{document}

Result:

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.