为什么我不能使用示例从 tabularray 获取跨页的长表?

为什么我不能使用示例从 tabularray 获取跨页的长表?

我希望按tabularray包制作一个跨页的长表。首先,我需要理解第 36 页的示例这本书。我测试了一下,显示很奇怪: 在此处输入图片描述

代码:

\documentclass{article}
\usepackage{tabularray}
\usepackage{siunitx}
\usepackage{tabularx}
\usepackage{graphics}
\usepackage{ninecolors}
\UseTblrLibrary{booktabs, siunitx}
\begin{document}
 \begin{table}[hbt!]

\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
 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
 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
 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
 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 \\
  Alpha & Beta & Gamma \\
\hline
 Epsilon & Zeta\TblrNote{a} & Eta \\
\hline
 Iota & Kappa\TblrNote{$\dag$} & Lambda \\
\hline
 Nu & Xi & Omicron \\
\hline
 Rho & Sigma & Tau \\
 \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
 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
 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{table}
\end{document}

答案1

如果删除\begin{table}环境,它可以扩展到多个表

更新

最终代码:

\documentclass{article}
\usepackage{tabularray}
\usepackage{siunitx}
\usepackage{tabularx}
\usepackage{graphics}
\usepackage{ninecolors}
\UseTblrLibrary{booktabs, siunitx}
\DefTblrTemplate{contfoot-text}{normal}{see next page}
\SetTblrTemplate{contfoot-text}{normal}
\DefTblrTemplate{conthead-text}{normal}{(Here)}
\SetTblrTemplate{conthead-text}{normal}
\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
 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
 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
 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
 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 \\
  Alpha & Beta & Gamma \\
\hline
 Epsilon & Zeta\TblrNote{a} & Eta \\
\hline
 Iota & Kappa\TblrNote{$\dag$} & Lambda \\
\hline
 Nu & Xi & Omicron \\
\hline
 Rho & Sigma & Tau \\
 \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
 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
 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}

另请看一下这里:使表格跨越多页

相关内容