0

I hope to make a long table across pages by tabularray package. First, I need to understand the example on page 36 of the book. When I tested it, it showed weird: enter image description here

The code:

\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}

Y. zeng
  • 1,885

1 Answers1

1

It can extended to multiple tables if you remove \begin{table} environment

Updated

final code:

\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}

Also take a look here: Make a table span multiple pages