In my current document, I'm working with many subfigures. Normally, I like to refer to them using a style like Figure 1 b)
where the space should be a halfspace, hence \,
in the code. That's nice not only to reference subfigure but consistent to my reference to a part of an example. I would like to use something like \ref{subfig:p1}
to get the just described output. But that way there is no space between the number and the alphanumberic letter.
Here's an MWE
\documentclass[4apaper]{scrartcl}
\usepackage{caption,subcaption,graphicx}
\captionsetup{format=hang,labelsep=space,indention=-2cm,labelfont=bf,width=.9\textwidth,skip=.5\baselineskip}
\captionsetup[sub]{labelfont=bf, labelsep=period,labelformat=simple, subrefformat=brace}
\begin{document}
\begin{figure}[t]
\begin{subfigure}[b]{.49\textwidth}\centering
% \includegraphics[width=.9\textwidth]{myPicture}
\rule{2cm}{2cm}.
\caption{SubText 1}\label{subfig:p1}
\end{subfigure}
\begin{subfigure}[b]{.49\textwidth}\centering
\rule{2cm}{2cm}.
\caption{SubText 2}\label{subfig:p2}
\end{subfigure}
\caption{Description referencing to \subref{subfig:p1} and
\subref{subfig:p2}}\label{fig:1}
\end{figure}
I usually refer to example 1\,c) somewhere else in a certain way leaving some space,
but that's not possible just using \ref{subfig:p1}; I don't want to use
\ref{fig:1}\,\subref{subfig:p1}, but that's quite longish.
\end{document}
How can I change the \ref
in \ref{subfig:p1)
to put a space between the figure
and subfigure
reference? My favourite would b something using \captionsetup
if available.