I'm trying to set up a figure, so that it contains 2 subfigures. I would prefer if I could set them up with an A and B in the left-top corner (outside of the figure). However, I would also want to be able to reference each subfigure in my text. I have searched for a lot of different solutions, but I haven't been able to put together anything that works, so I'll try with a question.
Here's my MWE:
\documentclass[a4paper,11pt]{book}
\usepackage{subcaption}
\usepackage[export]{adjustbox}
\usepackage{cleveref}
\begin{document}
\begin{figure}[tb]
\centering
\begin{subfigure}[t]{0.03\textwidth}
\textbf{A}
\end{subfigure}
\begin{subfigure}[t]{0.45\textwidth}
\includegraphics[width=\linewidth,valign=t]{"test1"}
\label{subfigure1}
\end{subfigure}\hfill
\begin{subfigure}[t]{0.03\textwidth}
\textbf{B}
\end{subfigure}
\begin{subfigure}[t]{0.45\textwidth}
\includegraphics[width=\linewidth,valign=t]{"test1"}
\label{subfigure2}
\end{subfigure}
\caption{Here's a nice caption}. \label{overall label}
\end{figure}
Me trying to reference the entire figure: Figure \ref{overall label}.
Me trying to reference the first subfigure A: Figure \cref{subfigure1}.
Me trying to reference the first subfigure B: Figure \cref{subfigure2}.
\end{document}
It looks something like this
I think I've got the part covered with the letters (even though I have to manually assign the letters). However, I can not get the subfigure reference to work.
I'm sorry if it seems messy. I'm not particularly adept with LaTeX. I hope someone will be able to help out!