正如标题所述,LaTeX 表格 /caption 和 /label 不起作用,完整表格在不同的模板中起作用,无法找出原因。我已经尝试了好几天,让其他人看过它,但似乎无法弄清楚。我使用的是 SpringerNature 模板和 \documentclass[sn-apa]{sn-jnl}
重现错误的完整示例:
\documentclass[sn-mathphys,Numbered]{sn-jnl}% Math and Physical Sciences Reference Style
\usepackage{graphicx}%
\usepackage{multirow}%
\usepackage{amsmath,amssymb,amsfonts}%
\usepackage{amsthm}%
\usepackage{mathrsfs}%
\usepackage[title]{appendix}%
\usepackage{xcolor}%
\usepackage{textcomp}%
\usepackage{manyfoot}%
\usepackage{booktabs}%
\usepackage{algorithm}%
\usepackage{algorithmicx}%
\usepackage{algpseudocode}%
\usepackage{listings}%
\usepackage{lipsum}
\usepackage{tabularray}
\theoremstyle{thmstyletwo}%
\newtheorem{example}{Example}%
\newtheorem{remark}{Remark}%
\theoremstyle{thmstylethree}%
\newtheorem{definition}{Definition}%
\raggedbottom
\begin{document}
\title[Article Title]{Article Title}
\maketitle
I want to reference \ref{tab:1}
\begin{table}[h]
\caption{\lipsum[1]}
\label{tab:1}
\centering
\begin{tblr}{
width = \linewidth,
colspec = {Q[180]Q[660]},
cell{1}{1} = {c=2}{0.94\linewidth},
cell{2}{1} = {t},
cell{3}{1} = {t},
hline{1,6} = {-}{0.08em},
hline{2} = {-}{},
}
\textbf{Lorem ipsum} & \\
Lorem ipsum & Lorem ipsum \\
Lorem ipsum & Lorem ipsum \\
Lorem ipsum & Lorem ipsum \\
Lorem ipsumn & Lorem ipsum
\end{tblr}
\end{table}
\end{document}
日志文件(前 50 个):
This is pdfTeX, Version 3.141592653-2.6-1.40.24 (TeX Live 2022) (preloaded format=pdflatex 2022.8.9) 27 JUN 2023 07:02
entering extended mode
\write18 enabled.
%&-line parsing enabled.
**sn-article.tex
(./sn-article.tex
LaTeX2e <2022-06-01> patch level 5
L3 programming layer <2022-08-05> (./sn-jnl.cls
Document Class: sn-jnl 2019/11/18 v0.1: An authoring template for Springer Journal articles
(/usr/local/texlive/2022/texmf-dist/tex/latex/base/article.cls
Document Class: article 2021/10/04 v1.4n Standard LaTeX document class
(/usr/local/texlive/2022/texmf-dist/tex/latex/base/fleqn.clo
File: fleqn.clo 2016/12/29 v1.2b Standard LaTeX option (flush left equations)
\mathindent=\skip47
Applying: [2015/01/01] Make \[ robust on input line 50.
LaTeX Info: Redefining \[ on input line 51.
Already applied: [0000/00/00] Make \[ robust on input line 62.
Applying: [2015/01/01] Make \] robust on input line 74.
LaTeX Info: Redefining \] on input line 75.
Already applied: [0000/00/00] Make \] robust on input line 83.
) (/usr/local/texlive/2022/texmf-dist/tex/latex/base/size10.clo
File: size10.clo 2021/10/04 v1.4n Standard LaTeX file (size option)
)
\c@part=\count185
\c@section=\count186
\c@subsection=\count187
\c@subsubsection=\count188
\c@paragraph=\count189
\c@subparagraph=\count190
\c@figure=\count191
\c@table=\count192
\abovecaptionskip=\skip48
\belowcaptionskip=\skip49
\bibindent=\dimen138
)
LaTeX Info: Redefining \rm on input line 144.
LaTeX Info: Redefining \sf on input line 145.
LaTeX Info: Redefining \tt on input line 146.
LaTeX Info: Redefining \bf on input line 147.
LaTeX Info: Redefining \it on input line 148.
LaTeX Info: Redefining \sl on input line 149.
LaTeX Info: Redefining \sc on input line 150.
LaTeX Info: Redefining \cal on input line 151.
LaTeX Info: Redefining \mit on input line 152.
LaTeX Info: Redefining \textsubscript on input line 210.
\columnhsize=\skip50
(/usr/local/texlive/2022/texmf-dist/tex/latex/geometry/geometry.sty
Package: geometry 2020/01/02 v5.9 Page Geometry
(/usr/local/texlive/2022/texmf-dist/tex/latex/graphics/keyval.sty
Package: keyval 2022/05/29 v1.15 key=value parser (DPC)
最后 350
\l__tblr_d_dim=\dimen259
\l__tblr_h_dim=\dimen260
\l__tblr_o_dim=\dimen261
\l__tblr_p_dim=\dimen262
\l__tblr_q_dim=\dimen263
\l__tblr_r_dim=\dimen264
\l__tblr_s_dim=\dimen265
\l__tblr_t_dim=\dimen266
\l__tblr_v_dim=\dimen267
\l__tblr_w_dim=\dimen268
\l__tblr_a_box=\box77
\l__tblr_b_box=\box78
\l__tblr_c_box=\box79
\l__tblr_d_box=\box80
\g__tblr_table_count_int=\count331
\c@rownum=\count332
\c@colnum=\count333
\c@rowcount=\count334
\c@colcount=\count335
\abovesep=\dimen269
\belowsep=\dimen270
\leftsep=\dimen271
\rightsep=\dimen272
\g_tblr_level_int=\count336
\g__tblr_data_row_key_count_int=\count337
\g__tblr_data_column_key_count_int=\count338
\g__tblr_data_cell_key_count_int=\count339
\g__tblr_array_int=\count340
\l__tblr_key_count_int=\count341
\l__tblr_key_quotient_int=\count342
\l__tblr_key_quotient_two_int=\count343
\l__tblr_key_remainder_int=\count344
\g__tblr_data_str_value_count_int=\count345
\rulewidth=\dimen273
\l__tblr_strut_ht_box=\box81
\l__tblr_strut_dp_box=\box82
\g__tblr_cell_wd_dim=\dimen274
\g__tblr_cell_ht_dim=\dimen275
\g__tblr_cell_head_dim=\dimen276
\g__tblr_cell_foot_dim=\dimen277
\l__column_target_dim=\dimen278
\l__tblr_caption_box=\box83
\l__tblr_caption_left_box=\box84
\l__tblr_row_head_box=\box85
\l__tblr_row_foot_box=\box86
\l__tblr_row_head_foot_dim=\dimen279
\tablewidth=\dimen280
\l__tblr_table_firsthead_box=\box87
\l__tblr_table_middlehead_box=\box88
\l__tblr_table_lasthead_box=\box89
\l__tblr_table_firstfoot_box=\box90
\l__tblr_table_middlefoot_box=\box91
\l__tblr_table_lastfoot_box=\box92
\l__tblr_remain_height_dim=\dimen281
\l__tblr_long_from_int=\count346
\l__tblr_long_to_int=\count347
\l__tblr_curr_i_int=\count348
\l__tblr_prev_i_int=\count349
\l__tblr_table_page_int=\count350
\l__tblr_table_head_box=\box93
\l__tblr_table_foot_box=\box94
\l__tblr_table_head_foot_dim=\dimen282
\l__tblr_table_head_body_foot_dim=\dimen283
\l__tblr_table_box=\box95
\l__tblr_table_hlines_box=\box96
\l__tblr_hline_box=\box97
\l__tblr_row_box=\box98
\l__tblr_col_o_wd_dim=\dimen284
\l__tblr_col_b_wd_dim=\dimen285
\l__tblr_hline_leftskip_dim=\dimen286
\l__tblr_hline_rightskip_dim=\dimen287
\l__tblr_row_ht_dim=\dimen288
\l__tblr_row_dp_dim=\dimen289
\l__tblr_row_abovesep_dim=\dimen290
\l__tblr_row_belowsep_dim=\dimen291
\l__tblr_row_vlines_box=\box99
\l__tblr_vline_box=\box100
\l__tblr_cell_box=\box101
\l__row_upper_dim=\dimen292
\l__row_lower_dim=\dimen293
\l__row_vpace_dim=\dimen294
\l__tblr_vline_aboveskip_dim=\dimen295
\l__tblr_vline_belowskip_dim=\dimen296
\l__tblr_cell_wd_dim=\dimen297
\l__tblr_cell_ht_dim=\dimen298
\l__tblr_diag_box=\box102
)
Package amsthm Warning: Unknown theoremstyle `thmstyletwo' on input line 22.
\c@example=\count351
\c@remark=\count352
Package amsthm Warning: Unknown theoremstyle `thmstylethree' on input line 26.
\c@definition=\count353
(./output.aux)
\openout1 = `output.aux'.
LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 31.
LaTeX Font Info: ... okay on input line 31.
LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 31.
LaTeX Font Info: ... okay on input line 31.
LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 31.
LaTeX Font Info: ... okay on input line 31.
LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 31.
LaTeX Font Info: ... okay on input line 31.
LaTeX Font Info: Checking defaults for TS1/cmr/m/n on input line 31.
LaTeX Font Info: ... okay on input line 31.
LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 31.
LaTeX Font Info: ... okay on input line 31.
LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 31.
LaTeX Font Info: ... okay on input line 31.
LaTeX Font Info: Checking defaults for PD1/pdf/m/n on input line 31.
LaTeX Font Info: ... okay on input line 31.
LaTeX Font Info: Checking defaults for PU/pdf/m/n on input line 31.
LaTeX Font Info: ... okay on input line 31.
\footinsA=\insert252
\c@footnoteA=\count354
*geometry* driver: auto-detecting
*geometry* detected driver: pdftex
*geometry* verbose mode - [ preamble ] result:
* driver: pdftex
* paper: custom
* layout: <same size as paper>
* layoutoffset:(h,v)=(0.0pt,0.0pt)
* bindingoffset: 17.07164pt
* modes: twoside
* h-part:(L,W,R)=(83.37448pt, 372.0pt, 125.06175pt)
* v-part:(T,H,B)=(73.97716pt, 552.69478pt, 218.37491pt)
* \paperwidth=597.50787pt
* \paperheight=845.04684pt
* \textwidth=372.0pt
* \textheight=552.69478pt
* \oddsidemargin=28.17613pt
* \evensidemargin=52.79176pt
* \topmargin=-19.72638pt
* \headheight=5.5pt
* \headsep=15.93355pt
* \topskip=10.0pt
* \footskip=28.45274pt
* \marginparwidth=34.1433pt
* \marginparsep=14.22636pt
* \columnsep=14.22636pt
* \skip\footins=8.0pt plus 4.0pt
* \hoffset=0.0pt
* \voffset=0.0pt
* \mag=1000
* \@twocolumnfalse
* \@twosidetrue
* \@mparswitchtrue
* \@reversemargintrue
* (1in=72.27pt=25.4mm, 1cm=28.453pt)
(/usr/local/texlive/2022/texmf-dist/tex/context/base/mkii/supp-pdf.mkii
[Loading MPS to PDF converter (version 2006.09.02).]
\scratchcounter=\count355
\scratchdimen=\dimen299
\scratchbox=\box103
\nofMPsegments=\count356
\nofMParguments=\count357
\everyMPshowfont=\toks40
\MPscratchCnt=\count358
\MPscratchDim=\dimen300
\MPnumerator=\count359
\makeMPintoPDFobject=\count360
\everyMPtoPDFconversion=\toks41
) (/usr/local/texlive/2022/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/2022/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg
File: epstopdf-sys.cfg 2010/07/13 v1.3 Configuration of (r)epstopdf for TeX Live
))
Package hyperref Info: Link coloring ON on input line 31.
(./output.out) (./output.out)
\@outlinefile=\write3
\openout3 = `output.out'.
\c@lstlisting=\count361
(/usr/local/texlive/2022/texmf-dist/tex/latex/ninecolors/ninecolors.sty
Package: ninecolors 2022-02-13 vv2022D Select colors with proper color contrast
(/usr/local/texlive/2022/texmf-dist/tex/latex/l3packages/xparse/xparse.sty
Package: xparse 2022-06-22 L3 Experimental document command parser
))
LaTeX Warning: Reference `tab:1' on page 1 undefined on input line 36.
> Step: init table outer spec.
> Step: parse table options.
> Step: split table.
> Step: init table inner spec.
> Step: parse table inner spec.
> Step: execute table commands.
> Step: calculate cell and line sizes.
> Step: build the whole table.
LaTeX Font Info: Calculating math sizes for size <8.03> on input line 55.
LaTeX Font Warning: Font shape `OT1/cmr/m/n' in size <4.015> not available
(Font) size <5> substituted on input line 55.
LaTeX Font Warning: Font shape `OML/cmm/m/it' in size <4.015> not available
(Font) size <5> substituted on input line 55.
LaTeX Font Warning: Font shape `OMS/cmsy/m/n' in size <4.015> not available
(Font) size <5> substituted on input line 55.
LaTeX Font Info: Trying to load font information for U+msa on input line 55.
(/usr/local/texlive/2022/texmf-dist/tex/latex/amsfonts/umsa.fd
File: umsa.fd 2013/01/14 v3.01 AMS symbols A
)
LaTeX Font Info: Trying to load font information for U+msb on input line 55.
(/usr/local/texlive/2022/texmf-dist/tex/latex/amsfonts/umsb.fd
File: umsb.fd 2013/01/14 v3.01 AMS symbols B
)
LaTeX Font Info: Trying to load font information for U+rsfs on input line 55.
(/usr/local/texlive/2022/texmf-dist/tex/latex/jknapltx/ursfs.fd
File: ursfs.fd 1998/03/24 rsfs font definition file (jk)
)
LaTeX Font Warning: Font shape `U/rsfs/m/n' in size <4.015> not available
(Font) size <5> substituted on input line 55.
Underfull \vbox (badness 10000) has occurred while \output is active []
[1
{/usr/local/texlive/2022/texmf-var/fonts/map/pdftex/updmap/pdftex.map}] (./output.aux)
*File List*
sn-jnl.cls 2019/11/18 v0.1: An authoring template for Springer Journal articles
article.cls 2021/10/04 v1.4n Standard LaTeX document class
fleqn.clo 2016/12/29 v1.2b Standard LaTeX option (flush left equations)
size10.clo 2021/10/04 v1.4n Standard LaTeX file (size option)
geometry.sty 2020/01/02 v5.9 Page Geometry
keyval.sty 2022/05/29 v1.15 key=value parser (DPC)
ifvtex.sty 2019/10/25 v1.7 ifvtex legacy package. Use iftex instead.
iftex.sty 2022/02/03 v1.0f TeX engine tests
cuted.sty 2021/10/04 v2.0 Mixing onecolumn and twocolumn modes
rotating.sty 2016/08/11 v2.16d rotated objects in LaTeX
graphicx.sty 2021/09/16 v1.2d Enhanced LaTeX Graphics (DPC,SPQR)
graphics.sty 2022/03/10 v1.4e Standard LaTeX Graphics (DPC,SPQR)
trig.sty 2021/08/11 v1.11 sin cos tan (DPC)
graphics.cfg 2016/06/04 v1.11 sample graphics configuration
pdftex.def 2020/10/05 v1.2a Graphics/color driver for pdftex
ifthen.sty 2022/04/13 v1.1d Standard LaTeX ifthen package (DPC)
threeparttable.sty 2003/06/13 v 3.0
appendix.sty 2020/02/08 v1.2c extra appendix facilities
hyperref.sty 2022-06-13 v7.00r Hypertext links for LaTeX
ltxcmds.sty 2020-05-10 v1.25 LaTeX kernel commands for general use (HO)
pdftexcmds.sty 2020-06-27 v0.33 Utility functions of pdfTeX for LuaTeX (HO)
infwarerr.sty 2019/12/03 v1.5 Providing info/warning/error messages (HO)
kvsetkeys.sty 2019/12/15 v1.18 Key value parser (HO)
kvdefinekeys.sty 2019-12-19 v1.6 Define keys (HO)
pdfescape.sty 2019/12/09 v1.15 Implements pdfTeX's escape features (HO)
hycolor.sty 2020-01-27 v1.10 Color options for hyperref/bookmark (HO)
letltxmacro.sty 2019/12/03 v1.6 Let assignment for LaTeX macros (HO)
auxhook.sty 2019-12-17 v1.6 Hooks for auxiliary files (HO)
nameref.sty 2022-05-17 v2.50 Cross-referencing by name of section
refcount.sty 2019/12/15 v3.6 Data extraction from label references (HO)
gettitlestring.sty 2019/12/15 v1.6 Cleanup title references (HO)
kvoptions.sty 2020-10-07 v3.14 Key value format for package options (HO)
pd1enc.def 2022-06-13 v7.00r Hyperref: PDFDocEncoding definition (HO)
intcalc.sty 2019/12/15 v1.3 Expandable calculations with integers (HO)
etexcmds.sty 2019/12/15 v1.7 Avoid name clashes with e-TeX commands (HO)
puenc.def 2022-06-13 v7.00r Hyperref: PDF Unicode definition (HO)
url.sty 2013/09/16 ver 3.4 Verb mode for urls, etc.
bitset.sty 2019/12/09 v1.3 Handle bit-vector datatype (HO)
bigintcalc.sty 2019/12/15 v1.5 Expandable calculations on big integers (HO)
atbegshi-ltx.sty 2021/01/10 v1.0c Emulation of the original atbegshi
package with kernel methods
hpdftex.def 2022-06-13 v7.00r Hyperref driver for pdfTeX
atveryend-ltx.sty 2020/08/19 v1.0a Emulation of the original atveryend package
with kernel methods
rerunfilecheck.sty 2019/12/05 v1.9 Rerun checks for auxiliary files (HO)
uniquecounter.sty 2019/12/15 v1.4 Provide unlimited unique counter (HO)
breakurl.sty 2013/04/10 v1.40 Breakable hyperref URLs
xkeyval.sty 2020/11/20 v2.8 package option processing (HA)
xkeyval.tex 2014/12/03 v2.7a key=value parser (HA)
ifpdf.sty 2019/10/25 v3.4 ifpdf legacy package. Use iftex instead.
wrapfig.sty 2003/01/31 v 3.6
natbib.sty 2010/09/13 8.31b (PWD, AO)
multirow.sty 2021/03/15 v2.8 Span multiple rows of a table
amsmath.sty 2022/04/08 v2.17n AMS math features
amstext.sty 2021/08/26 v2.01 AMS text
amsgen.sty 1999/11/30 v2.0 generic functions
amsbsy.sty 1999/11/29 v1.2d Bold Symbols
amsopn.sty 2022/04/08 v2.04 operator names
amssymb.sty 2013/01/14 v3.01 AMS font symbols
amsfonts.sty 2013/01/14 v3.01 Basic AMSFonts support
amsthm.sty 2020/05/29 v2.20.6
mathrsfs.sty 1996/01/01 Math RSFS package v1.0 (jk)
xcolor.sty 2022/06/12 v2.14 LaTeX color extensions (UK)
color.cfg 2016/01/02 v1.6 sample color configuration
mathcolor.ltx
textcomp.sty 2020/02/02 v2.0n Standard LaTeX package
manyfoot.sty 2019/08/03 v1.11 Many Footnote Levels Package (NCC)
nccfoots.sty 2005/02/03 v1.2 NCC Footnotes Package (NCC)
booktabs.sty 2020/01/12 v1.61803398 Publication quality tables
algorithm.sty 2009/08/24 v0.1 Document Style `algorithm' - floating environment
float.sty 2001/11/08 v1.3d Float enhancements (AL)
algorithmicx.sty 2005/04/27 v1.2 Algorithmicx
algpseudocode.sty
listings.sty 2020/03/24 1.8d (Carsten Heinz)
lstmisc.sty 2020/03/24 1.8d (Carsten Heinz)
listings.cfg 2020/03/24 1.8d listings configuration
lipsum.sty 2021-09-20 v2.7 150 paragraphs of Lorem Ipsum dummy text
l3keys2e.sty 2022-06-22 LaTeX2e option processing using LaTeX3 keys
expl3.sty 2022-08-05 L3 programming layer (loader)
l3backend-pdftex.def 2022-08-05 L3 backend support: PDF output (pdfTeX)
lipsum.ltd
tabularray.sty 2022-06-01 v2022B Typeset tabulars and arrays with LaTeX3
supp-pdf.mkii
epstopdf-base.sty 2020-01-24 v2.11 Base part for package epstopdf
epstopdf-sys.cfg 2010/07/13 v1.3 Configuration of (r)epstopdf for TeX Live
output.out
output.out
ninecolors.sty 2022-02-13 vv2022D Select colors with proper color contrast
xparse.sty 2022-06-22 L3 Experimental document command parser
umsa.fd 2013/01/14 v3.01 AMS symbols A
umsb.fd 2013/01/14 v3.01 AMS symbols B
ursfs.fd 1998/03/24 rsfs font definition file (jk)
***********
LaTeX Font Warning: Size substitutions with differences
(Font) up to 0.985pt have occurred.
LaTeX Warning: There were undefined references.
Package rerunfilecheck Info: File `output.out' has not changed.
(rerunfilecheck) Checksum: D41D8CD98F00B204E9800998ECF8427E;0.
)
Here is how much of TeX's memory you used:
16955 strings out of 477678
289684 string characters out of 5829488
692221 words of memory out of 5000000
35490 multiletter control sequences out of 15000+600000
475486 words of font info for 52 fonts, out of 8000000 for 9000
1151 hyphenation exceptions out of 8191
87i,11n,96p,255b,764s stack positions out of 10000i,1000n,20000p,200000b,200000s
</usr/local/texlive/2022/texmf-dist/fonts/type1/public/amsfonts/cm/cmbx10.pfb></usr/local/texlive/2022/texmf-dist/fonts/type1/public/amsfonts/cm/cmbx8.pfb></usr/local/texlive/2022/texmf-dist/fonts/type1/public/amsfonts/cm/cmr10.pfb></usr/local/texlive/2022/texmf-dist/fonts/type1/public/amsfonts/cm/cmr17.pfb></usr/local/texlive/2022/texmf-dist/fonts/type1/public/amsfonts/cm/cmr8.pfb>
Output written on output.pdf (1 page, 51569 bytes).
PDF statistics:
39 PDF objects out of 1000 (max. 8388607)
25 compressed objects within 1 object stream
3 named destinations out of 1000 (max. 500000)
1 words of extra memory for PDF output out of 10000 (max. 10000000)