0

How can I reference the subfigure with this style like Fig.1(a)?
If I use Fig.~\ref{fig_first_case} then I don't get the parentheses.

enter image description here

\documentclass[lettersize,journal]{IEEEtran}
\usepackage{amsmath,amsfonts}
\usepackage[caption=false,font=normalsize,labelfont=sf,textfont=sf]{subfig}
\usepackage{stfloats}
\usepackage{graphicx}

\begin{document}
How can I reference the subfigure with this style like Fig.1(a)? 


If I use Fig.~\ref{fig_first_case} then I don't get the parentheses. 

\begin{figure*}[!t]
\centering
\subfloat[]{\includegraphics[width=2.5in]{example-image-a}%
\label{fig_first_case}}
\hfil
\subfloat[]{\includegraphics[width=2.5in]{example-image-a}%
\label{fig_second_case}}
\caption{Dae. Ad quatur autat ut porepel itemoles dolor autem fuga. Bus quia con nessunti as remo di quatus non perum que nimus. (a) Case I. (b) Case II.}
\label{fig_sim}
\end{figure*}
\end{document}

1 Answer 1

2
  1. Load subfig with labelformat=simple option.
  2. Use \renewcommand\thesubfigure{(\alph{subfigure})} in the preamble.
\documentclass[lettersize,journal]{IEEEtran}
\usepackage{amsmath,amsfonts}
\usepackage[caption=false,font=normalsize,labelfont=sf,textfont=sf,labelformat=simple]{subfig}
\usepackage{stfloats}
\usepackage[demo]{graphicx}
\renewcommand\thesubfigure{(\alph{subfigure})}

\begin{document}
    How can I reference the subfigure with this style like Fig.1(a)? 
    
    
    If I use Fig.~\ref{fig_first_case} then I don't get the parentheses. 
    
    \begin{figure*}[!t]
        \centering
        \subfloat[]{\includegraphics[width=2.5in]{example-image-a}%
            \label{fig_first_case}}
        \hfil
        \subfloat[]{\includegraphics[width=2.5in]{example-image-a}%
            \label{fig_second_case}}
        \caption{Dae. Ad quatur autat ut porepel itemoles dolor autem fuga. Bus quia con nessunti as remo di quatus non perum que nimus. (a) Case I. (b) Case II.}
        \label{fig_sim}
    \end{figure*}
\end{document}

enter image description here

Only doing step 2 without step 1 will print double parentheses around subfigure labels:

enter image description here

Reference: https://tex.stackexchange.com/a/131366/133968

1
  • Very nice, thanks.
    – emnha
    Commented Aug 24, 2022 at 19:56

You must log in to answer this question.

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