我试图使用tabularray
跨越整个的多页表\textwidth
。但是,我甚至无法运行文档中的示例(表格阵列.pdf第 38 页)。
我究竟做错了什么?
\documentclass{article}
\usepackage{tabularray}
\begin{document}
\NewTblrTheme{fancy}{
\SetTblrStyle{firsthead}{font=\bfseries}
\SetTblrStyle{firstfoot}{fg=blue2}
\SetTblrStyle{middlefoot}{\itshape}
\SetTblrStyle{caption-tag}{red2}
}
\begin{longtblr}[
theme = fancy,
caption = {A Long Long Long Long Long Long Long Table},
entry = {Short Caption},
label = {tblr:test},
note{a} = {It is the first footnote.},
note{$\dag$} = {It is the second long long long long long long footnote.},
remark{Note} = {Some general note. Some general note. Some general note.},
remark{Source} = {Made up by myself. Made up by myself. Made up by myself.},
]{
colspec = {XXX}, width = 0.85\linewidth,
rowhead = 2, rowfoot = 1,
row{odd} = {gray9}, row{even} = {brown9},
row{1-2} = {purple7}, row{Z} = {blue7},
}
\hline
Head & Head & Head \\
\hline
Head & Head & Head \\
\hline
Alpha & Beta & Gamma \\
\hline
Epsilon & Zeta\TblrNote{a} & Eta \\
\hline
Iota & Kappa\TblrNote{$\dag$} & Lambda \\
\hline
Nu & Xi & Omicron \\
\hline
Rho & Sigma & Tau \\
\hline
Phi & Chi & Psi \\
\hline
......
\hline
Alpha & Beta & Gamma \\
\hline
Epsilon & Zeta & Eta \\
\hline
Iota & Kappa & Lambda \\
\hline
Nu & Xi & Omicron \\
\hline
Rho & Sigma & Tau \\
\hline
Phi & Chi & Psi \\
\hline
Foot & Foot & Foot \\
\hline
\end{longtblr}
\end{document}
答案1
快速测试发现了几个问题。
可能不是实际的问题,但值得一提:
\hline
不应该在这里使用,而应该优先使用手册中描述的“新语法”。应该加载包
xcolor
,否则颜色相关的参数不起作用。以下行:
......
行末\hline
缺少“ between two” 。\\
最大的问题可能是 3),因为它是一个纯粹的语法错误。我猜想作者并不是想逐字输入这一行,而是想说“在这里输入任意多行,这样表格就无法在一页上显示”。
问题 2) 较小,xcolor
通常都会被加载,手动或由其他包自动加载。