如何引用附录中的图表

如何引用附录中的图表

在我的IEEEtran文档中,我必须\appendix在文档末尾创建一个部分并在那里放置一些图片。当我尝试使用从任何部分引用这些图片时\ref{X},我得到了??这意味着附录中的任何内容都无法被识别!我该如何解决这个问题?

谢谢。

答案1

您尚未提供最低工作示例 (MWE)。我将尝试使用以下示例代码来帮助您:

\documentclass{IEEEtran}

\usepackage{blindtext}

\title{A Heuristic Coconut-based Algorithm}
\author{\IEEEauthorblockN{Michael Shell}
\IEEEauthorblockA{School of Electrical and\\
Computer Engineering\\
Georgia Institute of Technology\\
Atlanta, Georgia 30332--0250\\
Email: [email protected]}
\and
\IEEEauthorblockN{Homer Simpson}
\IEEEauthorblockA{Twentieth Century Fox\\
Springfield, USA\\
Email: [email protected]}
\and
\IEEEauthorblockN{James Kirk\\
and Montgomery Scott}
\IEEEauthorblockA{Starfleet Academy\\
San Francisco, California 96678-2391\\
Telephone: (800) 555--1212\\
Fax: (888) 555--1212}}
\begin{document}
\maketitle

\section{One}

See figures~\ref{fig1}, \ref{appfig1}. and~\ref{appfig2}.

\blindtext
\blindtext
\blindtext
\blindtext

\begin{figure}[t!]
\centering
\caption{Caption text.}\label{fig1}
\end{figure}

%\appendix % for single appendix
\appendices  % for more than one appendix section

% By default figure number is continuous on appendix. You can 
% change this by the following two lines
\setcounter{figure}{0}
\renewcommand\thefigure{\Alph{section}.\arabic{figure}}

\section{One}

\subsection{One}

\blindtext
\blindtext

\subsection{Two}
\blindtext
\blindtext

\begin{figure}[t!]
\centering
\caption{Caption text.}\label{appfig1}
\end{figure}

\section{Two}

\subsection{One}

\blindtext
\blindtext

\subsection{Two}
\blindtext
\blindtext

\begin{figure}[t!]
\centering
\caption{Caption text.}\label{appfig2}
\end{figure}

\end{document}

相关内容