problem with initialize_box in mkIV
![](https://secure.gravatar.com/avatar/6861f93d3be1be3b13e6ab3881020c94.jpg?s=120&d=mm&r=g)
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. Any help will be much appreciated. AG. Here is the entire output when compiling: $ context essai.tex mtx-context | run 1: luatex --fmt="/var/lib/texmf/luatex-cache/context/f919750633122078d706dd10f1cfd39b/formats/cont-en" --lua="/var/lib/texmf/luatex-cache/context/f919750633122078d706dd10f1cfd39b/formats/cont-en.lui" --backend="pdf" "./essai" \stoptext This is LuaTeX, Version beta-0.70.2-2012070300 (TeX Live 2012/Debian) \write18 enabled. (essai.tex ConTeXt ver: 2012.05.30 11:26 MKIV fmt: 2012.10.14 int: english/english system > cont-new.mkiv loaded (/usr/share/texmf/tex/context/base/cont-new.mkiv system > beware: some patches loaded from cont-new.mkiv ) system > essai.top loaded (essai.top) fonts > latin modern fonts are not preloaded languages > language en is active {/usr/share/texmf/fonts/map/pdftex/context/mkiv-base.map} fonts > preloading latin modern fonts (second stage) fonts > typescripts > unknown: library 'loc' {/usr/share/texmf/fonts/map/dvips/lm/lm-math.map}{/usr/share/texmf/fonts/map/dvips/lm/lm-rm.map} fonts > defining > forced type afm of stmary10 not found fonts > defining > font with asked name 'stmary10' is not found using lookup 'file' fonts > virtual math > loading font LMMath7-Regular subfont 9 with name stmary10.afm at 458752 is skipped, not found fonts > defining > forced type afm of stmary10 not found fonts > defining > font with asked name 'stmary10' is not found using lookup 'file' fonts > virtual math > loading font LMMath9-Regular subfont 9 with name stmary10.afm at 589824 is skipped, not found fonts > defining > forced type afm of stmary10 not found fonts > defining > font with asked name 'stmary10' is not found using lookup 'file' fonts > virtual math > loading font LMMath12-Regular subfont 9 with name stmary10.afm at 786432 is skipped, not found fonts > fallback modern rm 12pt is loaded metapost > initializing instance 'metafun' using format 'metafun' metapost > loading 'metafun': /usr/share/texmf/metapost/context/base/metafun.mpiv ! terminal: >> initialize_box ! Isolated expression. <to be read again> ( <*> initialize_box( 1,97.95276pt,705.01845pt,25.14001pt,8.32800pt,0.12000pt)... ! Extra tokens will be flushed. <to be read again> ( <*> initialize_box( 1,97.95276pt,705.01845pt,25.14001pt,8.32800pt,0.12000pt)...
llxy ! Improper `addto'. <to be read again> withpen draw->...:also(EXPR0)else:doublepath(EXPR0)withpen .currentpen.fi._op_ <to be read again> { --->{ curl1}..{curl1} <*> ...5.14001pt,8.32800pt,0.12000pt); draw llxy--
lrxy--urxy--ulxy--cycle; ; ! Extra tokens will be flushed. <to be read again> { --->{ curl1}..{curl1} <*> ...5.14001pt,8.32800pt,0.12000pt); draw llxy-- lrxy--urxy--ulxy--cycle; ; . system > tex > error on line 1 in file essai.tex: terminal: >> initialize_box ! Isolated expression. <to be read again> ( <*> initialize_box( 1,97.95276pt,705.01845pt,25.14001pt,8.32800pt,0.12000pt)... ! Extra tokens will be flushed. <to be read again> ( <*> initialize_box( 1,97.95276pt,705.01845pt,25.14001pt,8.32800pt,0.12000pt)...
llxy ! Improper `addto'. <to be read again> withpen draw->...:also(EXPR0)else:doublepath(EXPR0)withpen .currentpen.fi._op_ <to be read again> { --->{ curl1}..{curl1} <*> ...5.14001pt,8.32800pt,0.12000pt); draw llxy--
lrxy--urxy--ulxy--cycle; ; ! Extra tokens will be flushed. <to be read again> { --->{ curl1}..{curl1} <*> ...5.14001pt,8.32800pt,0.12000pt); draw llxy-- lrxy--urxy--ulxy--cycle; ; ... 1 >> \defineoverlay[frames][\positionoverlay{frames}] 2 \setupbackgrounds[page][background=frames] 3 4 \startMPpositiongraphic{frame} 5 initialize_box(\MPpos{\MPvar{self}}); 6 draw llxy--lrxy--urxy--ulxy--cycle; 7 \stopMPpositiongraphic 8 9 \startpositionoverlay{frames} 10 \setMPpositiongraphic{one}{frame} 11 \setMPpositiongraphic{two}{frame} <inserted text> ...lable:=true; ;;;;]===], false)} \meta_process_graphic ...!!es , \MPaskedfigure )}} \egroup \placeMPgraphic \m... \anch_positions_meta_graphic_use ...#3\stopMPcode \endgroup \anch_positions_meta_graphic_direct_indeed ...ame \removelastspace }\smashbo... \dohandleMPpositiongraphic ...tiongraphic {#2}{#3} \fi \308>frames::mpa ...positiongraphic {one}{frame}{} \dohandleMPpositiongraphic... ... l.16 \stoptext ? ^Cmetapost > error: unknown, no error, terminal or log messages ! terminal: [1] . system > tex > error on line 1 in file essai.tex: terminal: [1] ... 1 >> \defineoverlay[frames][\positionoverlay {frames}] 2 \setupbackgrounds[page][background=frames] 3 4 \startMPpositiongraphic{frame} 5 initialize_box(\MPpos{\MPvar{self}}); 6 draw llxy--lrxy--urxy--ulxy--cycle; 7 \stopMPpositiongraphic 8 9 \startpositionoverlay{frames} 10 \setMPpositiongraphic{one}{frame} 11 \setMPpositiongraphic{two}{frame} <inserted text> alexandre@knuth:~/ENSEIGNEMENT/12/TSTI$ ...lable:=true; ;;;;]===], false)} \meta_process_graphic ...!!es , \MPaskedfigure )}} \egroup \placeMPgraphic \m... \anch_positions_meta_graphic_use ...#3\stopMPcode \endgroup \anch_positions_meta_graphic_direct_indeed ...ame \removelastspace }\smashbo... \dohandleMPpositiongraphic ...tiongraphic {#2}{#3} \fi \308>frames::mpa ...positiongraphic {one}{frame}{} \dohandleMPpositiongraphic... ... l.16 \stoptext ? ! Emergency stop. system > tex > error on line 1 in file essai.tex: Emergency stop ... 1 >> \defineoverlay[frames][\positionoverlay{frames}] 2 \setupbackgrounds[page][background=frames] 3 4 \startMPpositiongraphic{frame} 5 initialize_box(\MPpos{\MPvar{self}}); 6 draw llxy--lrxy--urxy--ulxy--cycle; 7 \stopMPpositiongraphic 8 9 \startpositionoverlay{frames} 10 \setMPpositiongraphic{one}{frame} 11 \setMPpositiongraphic{two}{frame} <inserted text> ...lable:=true; ;;;;]===], false)} \meta_process_graphic ...!!es , \MPaskedfigure )}} \egroup \placeMPgraphic \m... \anch_positions_meta_graphic_use ...#3\stopMPcode \endgroup \anch_positions_meta_graphic_direct_indeed ...ame \removelastspace }\smashbo... \dohandleMPpositiongraphic ...tiongraphic {#2}{#3} \fi \308>frames::mpa ...positiongraphic {one}{frame}{} \dohandleMPpositiongraphic... ... l.16 \stoptext ! ==> Fatal error occurred, no output PDF file produced!
![](https://secure.gravatar.com/avatar/49e63acb01f2ca80efce7eed08310ce8.jpg?s=120&d=mm&r=g)
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 -----------------------------------------------------------------
participants (2)
-
Alexandre Gerussi
-
Hans Hagen