Hi list,

some time ago I posted on this list about problems with MetaObj in ConTeXt when using labels. There's a wiki article about this now [1]. Just recently I was forced to notice that this solution does not work when the label to be drawn is part of the object definition. So the example from [1] works fine with the added boolean flag, but the following example (which means basically all built-in MetaObj objects with text) does not. It compiles well but there is no text.

--8<--------------------start--------------------8<--
\startMPinclusions[+]
        input metaobj;
        boolean firstrun; firstrun := true;
\stopMPinclusions

\startMPpage
        if firstrun:
                newBox.a(\sometxt{Text});
                a.c = origin;
        fi;
        drawObj(a);
        firstrun := false;
\stopMPpage
-->8--------------------stop-------------------->8--

I'm out of ideas how to fix this. I tried putting the text into a separate pictrue variable and use this in "newBox". In addition, I thought it should be possible to modify metaobj.mp to check for a boolean variable (e.g. "firstrun") and let the macros there react to its value accordingly , but I always got either no text or errors.

I can draw the picture I wanted to get in the first place with plain MetaFun, but I thought MetaObj would be even more "fun". Now I'm very curious if someone on this list can come up with something. I think it would be great if MetaObj could be fully used within ConTeXt.

Thanks in advance for taking the time to think about this and any hints!
Kind regards,
Stefan.


[1] http://wiki.contextgarden.net/MetaObj_and_Labels
___________________________________________________________________________________
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
___________________________________________________________________________________

Reply via email to