我在 Overleaf 上创建了一个项目,默认使用 TeX Live 2021。现在我完成了这个项目,想将其提交给arXiv.org它使用 TeX Live 2020。这时我发现出现了未定义的引用警告。所以我回到 Overleaf 并在项目设置中选择了 TeX Live 2020,那里出现了相同的警告(导致生成的 pdf 中出现“??”)。当改回 TeX Live 2021 时,所有这些警告都会消失。
我无法理解这种行为,尤其是因为只有所有引用中的一小部分受到影响。有些仍然有效,而其他则无效。没有共同的模式,它影响各种各样的东西,方程式、图形、表格、章节。但与此同时,对其他方程式、图形等的其他引用仍然有效。有时引用的对象在同一个文件中,有时在不同的文件中。
我尝试过的事情:
- 在 Overleaf 上,更改为 TeX Live 2020 后,我按了“从头开始重新编译”(多次)。
- 我确认我的标签中没有“奇怪”的字符(我只使用
[a-zA-Z:-]
)。
血管内皮生长因子
以下是一个最小的可重现示例。我似乎问题出在revtex
documentclass 一起\include{}
,因为当我将其更改为时问题就消失了article
。
% \documentclass{article} % this works
\documentclass{revtex4-2} % this doesn't work
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\begin{document}
% Copying the content directly here (i.e. not using \include) makes the error disappear.
\include{content}
\end{document}
其中content.tex
包含:
\section{First section}
Figure~\ref{fig:test}.
\begin{figure}
\includegraphics{example-image-a}
\caption{Test}
\label{fig:test}
\end{figure}
生成的日志为:
This is pdfTeX, Version 3.14159265-2.6-1.40.21 (TeX Live 2020) (preloaded format=pdflatex 2020.9.10) 26 OCT 2022 13:51
entering extended mode
\write18 enabled.
%&-line parsing enabled.
**main.tex
(/compile/main.tex
LaTeX2e <2020-02-02> patch level 5
L3 programming layer <2020-07-17> (/usr/local/texlive/2020/texmf-dist/tex/latex/revtex/revtex4-2.cls
Document Class: revtex4-2 2019/01/18/14:29:48 4.2c (https://journals.aps.org/revtex/ for documentation)
Copyright (c) 2019 American Physical Society.
mailto:[email protected]
Licensed under the LPPL:
http://www.ctan.org/tex-archive/macros/latex/base/lppl.txt
Arthur Ogawa <arthur_ogawa at sbcglobal dot net>
Based on work by David Carlisle <david at dcarlisle.demon.co.uk>Version (4.2c): Modified by Mark Doyle
.
ltxutil[2019/01/18/14:29:48 4.2c utilities package (portions licensed from W. E. Baxter web at superscript.com)]
LaTeX Info: Redefining \@centercr on input line 315.
Class revtex4-2 Info: Repairing broken LaTeX eqnarray on input line 365.
\eqncolsep=\skip47
Class revtex4-2 Info: Repairing hyperref-unfriendly LaTeX definition of \mpfootnote on input line 440.
Class revtex4-2 Info: Repairing broken LateX \@sect on input line 762.
\intertabularlinepenalty=\count168
\@tbpen=\count169
\@arstrutbox@hline=\box45
Class revtex4-2 Info: Repairing broken LaTeX \@xbitor on input line 1793.
Class revtex4-2 Info: Making \typeout \long on input line 2053.
ltxfront[2019/01/18/14:29:48 4.2c frontmatter package (AO,DPC,MD)]
\c@affil=\count170
\c@collab=\count171
\absbox=\box46
ltxgrid[2019/01/18/14:29:48 4.2c page grid package (portions licensed from W. E. Baxter web at superscript.com)]
\c@linecount=\count172
\output@latex=\toks15
\box@size@1=\box47
\box@size@2=\box48
\@protection@box=\box49
\@topmark@saved=\toks16
\footins@saved=\box50
\footins@recovered=\box51
\column@recovered=\box52
\pagesofar=\box53
\footsofar=\box54
\pagegrid@col=\count173
Class revtex4-2 Warning: Failed to recognize \@vspace, \@vspacer, \@no@pgbk, \@newline, and \\; no patches applied. Please get a more up-to-date class, .
\c@part=\count174
\c@section=\count175
\c@subsection=\count176
\c@subsubsection=\count177
\c@paragraph=\count178
\c@subparagraph=\count179
\abovecaptionskip=\skip48
\belowcaptionskip=\skip49
\c@figure=\count180
\fbox@1=\box55
\c@table=\count181
\fbox@2=\box56
\c@video=\count182
\fbox@4=\box57
\@bibdataout=\write3
\widetext@top=\box58
\widetext@bot=\box59
Class revtex4-2 Warning: No Society specified, using default society aps.
(/usr/local/texlive/2020/texmf-dist/tex/latex/revtex/aps4-2.rtx
File: aps4-2 2019/01/18/14:29:48 4.2c (https://journals.aps.org/revtex/ for documentation)
Class revtex4-2 Info: RevTeX society APS selected on input line 37.
)
Class revtex4-2 Warning: No journal specified, using default pra.
Class revtex4-2 Info: APS journal PRA selected on input line 7584.
Class revtex4-2 Warning: No type size specified, using default 10.
(/usr/local/texlive/2020/texmf-dist/tex/latex/revtex/aps10pt4-2.rtx
File: aps10pt4-2 2019/01/18/14:29:48 4.2c (https://journals.aps.org/revtex/ for documentation)
Class revtex4-2 Info: RevTeX pointsize 10pt selected on input line 36.
) (/usr/local/texlive/2020/texmf-dist/tex/latex/textcase/textcase.sty
Package: textcase 2019/09/14 v1.00 Text only upper/lower case changing (DPC)
) (/usr/local/texlive/2020/texmf-dist/tex/latex/url/url.sty
\Urlmuskip=\muskip16
Package: url 2013/09/16 ver 3.4 Verb mode for urls, etc.
) (/usr/local/texlive/2020/texmf-dist/tex/latex/natbib/natbib.sty
Package: natbib 2010/09/13 8.31b (PWD, AO)
\bibhang=\skip50
\bibsep=\skip51
LaTeX Info: Redefining \cite on input line 694.
\c@NAT@ctr=\count183
)
Class revtex4-2 Info: Repairing natbib's \BibitemShut on input line 7588.
(/usr/local/texlive/2020/texmf-dist/tex/latex/revtex/revsymb4-2.sty
Package: revsymb4-2 2019/01/18/14:29:48 4.2c (https://journals.aps.org/revtex/ for documentation)
LaTeX Info: Redefining \REV@mathfrak on input line 125.
)) (/usr/local/texlive/2020/texmf-dist/tex/latex/base/inputenc.sty
Package: inputenc 2018/08/11 v1.3c Input encoding file
\inpenc@prehook=\toks17
\inpenc@posthook=\toks18
) (/usr/local/texlive/2020/texmf-dist/tex/latex/graphics/graphicx.sty
Package: graphicx 2019/11/30 v1.2a Enhanced LaTeX Graphics (DPC,SPQR)
(/usr/local/texlive/2020/texmf-dist/tex/latex/graphics/keyval.sty
Package: keyval 2014/10/28 v1.15 key=value parser (DPC)
\KV@toks@=\toks19
) (/usr/local/texlive/2020/texmf-dist/tex/latex/graphics/graphics.sty
Package: graphics 2019/11/30 v1.4a Standard LaTeX Graphics (DPC,SPQR)
(/usr/local/texlive/2020/texmf-dist/tex/latex/graphics/trig.sty
Package: trig 2016/01/03 v1.10 sin cos tan (DPC)
) (/usr/local/texlive/2020/texmf-dist/tex/latex/graphics-cfg/graphics.cfg
File: graphics.cfg 2016/06/04 v1.11 sample graphics configuration
)
Package graphics Info: Driver file: pdftex.def on input line 105.
(/usr/local/texlive/2020/texmf-dist/tex/latex/graphics-def/pdftex.def
File: pdftex.def 2018/01/08 v1.0l Graphics/color driver for pdftex
))
\Gin@req@height=\dimen134
\Gin@req@width=\dimen135
)
Class revtex4-2 Info: Unrecognized LaTeX tabular. Please update this document class! (Proceeding with fingers crossed.) on input line 6.
Class revtex4-2 Info: cite was not loaded (OK!) on input line 6.
Class revtex4-2 Info: mcite was not loaded (OK!) on input line 6.
Class revtex4-2 Info: multicol was not loaded (OK!) on input line 6.
(/usr/local/texlive/2020/texmf-dist/tex/latex/l3backend/l3backend-pdfmode.def
File: l3backend-pdfmode.def 2020-06-29 L3 backend support: PDF mode
\l__kernel_color_stack_int=\count184
\l__pdf_internal_box=\box60
) (/compile/output.aux (/compile/content.aux))
\openout1 = `output.aux'.
LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 6.
LaTeX Font Info: ... okay on input line 6.
LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 6.
LaTeX Font Info: ... okay on input line 6.
LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 6.
LaTeX Font Info: ... okay on input line 6.
LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 6.
LaTeX Font Info: ... okay on input line 6.
LaTeX Font Info: Checking defaults for TS1/cmr/m/n on input line 6.
LaTeX Font Info: ... okay on input line 6.
LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 6.
LaTeX Font Info: ... okay on input line 6.
LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 6.
LaTeX Font Info: ... okay on input line 6.
(/usr/local/texlive/2020/texmf-dist/tex/context/base/mkii/supp-pdf.mkii
[Loading MPS to PDF converter (version 2006.09.02).]
\scratchcounter=\count185
\scratchdimen=\dimen136
\scratchbox=\box61
\nofMPsegments=\count186
\nofMParguments=\count187
\everyMPshowfont=\toks20
\MPscratchCnt=\count188
\MPscratchDim=\dimen137
\MPnumerator=\count189
\makeMPintoPDFobject=\count190
\everyMPtoPDFconversion=\toks21
) (/usr/local/texlive/2020/texmf-dist/tex/latex/epstopdf-pkg/epstopdf-base.sty
Package: epstopdf-base 2020-01-24 v2.11 Base part for package epstopdf
Package epstopdf-base Info: Redefining graphics rule for `.eps' on input line 485.
(/usr/local/texlive/2020/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg
File: epstopdf-sys.cfg 2010/07/13 v1.3 Configuration of (r)epstopdf for TeX Live
))
\openout3 = `outputNotes.bib'.
\openout2 = `content.aux'.
(/compile/content.tex
LaTeX Warning: Reference `fig:test' on page 1 undefined on input line 3.
<example-image-a.pdf, id=1, 321.2pt x 240.9pt>
File: example-image-a.pdf Graphic file (type pdf)
<use example-image-a.pdf>
Package pdftex.def Info: example-image-a.pdf used on input line 6.
(pdftex.def) Requested size: 321.19922pt x 240.8994pt.
) (/compile/output.bbl) [1{/usr/local/texlive/2020/texmf-var/fonts/map/pdftex/updmap/pdftex.map}
\@writefile{lof}{\contentsline {figure}{\numberline {1}{\ignorespaces Test}}{1}{}}
\newlabel{fig:test}{{1}{1}{}{}{}}
\@writefile{toc}{\contentsline {section}{\numberline {I}First section}{1}{}}
</usr/local/texlive/2020/texmf-dist/tex/latex/mwe/example-image-a.pdf>] (/compile/output.aux (/compile/content.aux))
LaTeX Warning: There were undefined references.
)
Here is how much of TeX's memory you used:
3184 strings out of 480906
43678 string characters out of 5908280
290135 words of memory out of 5000000
18790 multiletter control sequences out of 15000+600000
536003 words of font info for 32 fonts, out of 8000000 for 9000
1141 hyphenation exceptions out of 8191
36i,5n,33p,214b,264s stack positions out of 5000i,500n,10000p,200000b,80000s
</usr/local/texlive/2020/texmf-dist/fonts/type1/public/amsfonts/cm/cmbx10.pfb></usr/local/texlive/2020/texmf-dist/fonts/type1/public/amsfonts/cm/cmbx9.pfb></usr/local/texlive/2020/texmf-dist/fonts/type1/public/amsfonts/cm/cmr10.pfb></usr/local/texlive/2020/texmf-dist/fonts/type1/public/amsfonts/cm/cmr9.pfb></usr/local/texlive/2020/texmf-dist/fonts/type1/public/lm/lmss17.pfb>
Output written on /compile/output.pdf (1 page, 50713 bytes).
PDF statistics:
32 PDF objects out of 1000 (max. 8388607)
22 compressed objects within 1 object stream
0 named destinations out of 1000 (max. 500000)
6 words of extra memory for PDF output out of 10000 (max. 10000000)