[Tex/LaTex] Another way to wrap text around an image, including headings

graphicswrapwrapfigurexetex

This is a MWE of what I'm trying to accomplish:

\documentclass[letterpaper,12pt]{article}

\usepackage{blindtext}
\usepackage{graphicx,wrapfig}

\usepackage{geometry}
\geometry{margin=2cm}

\begin{document}
    \begin{wrapfigure}{r}{3.1cm}
        \centering
        \includegraphics[width=3cm]{example-image}
    \end{wrapfigure}

    \section{A section}

    \blindtext
\end{document}

Which produces the following result:

Output of given LaTeX code.

That's nice, although I wanted to use the remaining space of the section, as it'll be short enough for a small image to be used.

I used wrapfigure (wrapfig package), but as @egreg stated here, it's not possible to put a wrapfigure before headings.

Is there another way to wrap text around an image, including headings?

Thanks in advance! :)

Update.- Here's a sketch of what I mean by wrapping the image with text, including the header:

Graphical explanation of what I'm trying to do

Best Answer

Just add \vspace{-...}:

\documentclass[letterpaper,12pt]{article}

\usepackage{blindtext}
\usepackage{graphicx,wrapfig}

\usepackage{geometry}
\geometry{margin=2cm}

\begin{document}

\begin{wrapfigure}{r}{3.1cm}
  \vspace{-1.5cm}
  \centering
  \includegraphics[width=3cm]{example-image}
\end{wrapfigure}

\section{A section}

\blindtext
\end{document}

enter image description here

Related Question