lvjr / tabularray

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

Issue with merged cells. Content remaining on previous page while expected on the next page. #278

Closed celdorwow closed 2 years ago

celdorwow commented 2 years ago

Hi,

First of all many thanks for the package. It saved me a lot of troubles :)

There is small issue in longtblr tables when I use merged cells via \SetCell[r=3]{}.

In the example below, if the merged cells are divided by a page break, the content of a merged cell is put in the row dedicated for annotations, s.a. Continue on next page. The code below demonstrate the problem. As such 9 is not on the next page.

I run the code with the following tabularray: 2022-07-01 v2022C on TexLive version Version 3.141592653-2.6-1.40.24 (TeX Live 2022) (preloaded format=pdflatex 2022.7.21) 3 AUG 2022 12:02

The code

\documentclass[11pt]{article}
\usepackage{dingbat}
\usepackage{xcolor}
\usepackage{tabularray}

\definecolor{clemsonorange}{HTML}{EA6A20}
\definecolor{light-gray}{HTML}{E5E4E2}

\ExplSyntaxOn
\NewChildSelector{eachthirdtwo}{
    \int_step_inline:nnnn {2} {3} {\l_tblr_childs_total_tl}
        {\clist_put_right:Nn \l_tblr_childs_clist {##1}}
}
\ExplSyntaxOff

\begin{document}
\begin{longtblr}[
        caption ={My table},
    ]
    {
        colspec = {Q[c]Q[l]Q[l]X[l]Q},
        rowhead = 1,
        row{1} = {font=\bfseries, bg=light-gray},
        column{1} = {font=\bfseries},
        column{4} = {halign=c},
        vlines,
        hline{1-Z} = {2-Z}{},
        hline{1},
        hline{eachthirdtwo},
    }
    & DATE & {READINGS\\ASSIGNMENTS\\IMPORTANT INFORMATION} & \checkmark \\ 
    \SetCell[r=3]{c} 1 & Aug. 22 (M) & & \\ 
        & Aug. 24 (W) & & \\  
        & Aug. 26 (F) & & \\
    \SetCell[r=3]{c} 2 & Aug. 29 (M) & & \\ 
        & Aug. 31 (W) & & \\  
        & Sep. 2 (F)  & & \\
    \SetCell[r=3]{c} 3 & Sep. 5 (M) & & \\ 
        & Sep. 7 (W)  & & \\  
        & Sep. 9 (F)  & & \\
    \SetCell[r=3]{c} 4 & Sep. 12 (M) & & \\ 
        & Sep. 14 (W) & & \\  
        & Sep. 16 (F) & & \\
    \SetCell[r=3]{c} 5 & Sep. 19 (M) & & \\ 
        & Sep. 21 (W) & & \\  
        & Sep. 23 (F) & & \\
    \SetCell[r=3]{c} 6 & Sep. 26 (M) & & \\ 
        & Sep. 28 (W) & & \\  
        & Sep. 30 (F) & & \\
    \SetCell[r=3]{c} 7 & Oct. 3 (M) & & \\ 
        & Oct. 5 (W)  & & \\  
        & Oct. 7 (F)  & & \\
    \SetCell[r=3]{c} 8 & Oct. 10 (M) & & \\ 
        & Oct. 12 (W) & & \\  
        & Oct. 14 (F) & & \\
    \SetCell[r=3]{c} 9 & Oct. 17 (M) & & \\ 
        & Oct. 19 (W) & & \\  
        & Oct. 21 (F) & & \\
    \SetCell[r=3]{c} 10 & Oct. 24 (M) & & \\ 
        & Oct. 26 (W) & & \\  
        & Oct. 28 (F) & & \\
    \SetCell[r=3]{c} 11 & Oct. 31 (M) & & \\ 
        & Nov. 2 (W) & & \\  
        & Nov. 4 (F) & & \\
    \SetCell[r=3]{c} 12 & Nov. 7 (M) & & \\ 
        & Nov. 9 (W) & & \\  
        & Nov. 11 (F) & & \\
    \SetCell[r=3]{c} 13 & Nov. 14 (M) & & \\ 
        & Nov. 16 (W) & & \\  
        & Nov. 18 (F) & & \\
    \SetCell[r=3]{c} 14 & Nov. 21 (M) & & \\ 
        & Nov. 23 (W) & & \\  
        & Nov. 25 (F) & & \\
    \SetCell[r=3]{c} 15 & Nov. 28 (M) & & \\ 
        & Nov. 30 (W) & & \\  
        & Dec. 2 (F) & & \\
\end{longtblr}
\end{document}
lvjr commented 2 years ago

Sorry, tabularray can not break multirow cells. You can only use \\* to prevent page breaks inside them:

\SetCell[r=3]{c} 6 & Sep. 26 (M) & & \\*
        & Sep. 28 (W) & & \\*
        & Sep. 30 (F) & & \\
celdorwow commented 2 years ago

I see. I am happy with that. Thanks.