On 3/5/2013 11:21 AM, Alexandre Gerussi wrote:
Hi there,
i'm having problems with metapost and positional graphics in mkIV. Here is a small test file that compiles OK with texexec but fails to compile with context:
% the beginning \defineoverlay[frames][\positionoverlay{frames}] \setupbackgrounds[page][background=frames]
\startMPpositiongraphic{frame} initialize_box(\MPpos{\MPvar{self}}); draw llxy--lrxy--urxy--ulxy--cycle; \stopMPpositiongraphic
\startpositionoverlay{frames} \setMPpositiongraphic{one}{frame} \setMPpositiongraphic{two}{frame} \stoppositionoverlay
\starttext This \hpos{one}{word} should be \hpos{two}{framed}. \stoptext % the end
My system is a Debian Testing, but I don't believe that it is related to the distribution, as this example also fails in the context online compiler @ http://live.contextgarden.net/
The problem seems located around the initialize_box macro.
The whole positioning mechanism has been overhauled last year (columns, regions, floats, the whole lot should be able to deal with it). \defineoverlay[frames][\positionoverlay{frames}] \setupbackgrounds[text][background=frames] \startMPpositiongraphic{frame} if unknown context_apos : input mp-apos.mpiv ; fi ; \MPgetposboxes{\MPvar{self}}{\MPanchorid} if nofposboxes = 1 : draw posboxes[1] ; fi ; \stopMPpositiongraphic \startpositionoverlay{frames} \setMPpositiongraphic{one}{frame} \setMPpositiongraphic{two}{frame} \stoppositionoverlay \starttext This \hpos{one}{word} should be \hpos{two}{framed}. \stoptext At some point the mp modules will be preloaded. Watch the used layer: text instead of page. At the end of anch-bck.mkiv you can find some more. Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------