0

I am using \subfigures to plot multiple figures on two pages:

\begin{subfigures}
\setlength\figureheight{4cm} 
\setlength\figurewidth{5cm}
\begin{figure}[htb]
\centering
\input{Figure2a_1.tikz}
\input{Figure2a_2.tikz}
\input{Figure2a_3.tikz}
\caption{}
\label{fig2a} 
\end{figure}
\begin{figure}[htb]
\centering
\input{Figure2b_1.tikz}
\input{Figure2b_2.tikz}
\input{Figure2b_3.tikz}
\caption{}
\label{fig2b} 
\end{figure}
\label{fig2}
\end{subfigures}

So the labels of these two subfigures are 'Figure 2a' and 'Figure 2b'.

In the text, I want to refer to them alltogether as 'Figure 2' and let the reference point/link to 'Figure 2a'. Is there a way to achieve this? Is cleveref helpful on this?

Many thanks!

  • 1
    What package defines the subfigures environment? – egreg Sep 23 '14 at 8:57
  • I assume, if the environment is called subfigure(s), that there is a subfigure(s) counter. The counter output format is counted in the command \thesubfigure(s) then. It can be changed to basically anything then, by redefining \thesubfigure or \thesubfigures (Although I believe that it should read subfigure, not subfigures!) – user31729 Sep 23 '14 at 9:30
  • I used \usepackage{subfloat} in order to use subfigures. I am using subfigures not subfigure. – lawrence Sep 23 '14 at 17:04
2

[I would normally add this as a comment but don't have enough rep on LaTeX Stack to do so…]

Have you tried using minipage in combination with the subcaption package? For instance, the following might work:

\begin{figure}
  \begin{minipage}[b]{.5\linewidth}
    \centering\large A
    \subcaption{A subfigure}\label{fig:1a}
  \end{minipage}%
  \begin{minipage}[b]{.5\linewidth}
    \centering\large B
    \subcaption{Another subfigure}\label{fig:1b}
  \end{minipage}
  \caption{A figure}\label{fig:1}
\end{figure}

Or you could redefine the way the figures were referenced (still need the subcaption package) using:

\renewcommand\thesubfigure{\thefigure}

which should change the label shown in the text. I don't think this will affect the label shown in the, but to be sure, you can use the \subref command and try:

\captionsetup{subrefformat=\thefigure}

I think that will work.

| improve this answer | |
  • Sorry I tried to use the subcaption package but when compiling the file, it returns: "Package subcaption Error: This package can't be used in cooperation (subcaption) with the subfigure package." And when trying minipage some other error message pops up... – lawrence Sep 26 '14 at 4:48
  • But it's okay. I just re-wrote the main text so that I cite both Figure 2a and Figure 2b. Not a crucial issue. Thanks a lot for your help. – lawrence Sep 26 '14 at 4:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.