[NTG-context] tex placeholder for use in metapost/metafun

Wolfgang Schuster schuster.wolfgang at googlemail.com
Sat Sep 11 06:18:39 CEST 2010


Am 10.09.2010 um 22:45 schrieb Martin 'golodhrim' Scholz:

> Hi everybody,
> 
> as I like to desing a CI for an publishing Cover for an Organisation, I 
> have a question about usage:
> 
> What I wanna do is, having placeholders in the metapost coverpage, it 
> should work like
> 
> \author{}
> \title{}
> \swlogo{}
> 
> in the preamble
> 
> and should be automatically placed in the metapost graphic at runtime....
> 
> what would be the best way to do that?
> 
> I thought about
> 
> \def\author{content}
> 
> 
> and then in metapost \btex\author\etex
> 
> but not sure if it will work, or is there a more ConTeXtian way to do 
> so...

You can set the values with

\setvariables
  [document]
  [author=...,
   title=...,
   logo=...]

and access them with

\getvariable{document}{author}

You can also test for a content of the variable:

\doifvariable{document}{logo}{\externalfigure[\getvariable{document}{logo}]}

Wolfgang



More information about the ntg-context mailing list