Am 19.03.24 um 23:53 schrieb Wolfgang Schuster:
Hraban Ramm schrieb am 19.03.2024 um 21:41:
Following up on the other imposition question, I'm trying to make an example file that shows an imposition schema according to command line arguments.
This way it works for the number of pages, as used in \dorecurse{\Pages}{…}, but not for the imposition schema. Typesetting \Schema looks right, but \setuparranging doesn’t work. Where's my error?
You forgot about expansion and in your case \doifelsedocumentargument is not fully expandable. This doesn't matter for \dorecurse where the number parser ignores the flag because \setuparranging does care and \Schema fails to expand. Thank you! Well, I tried \expanded in a few places, and that didn’t work.
\def\Schema{\doifelsedocumentargument{schema}{\getdocumentargument{schema}}{1*8}}
\def\Pages{\doifelsedocumentargument{numberofpages}{\getdocumentargument{numberofpages}}{16}}
\setuparranging[\Schema]
\doifelsedocumentargument{schema} {\setuparranging[\getdocumentargument{schema}]} {\setuparranging[1*8]}
Ok, that works. (Of course, if you say so.)
It does also help to look at the included extra files (e.g. mtx-context-arrange.tex) written by Hans.
Well, I don’t know how to use that, it doesn’t compile on its own, any hints? Hraban