Hi Thomas, It looks like you are looking for (inside the module): \def\initializegreek {\switchtobodyfont[My\getvariable{Greek}{font}]} \appendtoks \initialize \to \everystarttext There is no other way to get arguments to/from the module. For Hans: it would be really cool if there was a way to do something like this: \usemodule[greek][font=GreekGentium,scale=0.9] with (in this example) the \usemodule command defining the variables \moduleoptionfont \moduleoptionscale etc. Greetings, Taco Thomas A. Schmitz wrote:
Hi all,
excuse me for being so pig-headed, but I'm running into the same problem I had two weeks ago. Peter Rolf was incredibly helpful, but I couldnt get things working. It is more a problem of architecture and general choices, IMHO, than of actual code. I tried every single part of what I want to achieve, and it works. The difficulty lies in getting the variables to work...
Basic problem: I want to refine my greek module. It provides a command
\setupgreek[font=,scale=]
which sets variables fonts and scale in the namespace Greek. The command is defined in the module, so in order to use it, the module has to be read. BUT: I want to use the result [i.e. \getvariable {Greek}{font} and \getvariable{Greek}{scale}] within the module itself. Is this possible?
Details: I want to organize the fonts in a typescript to be more flexible. So the module first defines the setupcommand:
\def\setupgreek{\setvariables[Greek]}
then it calls the typescript
\usetypescriptfile[type-tasgreek]
where all the Greek fonts are defined in this form:
\starttypescript [serif] [GreekGentium] [agr] \definefontsynonym [Greekgentium-Roman] [genagr-GentiumAlt] [encoding=agr] \definefontsynonym [Greekgentium-Italic][genagr-GentiumAItI] [encoding=agr] \stoptypescript
\starttypescript [serif] [GreekGentium] [name] \usetypescript[serif][fallback] \definefontsynonym [Serif] [Greekgentium-Roman] \definefontsynonym [SerifItalic] [Greekgentium-Italic] \definefontsynonym [SerifBold] [Serif] \definefontsynonym [SerifBoldItalic] [Serif] \stoptypescript
So the module calls the typescriptfile (or would it be more elegant to include these typescripts in the module itself?)
I then have the definition for the command \localgreek which contains, among other things, a call of the Greek font. I had been planning to implement it in this form:
\definetypeface [My\getvariable{Greek}{font}] [rm] [serif] [\getvariable{Greek}{font}] [default] [rscale = \getvariable{Greek} {font},encoding=agr]
and then, in the setups for \localgreek,
\switchtobodyfont[My\getvariable{Greek}{font}]
And that's where I'm banging my head against the wall: the module would be used like this
\usemodule[t-greek] \setupgreek[font=GreekGentium,scale=0.9]
Which means: the entire module will be read BEFORE the \setupgreek command. But I would need the values of the setupgreek command WITHIN the module. Is that possible at all? Would I have to call a third file where the values are then processed? I tried to look into the source how \setup commands work, but I do get the impression that collecting the values and processing them is done in different files. Is this necessary? And how could I implement it in one module?
Sorry if this sounds confusing, but I'm pretty confused, and hoping for enlightenment from the wizzards.
All best
Thomas _______________________________________________ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context