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. Greetings, Peter
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? 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 -----------------------------------------------------------------
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@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Taco Hoekwater wrote:
Hi Peter,
Peter Rolf wrote:
If someone can solve this problem I would be very glad.
Adding a semicolon after the 'endgroup' command removes the error.
(I just looked at your pdf document). You probably want 'useMPgraphic' instead of 'uniqueMPgraphic'. Taco
Taco Hoekwater wrote:
Taco Hoekwater wrote:
Hi Peter,
Peter Rolf wrote:
If someone can solve this problem I would be very glad.
Adding a semicolon after the 'endgroup' command removes the error.
_Thank you very much, Taco!_ I have spent several hours to fix this MP error, without any success. The resulting docs looked ok, but if you have 50 or more MP graphics, you can't hit 'q' every time. BTW: Why do I need a semicolon after 'endgroup', but (in most cases) not after 'fi', 'endfor'?
(I just looked at your pdf document).
You probably want 'useMPgraphic' instead of 'uniqueMPgraphic'.
I'm not sure what you mean. Using 'useMPgraphic' to load all kind of MP graphics? I must try the latest beta... :) Peter
Taco _______________________________________________ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Peter Rolf wrote:
BTW: Why do I need a semicolon after 'endgroup', but (in most cases) not after 'fi', 'endfor'?
You need a semicolon at the end of a statement. The <if> and <loop> constructs are not statements, they are preprocessed. You get the 'extra tokens' error when Metapost sees something like endgroup a:=1; because it knows that 'endgroup' can only be a statement on its own.
(I just looked at your pdf document).
You probably want 'useMPgraphic' instead of 'uniqueMPgraphic'.
I'm not sure what you mean. Using 'useMPgraphic' to load all kind of MP graphics?
You have to use \startuseMPgraphic and \useMPgraphic instead of \startuniqueMPgraphic, otherwise the output of both images will be identical. Cheers, Taco
Taco Hoekwater wrote:
Peter Rolf wrote:
BTW: Why do I need a semicolon after 'endgroup', but (in most cases) not after 'fi', 'endfor'?
You need a semicolon at the end of a statement. The <if> and <loop> constructs are not statements, they are preprocessed.
You get the 'extra tokens' error when Metapost sees something like
endgroup a:=1;
because it knows that 'endgroup' can only be a statement on its own.
I see. A day of insight :)
(I just looked at your pdf document).
You probably want 'useMPgraphic' instead of 'uniqueMPgraphic'.
I'm not sure what you mean. Using 'useMPgraphic' to load all kind of MP graphics?
You have to use \startuseMPgraphic and \useMPgraphic instead of \startuniqueMPgraphic, otherwise the output of both images will be identical.
Again stupid me. If the size of the overlay does not change, the graphic does not. So this was a 'bad' example (but now the beta runs like a charm). Thanks Taco. Greetings, Peter
Cheers, Taco _______________________________________________ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Taco Hoekwater wrote:
Taco Hoekwater wrote:
Hi Peter,
Peter Rolf wrote:
If someone can solve this problem I would be very glad.
Adding a semicolon after the 'endgroup' command removes the error.
(I just looked at your pdf document).
You probably want 'useMPgraphic' instead of 'uniqueMPgraphic'.
Taco _______________________________________________ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
The following code works here, but not at context live. What have I done
now? ;)
Peter
TeXExec 5.4.3 - ConTeXt / PRAGMA ADE 1997-2005
texexec : TeXExec 5.4.3 - ConTeXt / PRAGMA ADE 1997-2005
texutil : TeXUtil 9.0.1 - ConTeXt / PRAGMA ADE 1992-2006
tex : pdfTeX, 3.141592-1.40.0-beta-20060213 (Web2C 7.5.5)
context : ver: 2006.08.02 23:31
cont-en : ver: 2006.08.02 23:31 fmt: 2006.8.4 mes: en
% interface=en output=pdftex
% Time-stamp:
Hi Peter and "Author of Live.contextgarden.net", Peter Rolf wrote:
The following code works here, but not at context live. What have I done now? ;)
Not something you did ;-) Your first comment line is confusing the Live setup. This extremely minimal example fails as well: % interface=en output=pdftex \starttext Hello \stoptext Cheers, Taco
Hi Taco (debugging grandmaster), Taco Hoekwater wrote:
Hi Peter and "Author of Live.contextgarden.net",
:) I have a real special ConTeXt installation (85MB in a ramdisk; eshell), so live.contextgarden.net is a good place to check code on a more 'normal' platform. Using context live I can simply see if it's my problem (most too often) or a general one. Thanks again and also to Patrick for this really nice feature. Greetings, Peter
Peter Rolf wrote:
The following code works here, but not at context live. What have I done now? ;)
Not something you did ;-)
Your first comment line is confusing the Live setup. This extremely minimal example fails as well:
% interface=en output=pdftex \starttext Hello \stoptext
Cheers, Taco _______________________________________________ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Hi Taco,
Taco Hoekwater
Hi Peter and "Author of Live.contextgarden.net",
Peter Rolf wrote:
The following code works here, but not at context live. What have I done now? ;)
Not something you did ;-)
Your first comment line is confusing the Live setup. This extremely minimal example fails as well:
% interface=en output=pdftex \starttext Hello \stoptext
Hmm, I can't see anything wrong at live.contextgarden.net with the simple code. Should live ignore the % comment line? Patrick -- ConTeXt wiki and more: http://contextgarden.net
participants (4)
-
Hans Hagen
-
Patrick Gundlach
-
Peter Rolf
-
Taco Hoekwater