1

I have to insert a figure (say Fig. 1) in my document, which already has 3 regions in it, which I would like to call as Fig. 1(a), Fig. 1(b) & Fig. 1(c). When I try to use \ref{Fig. 1} with hyperref package it generates hyperlink which shows Fig. 1 (or whatever count it generates for the given figure). Is there anyway I can modify this count number, depending on whether I want to refer to Fig. 1(a), Fig. 1(b) or Fig. 1(c)? In general I would like to add (a),(b) or (c) within hyperlink.

Thanks

1
  • 1
    The answer to your question depends very much on how the subfigures and their captions are generated. For instance, are they generated with the help of the subfig or subcaption packages? Have you created \label statements for each of the three subcaptions? (I gather you have created a \label statement with the main figure \caption.)
    – Mico
    Feb 20, 2020 at 17:05

1 Answer 1

2

If you employ the subcaption package and its subfigure environment, you can generate the desired types of cross-references by (i) placing each graphic in a separate subfigure environment, (ii) providing \caption and \label statement in each subfigure, and (iii) using \ref-type calls to the labels associated with the respective subfigures (or, as you call them, "regions").

enter image description here

\documentclass{article}
\usepackage[demo]{graphicx} % omit 'demo' option in real doc.
\usepackage[skip=0.333\baselineskip]{subcaption}
\usepackage[colorlinks,allcolors=blue]{hyperref}
\usepackage[nameinlink,capitalize]{cleveref} % for 'clever' cross-references.
\begin{document}

\begin{figure}[ht]
\centering
\begin{subfigure}{0.5\linewidth}
\includegraphics[width=\textwidth]{pic1a}
\caption{Region A} \label{fig:1a}
\end{subfigure}

\bigskip
\begin{subfigure}{0.5\linewidth}
\includegraphics[width=\textwidth]{pic1b}
\caption{Region B} \label{fig:1b}
\end{subfigure}

\bigskip
\begin{subfigure}{0.5\linewidth}
\includegraphics[width=\textwidth]{pic1c}
\caption{Region C} \label{fig:1c}
\end{subfigure}

\caption{A figure with three subfigures} \label{fig:1}
\end{figure}

A cross-reference to \cref{fig:1}. Cross-references to \cref{fig:1a,fig:1b,,fig:1c}.
\end{document}
1
  • Thanks for your reply.
    – Daffodil
    Feb 20, 2020 at 20:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .