[NTG-context] checking for module parameters

Philipp Gesang pgesang at ix.urz.uni-heidelberg.de
Fri Aug 13 10:31:32 CEST 2010


On 2010-08-13 <05:16:40>, Wolfgang Schuster wrote:
>  Am 13.08.10 00:20, schrieb Philipp Gesang:
> >Hi,
> >
> >is there a way to check whether an option was specified through \usemodule?
> >Couldn't find anything like that in core-fil.mkiv.
> >
> >I'd imagined some branching as with the system macros:
> >
> >······ Wishful thinking ·······················································
> >
> >\doifmoduleparameter{modulename}{key}                      % in the module code
> >   {\somecommand[\moduleparameter{modulename}{key}]}
> >
> >\usemodule                                                 % user code
> >   [modulename]
> >   [key=val]
> >
> >····· /Wishful thinking ·······················································
> >
> >Thanks for any suggestions,
> 
> You can set a empty value for the kay in your module and check if
> the user has set a value with \usemodule:
> 
> \setupmodule[key=]
> 
> \doifsomething{\currentmoduleparameter{key}}{\setupsomething[key=\currentmoduleparameter{key}]}
> 
> For a better answer i have to know for what purpose you need this
> information.

Hi Wolfgang,

you don't have to look any further, this is exactly what I was looking
for! (Note to self: maybe it is time to investigate the dozens of doif.*
tests a bit more thoroughly.) Thanks,

Philipp


> 
> Wolfgang
> 
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to the Wiki!
> 
> maillist : ntg-context at ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
> archive  : http://foundry.supelec.fr/projects/contextrev/
> wiki     : http://contextgarden.net
> ___________________________________________________________________________________

-- 
()  ascii ribbon campaign - against html e-mail
/\  www.asciiribbon.org   - against proprietary attachments
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://www.ntg.nl/pipermail/ntg-context/attachments/20100813/b4260477/attachment.pgp>


More information about the ntg-context mailing list