tabularray icon indicating copy to clipboard operation
tabularray copied to clipboard

empty longtblr errors

Open u-fischer opened this issue 3 years ago • 1 comments

If a longtblr has no content (which can happen if the content is autogenerated) it errors:

\documentclass{article}
\usepackage{tabularray}
\begin{document}
\begin{longtblr} {}   
\end{longtblr}
\end{document}

gives

! Missing number, treated as zero.
<to be read again> 
                   \__dim_eval_end: 
l.144 \end
          {longtblr}

u-fischer avatar Nov 11 '22 09:11 u-fischer

It seems I need to throw a warning and not to build the table if rowcount equals zero (not only for long tables).

lvjr avatar Nov 12 '22 05:11 lvjr

Any progress for this issue?

dbitouze avatar Aug 27 '25 14:08 dbitouze

@dbitouze My current idea is to treat empty body as one-row and one-column with empty cell text. Empty cell is natural, but zero-row table is weird.

lvjr avatar Sep 02 '25 11:09 lvjr

At this time, a tall or long table causes errors, while a short table doesn't cause errors but makes no output.

\documentclass{article}
\usepackage{tabularray}
\begin{document}

\begin{tblr}{hlines,vlines}\end{tblr}

\begin{talltblr}{hlines,vlines}\end{talltblr}

\begin{longtblr}{hlines,vlines}\end{longtblr}

\end{document}

lvjr avatar Sep 02 '25 11:09 lvjr

This bug has been fixed.

\documentclass{article}
\usepackage{tabularray}
\SetTblrTemplate{head}{empty}
\begin{document}

Short: \begin{tblr}{hlines,vlines}\end{tblr}

Tall: \begin{talltblr}{hlines,vlines}\end{talltblr}

Long: \begin{longtblr}{hlines,vlines}\end{longtblr}

\end{document}
Image

lvjr avatar Sep 02 '25 12:09 lvjr