# wrapfig: titlesec stops figure from appearing

Simply importing titlesec into my document stops a figure in the wrapfigure environment from appearing:

If I comment out \usepackage{titlesec}, I get the expected result:

\documentclass{article}
\usepackage{titlesec}
\usepackage{lipsum,mwe}
\usepackage{wrapfig}
\usepackage{graphicx}

\begin{document}
\begin{wrapfigure}{r}{3.5in}
\includegraphics[scale=0.5]{example-image-a}
\end{wrapfigure}
\section{Section}
\lipsum[2]
\end{document}


Am I using wrapfigure incorrectly?

• move it behind the \section command. – Ulrike Fischer Jan 6 at 18:04
• That seems to work, thanks – Roly Jan 6 at 18:10
• @UlrikeFischer Would you consider adding an answer, and perhaps explaining the principle at stake here? – Roly Jan 7 at 12:25