ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <j.hagen@xs4all.nl>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: new upload
Date: Mon, 31 May 2021 14:30:27 +0200	[thread overview]
Message-ID: <07c591cb-97f4-bdb1-d246-e3c79cf0b4b4@xs4all.nl> (raw)

[-- Attachment #1: Type: text/plain, Size: 7246 bytes --]

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
-----------------------------------------------------------------

[-- Attachment #2: todo-localanchors.pdf --]
[-- Type: application/pdf, Size: 44819 bytes --]

[-- Attachment #3: Type: text/plain, Size: 493 bytes --]

___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

             reply	other threads:[~2021-05-31 12:30 UTC|newest]

Thread overview: 205+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-31 12:30 Hans Hagen [this message]
2021-05-31 16:50 ` Aditya Mahajan
2021-05-31 17:12   ` Hans Hagen
2021-05-31 17:48   ` Hans Hagen
2021-05-31 19:04     ` Aditya Mahajan
2021-06-01 15:17       ` Hans Hagen
  -- strict thread matches above, loose matches on Subject: below --
2023-07-09 17:51 Hans Hagen via ntg-context
2023-07-10  8:43 ` denis.maier
2023-07-10  9:53   ` Hans Hagen
2023-07-10 15:51 ` Rik Kabel
2023-07-10 16:13   ` Hans Hagen
2022-12-27 17:04 Hans Hagen via ntg-context
2022-12-27 17:27 ` Floris van Manen via ntg-context
2022-12-27 17:34 ` Floris van Manen via ntg-context
2022-12-27 17:44 ` Pablo Rodriguez via ntg-context
2022-12-27 20:13   ` Hans Hagen via ntg-context
2022-12-27 22:00     ` Pablo Rodriguez via ntg-context
2022-12-27 22:32       ` Hans Hagen via ntg-context
2022-12-27 23:06         ` Floris van Manen via ntg-context
2022-11-14 22:02 Hans Hagen via ntg-context
2022-11-15 14:47 ` Pablo Rodriguez via ntg-context
2022-10-14  8:21 Hans Hagen via ntg-context
2022-10-14 14:14 ` Pablo Rodriguez via ntg-context
2022-10-14 14:29   ` Alan Braslau via ntg-context
2022-10-15  7:41   ` Hans Hagen via ntg-context
2022-10-15  8:48     ` Pablo Rodriguez via ntg-context
2022-10-15  9:28       ` Hans Hagen via ntg-context
2022-10-17 17:12         ` Pablo Rodriguez via ntg-context
2022-10-17 20:40           ` Hans Hagen via ntg-context
2022-10-18 15:40             ` Pablo Rodriguez via ntg-context
2022-10-19  1:39               ` Alan Braslau via ntg-context
2022-10-16 16:07 ` Aditya Mahajan via ntg-context
2022-10-16 17:03   ` Mikael Sundqvist via ntg-context
2022-10-17  1:38     ` Aditya Mahajan via ntg-context
2022-10-17  8:03       ` Hans Hagen via ntg-context
2022-10-17 16:41         ` Aditya Mahajan via ntg-context
2022-10-17  6:43     ` Otared Kavian via ntg-context
2022-10-17  7:36       ` Mikael Sundqvist via ntg-context
2022-10-17  7:46       ` Hans Hagen via ntg-context
2022-04-19 18:23 Hans Hagen via ntg-context
2022-04-19 19:18 ` Jeong Dal via ntg-context
2022-04-19 22:24   ` Jeong Dal via ntg-context
2022-04-20  1:47 ` śrīrāma via ntg-context
2022-04-20  8:49   ` Hans Hagen via ntg-context
2022-04-21 14:54     ` Alexandre Christe via ntg-context
2022-04-23 11:46       ` śrīrāma via ntg-context
2022-04-15 18:24 Hans Hagen via ntg-context
2022-04-16  8:37 ` Pablo Rodriguez via ntg-context
2022-03-11 23:16 Hans Hagen via ntg-context
2022-03-12 16:24 ` Henning Hraban Ramm via ntg-context
2022-03-13 18:58 ` Rik Kabel via ntg-context
2022-03-14  8:01   ` Hans Hagen via ntg-context
2022-03-14 10:34     ` Mikael Sundqvist via ntg-context
2022-03-14 14:05     ` Rik Kabel via ntg-context
2022-03-14 15:02       ` Hans Hagen via ntg-context
2022-03-15  8:53 ` śrīrāma via ntg-context
2022-03-15  9:53   ` Hans Hagen via ntg-context
2022-01-21 19:28 Hans Hagen via ntg-context
2022-01-21 20:11 ` Henning Hraban Ramm via ntg-context
2022-01-22 10:28   ` Hans Hagen via ntg-context
2022-01-22  6:06 ` Aditya Mahajan via ntg-context
2022-01-22  7:21   ` kauśika via ntg-context
2022-01-22  7:37     ` Richard Mahoney via ntg-context
2022-01-22  7:59       ` kauśika via ntg-context
2022-01-22 10:21     ` Hans Hagen via ntg-context
2022-01-22 10:25   ` Hans Hagen via ntg-context
2022-01-22 10:38     ` kauśika via ntg-context
2022-01-23  7:58       ` hanneder--- via ntg-context
2022-01-23  8:26         ` kauśika via ntg-context
2022-01-22 12:31 ` kauśika via ntg-context
2022-01-22 20:04   ` Richard Mahoney via ntg-context
2022-01-27 18:09     ` hanneder--- via ntg-context
2022-01-27 18:29       ` Hans Hagen via ntg-context
2022-01-27 18:35       ` Aditya Mahajan via ntg-context
2022-01-27 18:45         ` Hans Hagen via ntg-context
2022-01-28 12:56           ` Aditya Mahajan via ntg-context
2022-01-28 12:28         ` hanneder--- via ntg-context
2022-01-28 12:58           ` Aditya Mahajan via ntg-context
2022-01-23 22:25   ` Arthur Rosendahl via ntg-context
2022-01-24  3:42     ` śrīrāma via ntg-context
2022-01-24 21:33       ` Arthur Rosendahl via ntg-context
2022-01-15 10:54 Hans Hagen via ntg-context
2022-01-15 11:33 ` hanneder--- via ntg-context
2022-01-15 12:30   ` Hans Hagen via ntg-context
2022-01-15 14:52     ` Alexandre Christe via ntg-context
2022-01-15 15:14       ` Hans Hagen via ntg-context
2022-01-15 15:16         ` Fabrice Couvreur via ntg-context
2022-01-15 16:26           ` Hans Hagen via ntg-context
2022-01-15 16:45       ` Hans Hagen via ntg-context
2021-11-30 18:55 Hans Hagen via ntg-context
2021-12-01  8:49 ` Denis Maier via ntg-context
2021-12-01  9:07   ` Hans Hagen via ntg-context
2021-11-13 20:19 Hans Hagen via ntg-context
2021-11-16 13:29 ` Otared Kavian via ntg-context
2021-11-05 15:43 Hans Hagen via ntg-context
2021-11-02  9:43 Hans Hagen via ntg-context
2021-11-02 16:58 ` Rik Kabel via ntg-context
2021-11-02 17:56   ` Hans Hagen via ntg-context
2021-11-02 18:02   ` Luis Montgomery via ntg-context
2021-11-02 18:33     ` Hans Hagen via ntg-context
2021-10-13 15:34 Hans Hagen via ntg-context
2021-10-13 20:37 ` jbf via ntg-context
2021-10-14  6:50   ` Hans Hagen via ntg-context
2021-08-30 14:30 Hans Hagen via ntg-context
2021-08-30 16:15 ` mf via ntg-context
2021-08-30 16:41   ` Pablo Rodriguez via ntg-context
2021-08-30 17:27 ` Rik Kabel via ntg-context
2021-08-30 18:01   ` Hans Hagen via ntg-context
2021-08-31  9:19     ` mf via ntg-context
     [not found] <00DA928D-3C91-469A-B1C8-16C505565C4D@scorecrow.com>
     [not found] ` <aef36bc1-e6e3-cf0e-5f4a-ff0fe5fa4fc3@xs4all.nl>
     [not found]   ` <F4B07195-C31B-4C15-8578-81CE628F152E@scorecrow.com>
2021-08-24 21:12     ` Hans Hagen via ntg-context
2021-08-07 21:00 Hans Hagen via ntg-context
2021-08-08  0:50 ` Aditya Mahajan via ntg-context
2021-08-08  7:22   ` Hans Hagen via ntg-context
2021-06-13 17:31 Hans Hagen
2021-06-14 15:13 ` Pablo Rodriguez
2021-06-14 15:22   ` Hans Hagen
2021-06-14 16:01     ` Pablo Rodriguez
2021-06-04 15:46 Hans Hagen
2021-06-04 16:18 ` Pablo Rodriguez
2021-06-04 17:43   ` Hans Hagen
2021-06-04 17:54     ` Pablo Rodriguez
2021-05-25 16:20 Hans Hagen
2021-05-26 17:17 ` Pablo Rodriguez
2021-05-26 18:09   ` Hans Hagen
2021-05-27 10:17 ` mf
2021-05-27 12:10   ` Hans Hagen
2021-05-05 17:43 Hans Hagen
2021-04-09 18:19 Hans Hagen
2021-03-31 16:15 Hans Hagen
2021-02-12 17:56 Hans Hagen
2021-01-08 11:00 Hans Hagen
2020-12-01 17:13 Hans Hagen
2020-11-24 19:07 Hans Hagen
2020-11-25  9:12 ` Giulio Bertellini
2020-11-25 11:26   ` Hans Hagen
2020-11-26 15:26 ` Keith McKay
2020-11-26 16:00   ` Hans Hagen
2020-11-26 16:10     ` luigi scarso
2020-11-26 17:00       ` Hans Hagen
2020-11-26 17:07         ` luigi scarso
2020-11-26 17:10           ` Hans Hagen
2020-11-26 19:08             ` luigi scarso
2020-11-26 18:43   ` Mojca Miklavec
2020-11-26 18:59     ` Wolfgang Schuster
2020-11-26 20:00     ` Keith McKay
2020-11-26 20:01     ` Bruce Horrocks
2020-11-19 17:58 Damien Thiriet
2020-11-19 10:35 Hans Hagen
2020-11-19 11:00 ` mf
2020-11-19 11:04   ` mf
2020-11-19 15:28 ` Otared Kavian
2020-11-19 15:43 ` Pablo Rodriguez
2020-11-18 18:42 Hans Hagen
2020-11-18 21:05 ` Pablo Rodriguez
2020-11-18 21:21   ` Wolfgang Schuster
2020-11-18 23:07     ` Hans Hagen
     [not found] <mailman.506.1604696616.1206.ntg-context@ntg.nl>
2020-11-07  9:42 ` Ivan Pešić
2020-11-07  9:42 ` Ivan Pešić
2020-11-06 19:42 Hans Hagen
2020-11-06 21:03 ` Pablo Rodriguez
2020-11-06 21:58   ` Rik Kabel
2020-11-06 23:02   ` mf
2020-11-06 23:12     ` Pablo Rodriguez
2020-11-06 23:39       ` Floris van Manen
2020-11-07  9:48       ` Otared Kavian
2020-11-07 10:05         ` Pablo Rodriguez
2020-11-07 10:40           ` Floris van Manen
2020-11-07 11:53             ` Pablo Rodriguez
2020-11-07 12:11               ` Pablo Rodriguez
2020-11-07 13:31                 ` Floris van Manen
2020-11-07 18:28                 ` Floris van Manen
2020-11-07 11:19         ` Hans Hagen
2020-11-07 11:47           ` Floris van Manen
2020-08-31 20:21 Hans Hagen
2020-09-01  0:50 ` Jairo A. del Rio
2020-09-01 12:31   ` Hans Hagen
2020-08-09 18:08 Hans Hagen
2020-08-09 18:36 ` Pablo Rodriguez
2020-08-09 18:45   ` Jairo A. del Rio
2020-08-09 18:49     ` Jairo A. del Rio
2020-08-09 18:52     ` Pablo Rodriguez
2020-08-09 20:09       ` Hans Hagen
2020-08-09 20:29         ` Pablo Rodriguez
2007-08-26 19:58 Hans Hagen
2007-08-24 12:27 Hans Hagen
2007-08-24 16:18 ` Aditya Mahajan
2007-08-24 17:11   ` Hans Hagen
2007-08-25 13:15     ` Steffen Wolfrum
2007-08-26 14:01       ` Hans Hagen
2007-08-26 19:10         ` Steffen Wolfrum
2007-08-26 19:57           ` Hans Hagen
2007-08-24 18:22   ` Hans Hagen
2007-08-24 18:26     ` Aditya Mahajan
2007-08-25 19:21       ` Henning Hraban Ramm
     [not found]         ` <6faad9f00708251335l7c39ee37l2dcac65aaa0b59fa@mail.gmail.com>
     [not found]           ` <3AA6E745-C336-40CD-BC13-4676B9FB5C45@trichotomic.net>
2007-08-26 11:27             ` Henning Hraban Ramm
2007-08-26 14:00               ` Hans Hagen
2007-08-26 13:55         ` Hans Hagen
2007-08-27  9:06       ` Arthur Reutenauer
2007-08-27 14:10         ` Aditya Mahajan
2007-08-25 13:43 ` Mojca Miklavec
2007-08-27 18:28 ` Peter Münster
2007-08-27 18:34   ` Hans Hagen
2007-08-27 19:01     ` Mojca Miklavec
2007-08-27 21:57     ` Peter Münster
2007-08-27 20:48   ` Arthur Reutenauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=07c591cb-97f4-bdb1-d246-e3c79cf0b4b4@xs4all.nl \
    --to=j.hagen@xs4all.nl \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).