# Align wrapfigure with section title

I have a picture inside a wrapfigure that I wish to have alongside a section.

\documentclass{article}
\usepackage[english,french]{babel}
\usepackage{graphicx}
\usepackage{wrapfig}
\usepackage{lipsum}

\begin{document}

\begin{wrapfigure}{r}{0.3\textwidth}
\includegraphics[width=\linewidth]{foo_picture.png}
\end{wrapfigure}

\section{Section title}

\lipsum[1-2]

\end{document}


Unfortunately, the picture only starts at the beginning of the paragraph, and I want its top to be at the top of the section's title:

How to achieve this? I only have found answers to have the picture alongside of the title, but not next to both the title and the paragraph.

• You can use manual vspace commands and shift it up. Be sure to reduce height (of the wrapfigure) at the same time. – TeXnician Sep 25 '17 at 12:15
• – John Kormylo Sep 25 '17 at 14:48

\setlength\intextsep{12pt}

Here, \leavevmode overwrites the default effect of \section, which does not work with wrapfigure nicely. But \leavevmode effectively creates a box with some space above the title. The wrapfigure start position is anchored at the start of the box. To counter it, \vspace{-15pt} is to move up the box position by 15pt, while \setlength\intextsep{12pt} is to move down the figure relative to the box position by 12pt. Tweak these numbers to see their effects and adjust them if necessary.