Open jasperhabicht opened 1 year ago
I just realised that the above behaviour applies to tabulars in LaTeX in general. So, it is probably not a bug. However, it would be nice if the tabularray
would allow the user to easily use \linewidth
(or a similar macro) inside multi-column cells as well without the need of manually calculating the width of the spanning cell.
You may try hspan=minimal
option (see the manual).
Actually, I found that one can probably use the \l__tblr_cell_wd_dim
macro, which seems to store the inner width of a cell. One only needs to make it accessible for use outside of Expl3 syntax. Maybe the package could already define a user macro to access the value stored in this macro?
\ExplSyntaxOn
\NewDocumentCommand{\cellwidth}{ }{
\dim_use:N \l__tblr_cell_wd_dim
}
\ExplSyntaxOf
It seems that inside a
tabu
environment,\linewidth
behaves differently depending on whether it is used in a cell that spans multiple columns or not.Consider the following MWE where rules with the width of
\linewidth
are placed into each of the cells and the column padding is set to 5pt. In the first example,\linewidth
obviously considers the column padding and the rules exactly fit the cells.In the second example, An multi-column cell is added that spans over both columns. Here we get a warning regarding an overfull box that is exactly twice the column padding.
The same seems to hold for the width of vertical borders: If
\linewidth
is used inside a multi-column cell, an overfull-box warning is issued where the sum of the column padding and the border width is reported.