如何将带括号的子图引用为图 1(a) 而不是图 1a?

如何将带括号的子图引用为图 1(a) 而不是图 1a?

我如何引用具有这种样式的子图(如图 1(a) 所示)?
如果我使用Fig.~\ref{fig_first_case},则不会得到括号。

在此处输入图片描述

\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

  1. subfig用選項加载labelformat=simple
  2. \renewcommand\thesubfigure{(\alph{subfigure})}在序言中使用。
\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}

在此处输入图片描述

只执行步骤 2 而不执行步骤 1 将会在子图标签周围打印双括号:

在此处输入图片描述

参考:https://tex.stackexchange.com/a/131366/133968

相关内容