Open muzimuzhi opened 1 year ago
I think this is not a strong reason for making a breaking change. Any user can define a new L/C/R
column type which takes an optional argument.
The most important thing is how to clear existing values of keys in tabularray
:
https://github.com/lvjr/tabularray/wiki/KeyValue
But I haven't checked all the keys yet.
Providing an init
-like meta key for each key-val module?
Edit: Ah I got your point about "clearing existing values of keys in tabularray
". It either needs to adjust the initial value to a normal value user could pass on, or handler a special value (like none
or empty value).
BTW I think it's more like an extension, rather than breaking change. It will turn currently invalid input like c[co=0]
to valid.
The problem of how different row/column types should interact with each other is raised, for example when
columns
is set by\SetTblrInner
andcolspec
fed totblr
environment. See https://tex.stackexchange.com/q/686262 and also #408.Quoting my own tex-sx answer,
If it's by design that column types changing horizontal alignment (
l
,c
,r
, andj
) and the type changing column coefficient (X
) function orthogonally, then I think at least those h-align columns types could take an optional argument as well.https://github.com/lvjr/tabularray/blob/690e67ee175ff7601d0144c84f9a7e9c67573e0b/tabularray.sty#L2518-L2521 https://github.com/lvjr/tabularray/blob/690e67ee175ff7601d0144c84f9a7e9c67573e0b/tabularray.sty#L2537
Example, simplified from my tex-sx answer
```tex \documentclass{article} \usepackage{tabularray} \SetTblrInner{hlines, vlines, columns={co=1}} \def\testTblrColspec#1{ \hspace*{-2em}\texttt{\UseName{tl_if_empty:nTF}{#1}{}{#1}}
\par\medskip
\begin{tblr}{#1}
Head1 & Head2 & Head3\\
Row21 & Row22 & Row23 \\
Row31 & Row32 & Row33 \\
Row41 & Row42 & Row43 \\
\end{tblr}
\par\medskip
}
\setlength{\parindent}{0mm}
\begin{document}
\testTblrColspec{}
\testTblrColspec{colspec={l X[r] c}}
\testTblrColspec{colspec={Q[l,co=0] X[r] Q[c,co=0]}}
\end{document}
```
![image](https://github.com/lvjr/tabularray/assets/6376638/ad350bf9-2d54-432d-82de-2f3c9ea25453)