Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.
   \usepackage{subcaption}
    \begin{figure}[t]
    \begin{subfigure}{1\linewidth}
    Figure1
    \caption{Hello}~\label{fig:TBS}
    \end{subfigure}
    \begin{subfigure}{1\linewidth}
    Figure2
    \caption{Hello1}
    \end{subfigure}~\label{fig:TBSCompensate}
    \caption{BigHello}
    \end{figure}

Following is the what appears: enter image description here

When I use Figure~\ref{fig:TBS} to refer the figure It appears Figure 2a in the pdf, I wish that it could appear as Figure 2(a), is the a way to tweat the formatting of caption for subfigure?

share|improve this question
    
Would a combination of single references to the figure and the sub-figure like \ref{fig:TBSCompensate}\subref{fig:TBS}be an option? –  Thorsten Donig Sep 27 '13 at 15:48
    
Your way of specifying the labels is dubious: there should be no ~ and the \label command should go immediately after the \caption command it refers to. –  egreg Sep 27 '13 at 17:23

1 Answer 1

Your case will be handled in the subcaption documentation, section "References":

But if you want detailed control on how the references will look like, the options of \DeclareCaptionSubType are potentially not sufficient. In this case one need to redefine these two macros on his/her own. Some examples: If you want parentheses around the sub-figure part of the reference, so they will look like ‘1(a)’, you may get them this way:

\usepackage[labelformat=simple]{subcaption}
\renewcommand\thesubfigure{(\alph{subfigure})}

(Note: Since parens is the default label format you will get double parentheses in sub-captions when not specifiying a different label format, e.g. simple.)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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