subfig标题编号为1a,如何修改为1(a)?

subfig标题编号为1a,如何修改为1(a)?

in Figure \ref{fig:loop}在以下文档中,源中的句子in Figure 1a在输出中产生,但我希望它是in Figure 1(a)。我该如何实现我的目标?

    \documentclass[conference]{IEEEtran}

    \usepackage[demo]{graphicx} % demo is just for this example, remove it
    \usepackage{subcaption}
    \usepackage{caption}
    \usepackage{subfig}
    \begin{document}

    \title{0000}


    \maketitle
    \begin{abstract}
    X
    \end{abstract}

    \IEEEpeerreviewmaketitle

    \section{0000}

    \begin{figure}
    \centering
    \subfloat[]{\includegraphics[width=.5\linewidth]{pic/loop.png}\label{fig:loop}} \hfill
    \subfloat[]{\includegraphics[width=.3\linewidth]{pic/twopath.png}\label{fig:twopath}}
    \caption{xx}
    \label{fig:routing}
    \end{figure}

    in Figure \ref{fig:loop}, we have xx

    \end{document}

答案1

添加

\captionsetup[subfloat]{listofformat=parens}

并使用\subref

\documentclass[conference]{IEEEtran}
\usepackage{graphicx}
\usepackage{subfig}

\captionsetup[subfloat]{listofformat=parens}

\begin{document}

\title{0000}

\maketitle
\begin{abstract}
X
\end{abstract}

\IEEEpeerreviewmaketitle

\section{0000}

\begin{figure}
    \centering
    \subfloat[]{\includegraphics[width=.5\linewidth]{example-image-a}\label{fig:loop}} \hfill
    \subfloat[]{\includegraphics[width=.3\linewidth]{example-image-b}\label{fig:twopath}}
    \caption{xx}
    \label{fig:routing}
\end{figure}

in Figure \subref{fig:loop}, we have xx

\end{document}

在此处输入图片描述

caption我不知道像现在对类那样使用该包是否是个好主意IEEEtran;无论如何,subcaption并且subfig不兼容。

相关内容