[NTG-context] TeX trigger in MP macro

Peter Rolf indiego at gmx.net
Fri Aug 4 12:57:53 CEST 2006


Hans Hagen wrote:
> Peter Rolf wrote:
>> Hi all,
>>
>> Currently I am using
>>
>> \startuniqueMPgraphic{foo}
>>   ...
>>   if (\DbgFill=0) :
>>     fill whatever
>>   fi
>>   ...
>> \stopuniqueMPgraphic
>>
>> in my MP graphics. \DbgFill (0|1) is just a trigger, which prevents
>> filling in case of visual debugging. Instead of always writing this
>> 'long' form, it should be possible to use a self written mp-macro
>> instead. But my naive approach
>>
>> def dbg_fill (expr p) =
>>   if (\DbgFill=0) :
>>     fill p ;
>>   fi
>> enddef ;
>>
>> doesn't work. I get
>>
>>   
>>>> DbgFill
>>>>       
>> ! Unknown relation will be considered false.
>>
>>
>> How do I realize this trigger inside pure MP code and set it outside in
>> TeX? The trigger should be global and can change during runtime. Any
>> help is welcome.
>>   
> can you make a test file? 
>
I tried and my example code works at the beginning. After some changes
things run wild (only possible in TeX ;) ). Not even the 'long' form
worked any more.

So I went to contextlive and copied the simple test file. To my
astonishment it didn't work either. But more important, the log file
shows the same MetaPost error message I get, since ConTeXt swapped to
ruby (preventing me from updating). Testfile and context live log (html)
are attached.
If someone can solve this problem I would be very glad.

Greetings, Peter


> Hans 
> 
> -----------------------------------------------------------------
>                                           Hans Hagen | PRAGMA ADE
>               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>      tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
>                                              | www.pragma-pod.nl
> -----------------------------------------------------------------
> 
> _______________________________________________
> ntg-context mailing list
> ntg-context at ntg.nl
> http://www.ntg.nl/mailman/listinfo/ntg-context
> 
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.zip
Type: application/x-zip-compressed
Size: 3085 bytes
Desc: not available
Url : http://www.ntg.nl/pipermail/ntg-context/attachments/20060804/062ef710/attachment.zip 


More information about the ntg-context mailing list