Closed muzimuzhi closed 2 years ago
Collecting all material automatically by a global key is perhaps a goal to high to reach. The general assumption of your nice patch on TeX-SX is that material by keys like before line
can be collected and processed at the end. But, that is not always true, because I have applications where keys like that contain computations which influence the further processing (filter, for example).
Maybe, something like the \gappto
etc. macros from etoolbox
package could be used to collect and build up data into a macro.
No concrete solution, just brainstorming:
before line=<compute something>\csvapp{xy}, % with computation and saving xy
before line=\csvapp{xy}, % no computation, just saving xy
before line app=xy, % shortcut
command=\csvappo{\csvcoli} \csvapp{&} \csvappo{\csvcolii}, % possibly not so nice; \csvappo for expanding once
After some experiments, maybe, command keys could be identified to be collected automatically and others not. Also, computing stuff could be forbidden to put into before line
...
E.g. after line
is a candidate for collection and before filter
is a candidate for not being collected...
brainstorming continued
[...] But, that is not always true, because I have applications where keys like that contain computations which influence the further processing (filter, for example).
Seems like a call for piped processors: generator, filter (with write to aux), accumulator, and writer. As you said, "perhaps a goal too high to reach".
I just uploaded version 2.1.0 (2021/07/01)
. With the new option collect data
I would consider the feature request to be fulfilled as far as possible. The collection is limited, but I think a lot of things can be done with the new code.
So quick!
A minor improvement: doc for options no table
, before table
, table head
,table foot
, and after table
need mention one of tabularray
, \begin{tabularray}
, and \end{tabularray}
. Or, use a placeholder, e.g. <tabular-like env>
which stands for one of the supported tabular-like env name, to get a more compact and easy-to-extend (documentary) style.
Great! I found typos on page 37 of the documentation: 2021-07-26
should be 2021-07-06
.
Thank you both - I will correct and improve all mentioned things.
Corrected and improved with version 2.2.0 (2021-09-09)
In certain cases, it is desired that the processed results are collected and stored in a macro rather than being print piece by piece, so the results could be further processed. For example, package
tabularray
need collectIn this answer on TeX-SX, I did a naive patch to
csvsimple-legacy
(I should have patched the-l3
version, hmmm.), in which a bool keystore only
and a command\csvoutput
are provided. Then I realized that the collection can be turned on by default, andstore only
can only control if the collected results are auto used at the end of\csvloop / \__csvsim_loop:
.