# Problems referencing subfigures in wrapfigure environment

I have just tried using wrapfigure (to wrap text around my figure, duh). Now I find that I'm unable to reference my subfigures.

Here's my MWE

\documentclass[a4paper,11pt]{book}
\usepackage{wrapfig}
\usepackage{floatrow}
\usepackage{subfig}
\renewcommand{\thesubfigure}{\Alph{subfigure}}
\usepackage{graphicx}
\graphicspath{{./Figurer/}}
\usepackage{parskip}

\begin{document}

\begin{wrapfigure}{r}{0.5\textwidth}
\vspace{-30pt}
\begin{center}
\sidesubfloat[]{\includegraphics[width=1\textwidth]{test}}\label{label1}

\sidesubfloat[]{\includegraphics[width=1\textwidth]{test}}\label{label2}
\end{center}
\vspace{-10pt}
\caption{nice caption}\label{label3}
\end{wrapfigure}

My attempt at referencing figure \ref{label1}

And also figure \ref{label2}.

I had hoped for something like "figure 1A" and "figure 1B"

But the overall figure \ref{label3} seems to work.

\end{document}


And here's a nice picture of my result to go with it.

All help is much appreciated!

The \sidesubfloat command requires the \label command within the mandatory argument, i.e. together with the content to be displayed (the \includegraphics command here).

I won't change the manual \vspace{-30pt} settings from the O.P. here...

\documentclass[a4paper,11pt]{book}
\usepackage{wrapfig}
\usepackage{floatrow}
\usepackage{subfig}
\renewcommand{\thesubfigure}{\Alph{subfigure}}
\usepackage{graphicx}
\graphicspath{{./Figurer/}}
\usepackage{parskip}

\begin{document}

\begin{wrapfigure}{r}{0.5\textwidth}
\vspace{-30pt}
\begin{center}
\sidesubfloat[]{\includegraphics[width=1\textwidth]{ente}\label{label1}}
\sidesubfloat[]{\includegraphics[width=1\textwidth]{ente}\label{label2}}
\end{center}
\vspace{-10pt}
\caption{nice caption}\label{label3}
\end{wrapfigure}

My attempt at referencing figure \ref{label1}

And also figure \ref{label2}.

I had hoped for something like "figure 1A" and "figure 1B"

But the overall figure \ref{label3} seems to work.

\end{document}