サブ図と括弧を含む figref

サブ図と括弧を含む figref

私はサブフィギュアと IEEEtran を使用します\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}

使用するとwhich is shown in \figref{fig:test-foo}.次のようになります:

これを図16aに示す。

しかし、私は見たい

これを図16(a)に示す。

私は見つけられる限りのあらゆることを試しました。

\usepackage[subrefformat=parens,labelformat=parens]{subfig}

そして

\renewcommand{\thesubfigure}{(\alph{subfigure})}

最初のオプションは では効果がないようですfigref。 を使用すると は機能しますが\renewcommandfigref図自体のキャプションには二重括弧が表示されます。例:((a)) フー。

答え1

以下を試してください:

\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}

ここに画像の説明を入力してください

関連情報