Closed t-b closed 2 weeks ago
Generally this works. Though you could juse use \UseName{…}
instead of \csname …\endcsname
nowerdays or the expl3 c-type.
I guess the issue you face comes from the timing. You seem to set that variable before the komavar is set.
So you have to ensure to pass the value before you do the expansion, which you do at the moment of \SetZUGFeRDData*
by using the starred version. You could use a hook or something like \AtBeginLetter
to do that later.
Thanks, using \UseName
did the trick.
I'm now using
\newkomavar{postcode}
\setkomavar{postcode}{01234}
\newcommand{\expandkomavar}[1]{\UseName{scr@#1@var}}
\SetZUGFeRDData*{
document-type = commercial-invoice,
seller/postcode = \expandkomavar{postcode},
}
which works.
(I'm pretty sure this is a standard latex question but I'm not really good at this.)
I would like to use komascript variables for the zugferd data entries to avoid duplication of values.
Now from glancing at the package code, and https://tex.stackexchange.com/a/532873/77589, I managed to cargo cult something like
together. But it's hideous to use and look at.
I've tried the obvious
to wrap the calls but that does not work. Is there a more elegant way?