Skip to content

\captionsetup[wrapfigure]{hypcap=false} does not work as intended

\documentclass{article}
\usepackage{caption,hyperref,wrapfig,lipsum}

\captionsetup[wrapfigure]{hypcap=false}

\begin{document}

\makeatletter
\let\caption@makestart\undefined % This should never be used
\makeatother

\lipsum[1]
\begin{wrapfigure}{l}{6.5cm}
Test
\end{wrapfigure}
\lipsum[1]

\end{document}

fails to compile.

Reason: The order of execution is wrong, the hyperref anchor will be set before hypcap=false is applied.

Edited by Axel Sommerfeldt