我试图用 [1] 引用 [2] 中的图形。图形在里面multicols
。当我编译它时,我只得到??
s ref
。我在 [3] 中得到错误。我做错了什么?
[1] 参考图片
Fig.~\ref{fig:makespan:performance:trendline:A}
Fig.~\ref{fig:makespan:performance:trendline:B}
Fig.~\ref{fig:makespan:performance:trendline:C}
[2] 图片
\begin{figure*}[t]
\centering
\begin{multicols*}{3}
\includegraphics[trim=0mm 0mm 17mm 0mm,width=.31\textwidth]{graphs/global-performance-A.pdf}\par\caption*{a) A}\label{fig:makespan:performance:trendline:A}
\includegraphics[trim=0mm 0mm 17mm 0mm,width=.31\textwidth]{graphs/global-performance-B.pdf}\par\caption*{b) B}\label{fig:makespan:performance:trendline:B}
\includegraphics[trim=0mm 0mm 17mm 0mm,width=.31\textwidth]{graphs/global-performance-C.pdf}\par\caption*{c) C}\label{fig:makespan:performance:trendline:C}
\end{multicols*}
\label{fig:makespan:performance:trendline}
\caption{Job makespan of A, B, and C executions (no faults).}
\label{fig:makespan:performance:trendline}
\end{figure*}
[3]日志文件
LaTeX Warning: Reference `fig:makespan:performance:trendline:A' on page
7 undefined on input line 509.
Package caption Warning: \label without proper \caption on input line 524.
See the caption package documentation for explanation.
Package multicol Warning: multicols* inside a box does not make sense.
(multicol) Going to balance anyway on input line 522.
答案1
从本质上来说,将三幅图像排列在单独的列中确实可以实现交叉引用。相反,我建议您将图像及其相关\caption
说明放在整体环境内的\label
单独环境中。subfigure
figure*
\documentclass[twocolumn]{article} % Use a two-column layout
\usepackage{subcaption} % for 'subcaption' environment
\usepackage[demo]{graphicx} % omit 'demo' option in real document
\begin{document}
\begin{figure*}[t!]
\begin{subfigure}{0.31\textwidth}
\includegraphics[trim=0mm 0mm 17mm 0mm,width=\linewidth]{graphs/global-performance-A.pdf}
\caption{A}
\label{fig:makespan:performance:trendline:A}
\end{subfigure}
\hspace*{\fill} % maximize whitespace between subfigures
\begin{subfigure}{0.31\textwidth}
\includegraphics[trim=0mm 0mm 17mm 0mm,width=\linewidth]{graphs/global-performance-B.pdf}
\caption{B}
\label{fig:makespan:performance:trendline:B}
\end{subfigure}
\hspace*{\fill} % maximize whitespace between subfigures
\begin{subfigure}{0.31\textwidth}
\includegraphics[trim=0mm 0mm 17mm 0mm,width=\linewidth]{graphs/global-performance-C.pdf}
\caption{C}\label{fig:makespan:performance:trendline:C}
\end{subfigure}
\caption{Job makespan of A, B, and C executions (no faults).}
\label{fig:makespan:performance:trendline}
\end{figure*}
Fig.~\ref{fig:makespan:performance:trendline:A},
Fig.~\ref{fig:makespan:performance:trendline:B},
Fig.~\ref{fig:makespan:performance:trendline:C}
\end{document}