lvjr / tabularray

Typeset tabulars and arrays with LaTeX3
https://ctan.org/pkg/tabularray
253 stars 22 forks source link

Wrong display of tblr inside longtblr #463

Closed dlobba closed 8 months ago

dlobba commented 9 months ago

While creating some complex tabular content nesting tblr inside longtblr I noticed that the first and last "hline" of the inner tblr are shown only for the last occurrence of tblr.

The following MWE (pdf here) reports exactly the problem I am experiencing: at line 3 and line 4 of the longtblr there are tblr nested. The last one (line 4) is displayed ok, while the one at line 3 is missing the first and last hline.

If removing line 4 of longtblr altogether, the tblr defined at line 3 is now displayed correctly.

\documentclass{article}

\usepackage{tabularray}

\begin{document}

\begin{tblr}[long]{rowfoot=1, rowhead=1, hlines, vlines, colspec={lX}}
    Head1 & Head2 \\                                % row 1
    1 & 2 \\                                        % row 2
    Some & %
    \begin{tblr}{hlines, vlines, colspec={lX}}
        Nested1 & Nested2 \\
        1 & 2 \\
        Some & %

        \\%
    \end{tblr}
    \\                                              % row 3 (not ok)
    Some & %
    \begin{tblr}{hlines, vlines, colspec={lX}}
        Nested3 & Nested4 \\
        1 & 2 \\
        Some & %

        \\%
    \end{tblr}
    \\                                              % row 4 (displayed ok)
\end{tblr}

\end{document}

Also note, if I was removing rowhead=1 and rowfoot=1 from longtblr options, I would experience the problem also on the last nested tblr.

To me this sounds like a bug as I would like to consider each tblr (and longtblr) environment as independent, while here what I can notice is that the behaviour of nested tblr is linked to the outermost environment.

Thank you for your attention and great work on this package!

muzimuzhi commented 9 months ago

Not reproducible with tabularray version 2023A (2023-03-01), both locally and using overleaf.com's texlive 2023. Which version of tabularray are you using?

dlobba commented 8 months ago

yep, that was it! I was using texlive from apt repository of a (quite) recent ubuntu Ubuntu 22.04.2 LTS and that was using tabularray 2021-12-01 v2021Q, which was kind of an old version.

Once I threw the ubuntu baked texlive away and installed texlive from TUG I got a newer version of the package and the problem was no more there.

Thanks for the support!

muzimuzhi commented 8 months ago

Duplicate of #227