1

For subfigure numbering and reference: the following styles are wanted

...

(a) Figure 1 (b) Figure 2

...

The reference should be: xxx as shown in Figure 1.a and 1.b (or 1a and 1b).

Because it looks awardard like: xxx (see Figure 1(a) and 1(b)).

How to make this happen using subfigure package?

Werner
  • 603,163
KOF
  • 5,019

1 Answers1

4

subfigure is considered obsolete.

This is the default behaviour when using the subcaption package together with a standard \ref (works with hyperref as well):

enter image description here

\documentclass{article}

\usepackage{subcaption,graphicx}

\begin{document}

See Figure~\ref{fig:figure}. 
Also, see Figures~\ref{fig:subfig-left} and~\ref{fig:subfig-right}.

\begin{figure}
  \centering
  \subcaptionbox{Left subfigure\label{fig:subfig-left}}
    {\includegraphics[width=.3\linewidth]{example-image-a}}\qquad
  \subcaptionbox{Right subfigure\label{fig:subfig-right}}
    {\includegraphics[width=.3\linewidth]{example-image-b}}
  \caption{Figure caption}
  \label{fig:figure}
\end{figure}

\end{document}
Werner
  • 603,163
  • thanks, it works like a charm. btw, how to make Figure 1 bold face but (a) ... normal? – KOF Dec 30 '17 at 06:37
  • @KOF: Add \DeclareCaptionLabelFormat{bold}{\textbf{#1~#2}} \captionsetup[figure]{labelformat = bold} to your preamble after loading the subcaption package. – Werner Dec 30 '17 at 06:45
  • Figure is bold face, but colon : is not. I need to delete it by \captionsetup{labelsep = space}. – KOF Dec 30 '17 at 06:56
  • @KOF: Okay. If you want to keep and bold, it seems to suffice to use \captionsetup[figure]{labelfont = bf}. – Werner Dec 30 '17 at 07:03
  • What I did is manually adding : --- \DeclareCaptionLabelFormat{bold}{\textbf{#1~#2:}} \captionsetup[figure]{labelformat = bold} \captionsetup{labelsep = space} – KOF Dec 30 '17 at 07:08