Open hushidong opened 1 week ago
Am 24.09.2024 um 16:36 schrieb @. @.>:
In the following two examples, SetTblrTemplate works for head,foot in the example 1, but not works for contfoot-text,conthead-text in the example 2.
\documentclass{article} \usepackage{ctex} \usepackage{xcolor} \usepackage{tabularray}
\begin{document}
%\SetTblrTemplate{head,foot}{empty} \SetTblrTemplate{contfoot-text,conthead-text}{empty}
\DefTblrTemplate{contfoot-text}{default}{} \DefTblrTemplate{conthead-text}{default}{}
Worked for me
@hvoss49 yes, \DefTblrTemplate{contfoot-text}{default}{}
works.
But, why SetTblrTemplate
can not work? If it is designed so, the manual should be revised.
But, why
SetTblrTemplate
can not work? If it is designed so, the manual should be revised.
Because both conthead-text
and contfoot-text
elements have no empty
template defined.
https://github.com/lvjr/tabularray/blob/913756cbd813a7d1b9e2bff00e58b8b0f49076bf/tabularray.sty#L4873-L4874 https://github.com/lvjr/tabularray/blob/913756cbd813a7d1b9e2bff00e58b8b0f49076bf/tabularray.sty#L4901-L4902
Instead, both conthead
and contfoot
elements do have empty
templates which do nothing. Maybe that's the suggested user interfaces.
https://github.com/lvjr/tabularray/blob/913756cbd813a7d1b9e2bff00e58b8b0f49076bf/tabularray.sty#L4876
https://github.com/lvjr/tabularray/blob/913756cbd813a7d1b9e2bff00e58b8b0f49076bf/tabularray.sty#L4897
According to how the default conthead
template is defined, to get empty heads for continued parts of a table, maybe one has to use \SetTblrTemplate{conthead}{empty}
instead of just setting an empty conthead-text
. Just see the \leavevmode
and \par
in \DefTblrTemplate { conthead } { normal } { ... }
.
A similar argument holds for contfoot
.
https://github.com/lvjr/tabularray/blob/913756cbd813a7d1b9e2bff00e58b8b0f49076bf/tabularray.sty#L4912-L4923
@muzimuzhi In other words, the instruction "For each of the above elements, two templates normal and empty are always defined." in the manual is inaccurate. So it is better to revise the manual for users who are not familiar with the implementation code.
Version:2024A
In the following two examples, SetTblrTemplate works for head,foot in the example 1, but not works for contfoot-text,conthead-text in the example 2.
example 1: works normaly
example 2: works abnormaly, and an error is raised:
However, the manual (section 4.2.1, page 40) says:
is this a bug, or there is something I was missing?