
Ich verwende IEEEtran mit Subfigure und \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}
Wenn ich verwende, which is shown in \figref{fig:test-foo}.
erhalte ich:
die in Abb. 16a dargestellt ist.
Ich möchte jedoch sehen
die in Abb. 16(a) dargestellt ist.
Ich habe alles ausprobiert, was ich finden konnte, einschließlich Variationen von
\usepackage[subrefformat=parens,labelformat=parens]{subfig}
Und
\renewcommand{\thesubfigure}{(\alph{subfigure})}
Die Optionen im ersten scheinen mit keinen Effekt zu haben figref
. Wenn ich benutze \renewcommand
, figref
funktioniert es, aber die Bildunterschriften in der Abbildung selbst erhalten doppelte Klammern, z. B.((a)) Mist.
Antwort1
Versuche Folgendes:
\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}