[Tex/LaTex] cross-referencing figures : Any way to use Fig. instead of figure

captionscross-referencingieeetran

I'm using IEEEtran.cls to produce an article. When setting captions on figures, the text begins with

Fig 1.

(for example).

However, when I reference this figure by using \ref{img:something}, this is rendered to

figure 1

Is there a way to tweak the \ref command so that it be consistent with captions?

Best Answer

You must be loading a separate package; IEEEtran does not attempt to format the number from \ref:

\documentclass{IEEEtran}
\begin{document}
\section{Intro}

See Fig.\,\ref{fig:a}

\begin{figure}[b]
\fbox{a figure}
\caption{A figure}
\label{fig:a}
\end{figure}
\end{document}

I use the refstyle package to format references; for your purposes you'd use something like:

\documentclass{IEEEtran}
\usepackage{refstyle}
    \def\RSfigtxt{Fig.\,}%
    \def\RSfigstxt{Figs~}%
    \def\RSFigtxt{Fig.\,}%
    \def\RSFigstxt{Figs~}%
\begin{document}
\section{Intro}

See \figref{fig:a}

\begin{figure}[b]
\fbox{a figure}
\caption{A figure}
\figlabel{fig:a}
\end{figure}
\end{document}

See the file refstyle.cfg for a full listing of commands that can be modified.

Related Question