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}

emnha
  • 445
  • 3
  • 11

1 Answers1

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

Zxcvasdf
  • 1,735