Hi, I uploaded a new lmtx version. This time a new mechanism. ----------------------------- From an upcoming details chapter: ----------------------------- The mechanism described here is still experimental. Although it could be implemented in \MKIV\ it is only available in \LMTX. Already early in \MKII\ we had a positioning mechanism available. At that time we had \DVI\ output and specials were used to track positions. A script calculated the positions that were then fed back into the second run. Later Taco wrote \DVIPOS\ which sped up the analysis between runs. When \PDFTEX\ showed, an equivalent positioning mechanism was added there. In \MKIV\ positioning support was optimized a bit as part of the upgrading process but the principles remained the same. The interface to positioning comes with a lot of commands and many of them relate to what we want to do with \METAFUN. The alternative interface discussed here is a bit simpler and has (at least now) less commands and, combined with local name spaces, can be easier to use in more local situations. It's also integrated in the frequently used \type {\framed} commands and has basic support at the \METAFUN\ end. The performance is comparable to the regular positioning mechanisms but especially at the \METAPOST\ end has less overhead. ----------------------------- Here are some examples: ----------------------------- \framed [synchronize=yes,align=normal] {% test test test 1 \sync{one}{1}test test 2 \crlf test test 1 \sync{one}{1}test test test 2 \crlf test 1 \sync{one}{1}test 2 \crlf test test test test 1 \sync{one}{1}test test 2 } \framed [synchronize=yes,align=normal] {% one one \sync{a}{1}two \sync{a}{2}three \crlf one one \sync{a}{1}two two \sync{a}{2}three \crlf one \sync{a}{1}two \sync{a}{2}three \crlf one one one \sync{a}{1}two \sync{a}{2}three } \framed [synchronize=yes,align=normal] {% \syncanchor{one}{1}{1}A \syncanchor{one}{2}{1}BBB \syncanchor{one}{3}{1}C \crlf \syncanchor{one}{1}{2}AA \syncanchor{one}{3}{2}C \crlf \syncanchor{one}{1}{3}AAA \syncanchor{one}{2}{3}BB \syncanchor{one}{3}{3}C } \framed [synchronize=yes,align=normal] {% \alignanchor{one}{1}{1}{l}A \alignanchor{one}{1}{2}{m}AA \alignanchor{one}{1}{3}{r}AAA \syncanchor {one}{1}{4}\crlf \alignanchor{one}{2}{1}{right}B \alignanchor{one}{2}{2}{middle}BB \alignanchor{one}{2}{3}{left}BBB \syncanchor {one}{2}{4} } \startuseMPgraphic{whatever-1} fill OverlayBox withcolor "lightgray" ; drawdot anchorxy("one", 0, 1) withpen pencircle scaled 1mm withcolor "red" ; drawdot anchorxy("one", 0, 2) withpen pencircle scaled 1mm withcolor "red" ; drawdot anchorxy("two", 0, 1) withpen pencircle scaled 1mm withcolor "red" ; drawdot anchorxy("two", 0, 2) withpen pencircle scaled 1mm withcolor "red" ; drawdot anchorxy("three", 0, 1) withpen pencircle scaled 1mm withcolor "red" ; setbounds currentpicture to OverlayBox ; \stopuseMPgraphic \startuseMPgraphic{whatever-2} pair a ; a := anchorxy("one", 0, 1) ; pair b ; b := anchorxy("one", 0, 2) ; drawarrow anchorxy("one", 0, 1) { right } .. anchorxy("one", 0, 2) withcolor "blue" withtransparency (1,.75) ; drawarrow anchorxy("two", 0, 1) { down } .. anchorxy("two", 0, 2) withcolor "blue" withtransparency (1,.75) ; drawarrow anchorxy("two", 0, 1) { dir 30 } .. anchorxy("three", 0, 1) withcolor "blue" withtransparency (1,.75) ; setbounds currentpicture to OverlayBox ; \stopuseMPgraphic \defineoverlay[whatever-1][\useMPgraphic{whatever-1}] \defineoverlay[whatever-2][\useMPgraphic{whatever-2}] \framed [synchronize=yes, align=normal, offset=10pt, frame=off, background={whatever-1,foreground,whatever-2}] {% \markanchor{two}{0}{1}{\red\bf foo}% \markanchor{one}{0}{1} bar rab oof\crlf foo bar rab oof\crlf oof rab bar foo\crlf oof rab \markanchor{two}{0}{2}{\red\bf bar}% \markanchor{one}{0}{2} foo% \markanchor{three}{0}{1}% } \framed [synchronize=yes, align=normal, offset=10pt, frame=off, background={whatever-1,foreground,whatever-2}] {% one one one \syncanchor{a}{1}{1}two two two \syncanchor{a}{2}{1}three three\par one \syncanchor{a}{1}{2}two \syncanchor{a}{2}{2}three\par one \syncanchor{a}{1}{3}two \syncanchor{a}{2}{3}three\par \blank \markanchor{two}{0}{1}{\red\bf foo}% \markanchor{one}{0}{1} bar rab oof\crlf foo bar rab oof\crlf oof rab bar foo\crlf oof rab \markanchor{two}{0}{2}{\red\bf bar}% \markanchor{one}{0}{2} foo% \markanchor{three}{0}{1}% \blank one one \syncanchor{a}{1}{4}two two \syncanchor{a}{2}{4}three\par one one \syncanchor{a}{1}{5}two two \syncanchor{a}{2}{5}three three% \markanchor{three}{0}{1}% } \framed[synchronize=yes,align=normal]{% one one \sync{a}{1}two \sync{a}{2}three\par one one \sync{a}{1}two two \sync{a}{2}three\par \blank tst tst \sync{b}{1}tst \sync{b}{2}tst\par tst \sync{b}{1}tst tst \sync{b}{2}tst\par \blank one \sync{a}{1}two \sync{a}{2}three } \page \startpacked $a = b + c $\par $b = c + d $\par $c = e + f $\par \stoppacked \startpacked \startsynchronizing $a \syncanchor{one}{1}{1}= b \syncanchor{one}{2}{1}+ c$\par $b \syncanchor{one}{1}{2}= c \syncanchor{one}{2}{2}+ d$\par $c \syncanchor{one}{1}{3}= e \syncanchor{one}{2}{3}+ f$\par \stopsynchronizing \stoppacked \startpacked \startsynchronizing $a \sync{one}{1}= b \sync{one}{2}+ c$\par $b \sync{one}{1}= c \sync{one}{2}+ d$\par $c \sync{one}{1}= e \sync{one}{2}+ f$\par \stopsynchronizing \stoppacked \startpacked \startsynchronizing $a \mathsync{1}= b \mathsync{2}+ c$\par $b \mathsync{1}= c \mathsync{2}+ d$\par $ \mordsync{1}= e \mathsync{2}+ f$\par \stopsynchronizing \stoppacked ----------------------------- remark ----------------------------- So, it's a varaant on the positioning mechanism. It also works in framed when the synchronization option is enabled. Don't enable that when not used (as there is some overhead involved). I have no clue how useful it is but users always find a way to use mechanisms. One can do really freaky things with it. Who knows what gets added over time. Also, it doesn't replace the existing positioning mechanism which served us well for decades; it's just a lightweight variant with different pros and cons. Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------