我使用 subfloat 来包含子图,以及它们的相关标签,但标题为空。我要做的是在图形的主标题中使用 \subref 引用这些图形。但我得到的只是标题 [主标题] 中的 ?? 符号。我不知道问题出在哪里。这是我所得到的:
\begin{figure}
\centering
\subfloat[][]
{
\includegraphics[scale=0.55]{signal}
\label{signal_model}
}
\subfloat[][]
{
\includegraphics[scale=0.55]{amplitude}
\label{amplitude_mod}
}
\caption{phase noise variability: \subref{signal model} some text \subref{amplitude_mod} some other text}
\end{figure}
答案1
您需要标题中的命令\protect
:\subref
\caption{Phase noise variability: \protect\subref{signal_model} some text
\protect\subref{amplitude_mod} some other text}
梅威瑟:
\documentclass{article}
\usepackage{graphicx}
\usepackage{subfig}
\begin{document}
\begin{figure}
\centering
\subfloat[][]{\includegraphics[scale=0.55]{example-image-a}\label{signal_model}}
\subfloat[][]{\includegraphics[scale=0.55]{example-image-b}\label{amplitude_mod}}
\caption{Phase noise variability: \protect\subref{signal_model} some text
\protect\subref{amplitude_mod} some other text}
\end{figure}
\end{document}