[NTG-context] MetaFun labels and xsized

Pablo Rodriguez oinos at gmx.es
Fri Dec 25 19:38:49 CET 2020


On 12/25/20 6:36 PM, Fabrice L wrote:
>> I have this minimal MetaFun sample (the only one in my real document):
>> [...]
>> Is there a way to relate adapt the labels to the xsized positions used?
>
> I’m sure somebody could find a more elegant solution, but here is a simple one:
>
>  \setupbodyfont[pagella]
>  \starttext
>  \startMPcode
>  pair a ; a := (1, 1) ;
>  pair b ; b := (1, 10) ;
>  pair c ; c := (10, 10) ;
>  pair d ; d := (10, 1) ;
>  path square ;
>  square := (a--b--c--d--cycle) xsized .75TextWidth ;
>
>  draw square xsized .75TextWidth;
>
>  draw thelabel.lft("α",point 0 of square) ;
>  draw thelabel.lft("β",point 1 of square) ;
>  draw thelabel.top("γ",point 2 of square) ;
>  draw thelabel.rt("δ",point 3 of square) ;
>  \stopMPcode
>  \stoptext

Many thanks for your ultra-fast reply, Fabrice.

I didn’t know that paths could be also defined (MP is all Greek to me).

I realized that drawing doesn’t require resizing again (once the path
definition contains resizing).

Many thanks for your help,

Pablo
--
http://www.ousia.tk


More information about the ntg-context mailing list