我有一些图表嵌入在图形中,我希望能够使用“图X“符号。我这样做是这样的(按此顺序):
\documentclass[12pt,letterpaper]{article}
...
\section*{Results}
...we performed a linear regression to obtain a standard curve
(Figure~\ref{0:stdcurve})....
\pagebreak
\section*{Results (Graphs)}
\subsection*{Construction of Standard Graph for PNP}
\begin{figure}[h] % Figure 1
\centering
\includegraphics[scale=1]{kinematics-res/graph0-1}
\caption{The standard curve for PNP.}
\label{0:stdcurve}
\end{figure}
但是,我没有得到输出“...获得标准曲线(图 1)...”,而是只得到了“...获得标准曲线(图??)……”
我还注意到 PDFLaTeX 编译器正在生成警告,指出找不到名称的引用0:stdcurve
。为什么我会收到这些警告?
答案1
您需要运行 LaTeX 两次。第一次运行会计算出参考编号。第二次运行会填写参考编号。
以下内容...standard curve (Figure {??})
在第一遍时生成,但...standard curve (Figure 1)...
在第二遍时生成:
\documentclass[12pt,letterpaper]{article}
\usepackage[demo]{graphicx}
\begin{document}
\section*{Results}
...we performed a linear regression to obtain a standard curve
(Figure~\ref{0:stdcurve})....
\pagebreak
\section*{Results (Graphs)}
\subsection*{Construction of Standard Graph for PNP}
\begin{figure}[h] % Figure 1
\centering
\includegraphics[scale=1]{kinematics-res/graph0-1}
\caption{The standard curve for PNP.}
\label{0:stdcurve}
\end{figure}
\end{document}