Thomas A. Schmitz wrote:
Peter, I appreciate your helping me. And I have no clue what's going wrong. On Oct 6, 2005, at 10:08 PM, Peter Rolf wrote:
I'm just guessing (taken from my own pile of mistakes). Hmm, is it a problem of setting the variable, or it's interpretation? Can you find out, if the variable is set correctly in your \setupcrop macro? Just add
\writestatus{[CROP]}{crop mark is: \getvariable{Crop}{mark}}%
For debugging, I've narrowed the module down to 8 lines:
\def\setupcrop{\setvariables[Crop]}
Is that all \setupcrop does? :) It's a bit hard for me to debug your code from parts, without seeing all. But anyway, here is the way I would handle such stuff. Not tested! ... % trigger for printing crop info \newconditional\CropInfo \def\SetupCrop{\dosingleempty\doSetupCrop} \def\doSetupCrop[#1]{% \iffirstargument \getrawparameters[CROP@][{mark=,info=},#1]% \processaction[\CROP@mark][ camera=>{\setvariables[Crop][mark=camera] \def\PageBackground{\CameraMarks}}, cross=>{\setvariables[Crop][mark=cross] \def\PageBackground{\CrossMarks}}, default=>{\setvariables[Crop][mark=] \def\PageBackground{}}, unknown=>{\setvariables[Crop][mark=] \def\PageBackground{}}]% % no need to store this into a variable \processaction[\CROP@info][ no=>\setfalse\CropInfo, default=>\settrue\CropInfo, unknown=>\settrue\CropInfo]% \else % \SetupCrop is called without parameters \setvariables[Crop][mark=] \setfalse\CropInfo \def\PageBackground{}% \fi % just to give the idea... \ifconditional\CropInfo \setlayer[markings][x=.5\paperwidth, y=20mm, location=c]% {\tt \txx "\jobname" - \currentdate [y,/,mm,/,dd]\ - \currenttime\ - \realfolio\ of \lastpage} % \else \fi % for debugging only \writestatus{[CROP]}{crop mark is: \getvariable{Crop}{mark}}% \writestatus{}{crop info is \ifconditional\CropInfo\ enabled\else\ disabled}% } \SetupCrop % initialisation (or \setups[namespace:reset]) ... I have no experience with the namespace mechanism Hans mentioned (will give it a try/ add it to the wiki). HTH, Peter
\setvariables[Crop][mark=cross,info=yes]
\processaction[\getvariable{Crop}{mark}][ camera =>\def\PageBackground{\CameraMarks}, cross =>\def\PageBackground{\CrossMarks}, default=>\def\PageBackground{}, unknown=>\def\PageBackground{}]%
\writestatus{[CROP]}{crop mark is: \getvariable{Crop}{mark}}
my testfile:
\usemodule[t-crop] \setupcrop[mark=camera,info=yes]
\starttext
Hello!
\stoptext
Output in log:
(/Users/tas/Library/texmf/tex/t-crop.tex [CROP] : crop mark is: cross
If second line of module is commented out, I get:
[CROP] : crop mark is:
So it's a problem of actually setting the variable.
The error can't hide forever ;)
Maybe it can't hide forever, but it looks like it can run...
Thanks for your help. I'll be away tomorrow and will try more on the weekend.
Best
Thomas _______________________________________________ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context