Replies: 2 comments
|
Yes, it makes sense. And the following is a minimal example: \documentclass{article}
\usepackage{tabularray}
\usepackage{etoolbox}
\begin{document}
\ExplSyntaxOn
%\makeatletter
\apptocmd { \__tblr_split_table:n } { \mycolsum } { } { }
\NewDocumentCommand \mycolsum {}
{
\int_step_inline:nn { \arabic{colcount} }
{
\int_zero:N \l_tmpa_int
\int_step_inline:nn { \arabic{rowcount} - 1 }
{
\int_add:Nn \l_tmpa_int
{ \__tblr_spec_item:nn { text } { [####1][##1] } }
}
\__tblr_spec_gput:neV { text } { [\arabic{rowcount}][##1] } \l_tmpa_int
}
}
%\makeatother
\ExplSyntaxOff
\begin{tblr}{rrr}
\hline
1 & 2 & 3 \\
4 & 5 & 6 \\
7 & 8 & 9 \\
\hline
& & \\
\hline
\end{tblr}
\end{document} |
0 replies
|
I have added |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

Uh oh!
There was an error while loading. Please reload this page.
This question springs from a previous one from myself about the way in which commands declared as
cmd=are executed.If I understand correctly,
tabularrayfirst executes a parsing step based on the regular expression interfaces from latex3 and then builds the table. I believe that the parsing steps reads the raw cell entries in some data structure.I wonder if it could make sense to introduce a hook which can further manipulate this data structure before it is used to build the actual table. For instance, this would let some cell values be computed from others, offering some spreadsheet-like abilities in an alternative and complementary way wrt spreadtab.
For instance, one could initially set up a table with no data for a cell and use the hook to fill in this value from other cell values.
I am proposing this because I find the interfaces in
spreadtabinteresting, but not very *LaTeX-onic` for some application cases. Specifically, it is very number oriented introducing the need to mark a lot of cells as text ones and makes it a bit complex to build cells from the text values in other cells. Furthermore, if my understanding is correct, it does not help if you want to use e.g. lua code in luatex to do your computations.The proposed hook could simply not be used by those uninterested in it and would not break the compatibility with spreadtab.
Would something like that make sense?
All reactions