Re: [NTG-context] Fwd: Personalizing a PDF generated with ConTeXt

2011-03-05 Thread Wolfgang Schuster

Am 05.03.2011 um 12:25 schrieb Cecil Westerhof:

 2011/3/1 Taco Hoekwater t...@elvenkind.com
 \setvariables and \getvariables sounds like the most general solution
 
 in that case.
 
 For example, you could put the various \setvariables statements in various 
 separate files and load a specific one from the context command line with 
 --environment=...
  
 I tried it and it works. Only one thing: when the variables are not set 
 (forgot the environment parameter, file not correctly set, ...) I would like 
 to set default values. How would I do that?

%\enablemode[variables]

\startmode[variables]
\setvariables
  [test]
  [one=One,
   two=Two]
\stopmode

\starttext
\doifelsevariable{test}{one}{1: \getvariable{test}{one}}{??}\par
\doifelsevariable{test}{two}{2: \getvariable{test}{two}}{??}
\stoptext

Wolfgang

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@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
___


Re: [NTG-context] Fwd: Personalizing a PDF generated with ConTeXt

2011-03-05 Thread Cecil Westerhof
2011/3/5 Wolfgang Schuster schuster.wolfg...@googlemail.com

 \setvariables and \getvariables sounds like the most general solution


 in that case.

 For example, you could put the various \setvariables statements in various
 separate files and load a specific one from the context command line with
 --environment=...


 I tried it and it works. Only one thing: when the variables are not set
 (forgot the environment parameter, file not correctly set, ...) I would like
 to set default values. How would I do that?


 %\enablemode[variables]

 \startmode[variables]
 \setvariables
   [test]
   [one=One,
two=Two]
 \stopmode

 \starttext
 \doifelsevariable{test}{one}{1: \getvariable{test}{one}}{??}\par
 \doifelsevariable{test}{two}{2: \getvariable{test}{two}}{??}
 \stoptext


Works. I use:
\doifelsevariable{personalise}{completeName}{}{
  \setvariables[personalise][
completeName=Cecil Westerhof,
.
.
.
  ]
}

-- 
Cecil Westerhof
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@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
___