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
不兼容。