[NTG-context] lmtx update / teaser

Hans Hagen j.hagen at xs4all.nl
Mon Mar 1 15:44:26 CET 2021


Hi,

I uploaded a new lmtx. As I'm currently going through the metafun todo 
files I ended up at the fancy shape part (parshapes) running over 
multiple paragraphs and decided to provide a (kind of low level) 
interface that integrates that. The example code is a few decades old 
but still works ok (i might try to improve them a bit some day). Anyway, 
here is a teaser:

\starttext

\startuseMPgraphic{circle}
     lmt_parshape [
         path       = fullcircle scaled 136mm,
         offset     = 2mm,
         bottomskip = - 1.5LineHeight,
     ] ;
\stopuseMPgraphic

\start
\startshapedparagraph[list=circle,mp=circle,repeat=yes,method=cycle]%
     \setupalign[verytolerant,stretch,last]\dontcomplain
     {\darkred     \samplefile{tufte}}\par
     {\darkgreen   \samplefile{tufte}}\par
     {\darkblue    \samplefile{tufte}}\par
     {\darkcyan    \samplefile{tufte}}\par
     {\darkmagenta \samplefile{tufte}}\par
\stopshapedparagraph
\stop

\page

\start
\startshapedparagraph[list=circle,mp=circle,repeat=yes,method=repeat]%
     \setupalign[verytolerant,stretch,last]\dontcomplain
     {\darkred     \samplefile{tufte}}
     {\darkgreen   \samplefile{tufte}}
     {\darkblue    \samplefile{tufte}}
     {\darkcyan    \samplefile{tufte}}
     {\darkmagenta \samplefile{tufte}}
\stopshapedparagraph
\stop

\stoptext

The interface is still somewhat rough (no grouping for instance, not a 
real envrionment so that might change) but seems to work ok. One can 
also go the tex route and say:

\startparagraphshape[test]
     left 1mm right 1mm
     left 2mm right 2mm
     left 3mm right 3mm
     copy 8
     left 4mm right 4mm
     left 5mm right 5mm
     left 5mm hsize 10cm
\stopparagraphshape

or

\startparagraphshape[test]
     left 1mm right 1mm
     right 3mm
     left 5mm right 5mm
     repeat
\stopparagraphshape

or

\startparagraphshape[test]
     both 1mm both 2mm both 3mm both 4mm both 5mm both 6mm
     both 7mm both 6mm both 5mm both 4mm both 3mm both 2mm
\stopparagraphshape

or

\startparagraphshape[test-repeat]
     both 1mm both 2mm both 3mm both 4mm both 5mm both 6mm
     both 7mm both 6mm both 5mm both 4mm both 3mm both 2mm
     repeat
\stopparagraphshape

and use that with:

\startshapedparagraph[list=test]
     \dorecurse{8}{\showparagraphshape\samplefile{tufte} \par}
\stopshapedparagraph

or

\startshapedparagraph[list=test-repeat]
     \dorecurse{8}{\showparagraphshape\samplefile{tufte} \par}
\stopshapedparagraph

Some more info is in the lowlevel-paragrsph document (part of the low 
level series).

This kind of features falls into the category 'fancy' (no one reqtested 
it), nice for posters and covers. It might evolve depending on needs for 
fancy features, but as said, it's currently a side track of metafun, so 
it's also in the category 'fun'. It's code for 'controlled' usage.

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


More information about the ntg-context mailing list