我尝试使用\ref{img1}
和引用子浮点数,\ref{img2}
但不起作用,?
引用位置一直出现 a。如果有人能提供建议,请指教。
\begin{figure}[t]
\subfloat[]{\includegraphics[width=.49\linewidth]{img1}}\label{img1}
\subfloat[]{\includegraphics[width=.49\linewidth]{img2}}\label{img2}
\caption{The two methods a and b.}
\label{fig:KC3}
\end{figure}
答案1
将\label
s 放在用于子标题的括号内,例如
\subfloat[\label{img1}]{....
代码:
\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage{subfig}
\begin{document}
\begin{figure}[t]
\subfloat[\label{img1}]{\includegraphics[width=.49\linewidth]{img1}}
\subfloat[\label{img2}]{\includegraphics[width=.49\linewidth]{img2}}
\caption{The two methods a and b.}
\label{fig:KC3}
\end{figure}
This is \ref{img1} and \ref{img2} but its not working
\end{document}