
Eu uso IEEEtran com subfigura e \figref
.
\begin{figure}
\centering
\subfloat[Foo.\label{fig:test-foo}]{\includegraphics[width=0.4\textwidth]{foo}} \\
\subfloat[Bar.\label{fig:test-bar}]{\includegraphics[width=0.4\textwidth]{bar}}
\caption{Foo and Bar.}
\label{fig:test}
\end{figure}
Quando uso which is shown in \figref{fig:test-foo}.
recebo:
que é mostrado na Fig. 16a.
No entanto, eu quero ver
que é mostrado na Fig. 16 (a).
Eu tentei tudo que pude encontrar, incluindo variações de
\usepackage[subrefformat=parens,labelformat=parens]{subfig}
e
\renewcommand{\thesubfigure}{(\alph{subfigure})}
As opções da primeira não parecem ter nenhum efeito com figref
. Quando eu uso \renewcommand
, figref
funciona, mas as legendas da própria figura recebem parênteses duplos, por exemplo((a)) Foo.
Responder1
tente o seguinte:
\documentclass{IEEEtran}
\usepackage{graphicx}
\usepackage[labelformat=simple]{subfig} % <---
\renewcommand{\thesubfigure}{(\alph{subfigure})} % <---
\newcommand\figref[1]{Fig.~\ref{#1}} % <---
\begin{document}
\begin{figure}
\centering
\subfloat[Foo.\label{fig:test-foo}]{\includegraphics[width=\columnwidth]{example-image-a}} \\
\subfloat[Bar.\label{fig:test-bar}]{\includegraphics[width=\columnwidth]{example-image-b}}
\caption{Foo and Bar.}
\label{fig:test}
\end{figure}
\ldots which is shown in \figref{fig:test}, particularly in \figref{fig:test-foo}
\end{document}