Suppose that I have a figure with different panels and I want to use the command \cref
to reference each one of the panels. A way to do this is to use the packages subfig
, subfigure
, or subcaption
. However, what if the different panels in the figure are all together in a single file picture?
Is there a way to define a sublabel without define a subfloat or subfigure?
For example, consider the standard example:
\documentclass[11pt]{article}
\usepackage{subfig}
\begin{document}
\begin{figure}
\subfloat[\label{subfig-1}]{%
\includegraphics[scale=1]{example-image-1}
}
\subfloat[\label{subfig-2}]{%
\includegraphics[scale=1]{example-image-2}
}
\caption{blah blah}
\label{fig:dummy}
\end{figure}
\end{document}
Now, I dont't have example-image-1 and example-image-2 separately, but they are a single file example-image. What I am trying to do is to create a "phantom" subfloat in order to reference different parts of example-image as if they were two different and separate figures.
PS: I tried \phantomsubcaption
from the package subcaption
, as suggested here, but I have compatibility issues (I think it is revtex problem…).
IMPORTANT: Cutting the picture in two pieces is NOT an option.
A very quick and dirty solution is:
\documentclass[11pt]{article}
\usepackage{subfigure}
\begin{document}
\begin{figure}
\subfigure{\label{subfig-1}}
\subfigure{\label{subfig-2}}
\includegraphics[scale=1]{example-image}
\caption{blah blah}
\label{fig:dummy}
\end{figure}
\end{document}
However, this introduces extra spaces in the figures, since it actually defines 2 empty subfloats.
I hope that someone will have a better idea.
Best Answer
\phantomsubcaption
seems to work fine here.