I would like to create an “environment” (i.e. delimited parser) that reads lines verbatim and stores them in a sequence variable.
I have tried using an xparse +v
type argument, then splitting the parsed token list on the endline character, like so:
\seq_set_split:Nxn \l__ks_verb_lines_seq { \char_generate:nn { 13 } { 12 } } { #1 }
where #1
is the verbatim tokens. Unfortunately, this approach strips the indentation from the lines, which makes them unsuitable for my purposes.
I do not require that xparse be used.
filecontentsdefmacro
(despite the name, it doesn't involve any file)