0

I am trying to use tabularray for multi-page tables that span the whole \textwidth. However, I fail even at running the examples from the documentation (tabularray.pdf page 38).

What am I doing wrong?

\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 Answer 1

2

A quick test shows several problems.

  1. Probably not the actual problem, but worth mentioning: \hline shouldn't be used here, and the "new syntax" described in the manual should be favored instead.

  2. Package xcolor should be loaded, otherwise color-related parameters don't work.

  3. The line:

 ...... 

between two \hline is missing \\ at the end of the line.

The biggest problem is probably 3), since it's a pure syntax error. I assume that the author didn't mean this line to be typed literally, but wanted to say "type as many lines as you wish here so that the tabular doesn't fit on a single page".

Problem 2) is minor, xcolor usually gets loaded anyway, manually or automatically by other packages.

2
  • Thanks. I had taken the example directly from the documentation. Why would they use \hline if they also discourage it? The ...... I should have seen and removed. Still examples should work out of the box... Commented Apr 30, 2023 at 22:27
  • @mrCarnivore The manual shows both the new syntax (which is cleaner, but a bit unusual for old LaTeX users) and the old one. It's probably too early to discard the old one, or it might not be a good idea if they want users with established habits to adopt their package. So examples in the manual show both, depending on the paragraph. Commented Apr 30, 2023 at 22:29

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.