Re: [NTG-context] weekend upload

2021-07-12 Thread Jeong Dal
Dear Aditya,

Thank you for your code and an explanation.

> Let's assume that the last MPpage was a \startuseMPgraphic{boxes}  
> \stopuseMPgraphic. Suppose I wanted to use these pictures in a presentation. 
> On the first slide, I can use
> 
>\useMPgraphic[stacking=0]{boxes}
> 
> to show the three boxes, and on the next slide, I can use
> 
>\useMPgraphic[stacking={-1,0}]{boxes}
> 

I tried to reproduce your example using \startuseMPgraphic{boxes} … 
\stopuseMPgraphic, and useMPgraphic[stacking=0]{boxes} .
A modified one of your code is below.
There is no error message but no output at all.
Would you please tell me what is wrong in here?

Best regards,
Dalyoung


\startMPdefinitions
  input boxes;

  primarydef a +- b =
a -- (xpart a, ypart b) -- b
  enddef ;
  primarydef a -+ b =
a -- (xpart b, ypart a) -- b
  enddef ;
\stopMPdefinitions
\defineframed
  [boxframed]
  [
width=6em,
height=2\lineheight,
align={middle,lohi},
background=color,
backgroundcolor=blue,
foregroundcolor=white,
forefroundstyle=bold,
  ]

\startuseMPgraphic[offset=2mm]{boxes}
  boxit.A("\boxframed{Box A}");
  boxit.B("\boxframed{Box B}");
  boxit.C("\boxframed{Box C}");

  defaultdx := 0pt;
  defaultdy := 0pt;

  A.c = origin;

  B.w - A.e = (1cm, 0);

  0.5[ A.s, B.s ] - C.n = (0, 1cm);

  stacking := 0;
  drawunboxed(A,B,C);
  stacking := 1;
  drawarrow A.s +- C.w ;
  drawarrow B.s +- C.e ;

  newpath highlight;

  highlight := (A.sw -- B.se -- B.ne -- A.nw) enlarged EmWidth;
  fill highlight withcolor "darkgray" withstacking -1;

\stopuseMPgraphic

\starttext
\useMPgraphic[stacking={0}]{boxes}
\useMPgraphic[stacking={0,1}]{boxes}
\useMPgraphic[stacking=-1]{boxes}
\stoptext___
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
___


Re: [NTG-context] weekend upload

2021-07-12 Thread Aditya Mahajan
On Tue, 13 Jul 2021, Jeong Dal wrote:

> Dear Aditya,
> 
> Thank you for your code and an explanation.
> 
> > Let's assume that the last MPpage was a \startuseMPgraphic{boxes}  
> > \stopuseMPgraphic. Suppose I wanted to use these pictures in a 
> > presentation. On the first slide, I can use
> > 
> >\useMPgraphic[stacking=0]{boxes}
> > 
> > to show the three boxes, and on the next slide, I can use
> > 
> >\useMPgraphic[stacking={-1,0}]{boxes}
> > 
> 
> I tried to reproduce your example using \startuseMPgraphic{boxes} … 
> \stopuseMPgraphic, and useMPgraphic[stacking=0]{boxes} .
> A modified one of your code is below.
> There is no error message but no output at all.
> Would you please tell me what is wrong in here?

> [...]
> \startuseMPgraphic[offset=2mm]{boxes}
> [...]

You cannot use [offset=2mm] here. Just use \startuseMPgraphic{boxes}.

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


Re: [NTG-context] double-sided page number placement

2021-07-12 Thread Hans Hagen

On 7/12/2021 7:20 AM, Pablo Rodriguez wrote:

On 7/11/21 5:07 PM, Charles Doherty wrote:

[...]
the left page of the double spread places the page number on the left
margin of the page and in the right page it is placed on the right
margin. This is what I would like to get in LMTX as well. Am I doing
something wrong here?


Hi Charles,

I think that "inright" is what you want:

   \setuppagenumbering[alternative=doublesided,
   location=inright]

   \starttext
   \dorecurse{20}{\input knuth }
   \stoptext

With current latest from 2021.07.10 21:51, "location=inright" behaves as
you expect using LMTX.

Using MKIV with the current latest, there is no difference between
"location=inright" and "location=inmargin".

I don’t know whether this is intended or not.

I hope it might help,

the next version fixes it (the lmtx code is somewhat redone / modern)


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
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
___


Re: [NTG-context] weekend upload

2021-07-12 Thread Hans Hagen

On 7/12/2021 12:12 PM, Floris van Manen wrote:

with the latest version not everything gets drawn as intended.


$ context --version
mtx-context | ConTeXt Process Management 1.04
mtx-context | current version: 2021.07.10 21:51




On 12/07/2021 10:07, Hans Hagen wrote:
I need to ckeck if the range checked does negative numbers ... anyway, 
you can do this


\startMPpage[offset=2mm, stacking={1,2,3,4}]

   boxit.A("\boxframed{Box A}");
   boxit.B("\boxframed{Box B}");
   boxit.C("\boxframed{Box C}");

   defaultdx := 0pt;
   defaultdy := 0pt;

   A.c = origin;

   B.w - A.e = (1cm, 0);

   0.5[ A.s, B.s ] - C.n = (0, 1cm);

   draw image (drawunboxed(A,B,C)) withstacking 2;

   drawarrow A.s +- C.w withstacking 3 ;
   drawarrow B.s +- C.e withstacking 4 ;

   newpath highlight;

   highlight := (A.sw -- B.se -- B.ne -- A.nw) enlarged EmWidth;
   fill highlight withcolor "darkgray" withstacking 1;

\stopMPpage
indeed, that why i mentioned that the next version will do (but no 
upload today)


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


Re: [NTG-context] reusableMPgraphic

2021-07-12 Thread Wolfgang Schuster

Thomas A. Schmitz schrieb am 12.07.2021 um 18:02:

Hi all,

I don’t know if I’m overlooking something really basic or if this is a bug. The 
following MWE compiles with mkiv, but not with lmtx:

\startreusableMPgraphic{fold}
fill unitsquare xyscaled (1mm,1mm) withcolor blue ;
\stopreusableMPgraphic

\definelayer[foldingmarkslayer][width=\paperwidth,height=\paperheight]
\setlayer[foldingmarkslayer][y=101mm,x=11mm]{\reuseMPgraphic{fold}}

\setupbackgrounds [page][background=foldingmarkslayer]

\starttext

Test

\stoptext

The error I get:

tex error on line 6 in file ./test.tex: Use of \meta_usempgraphic_nop doesn't 
match its definition

Any pointers? Thanks


meta-ini.mkxl

-\def\meta_usempgraphic_nop#=#*#=%
+\tolerant\def\meta_usempgraphic_nop#=#*#=%
  {\meta_begin_graphic_group{#1}%
   ...
   \meta_end_graphic_group}

Wolfgang

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


[NTG-context] reusableMPgraphic

2021-07-12 Thread Thomas A. Schmitz
Hi all,

I don’t know if I’m overlooking something really basic or if this is a bug. The 
following MWE compiles with mkiv, but not with lmtx:

\startreusableMPgraphic{fold}
   fill unitsquare xyscaled (1mm,1mm) withcolor blue ;
\stopreusableMPgraphic

\definelayer[foldingmarkslayer][width=\paperwidth,height=\paperheight]
\setlayer[foldingmarkslayer][y=101mm,x=11mm]{\reuseMPgraphic{fold}}

\setupbackgrounds [page][background=foldingmarkslayer]

\starttext

Test

\stoptext

The error I get:

tex error on line 6 in file ./test.tex: Use of \meta_usempgraphic_nop doesn't 
match its definition

Any pointers? Thanks

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


Re: [NTG-context] double-sided page number placement

2021-07-12 Thread Charles Doherty
Dear Pablo,

As you suggested location=inright works for me using LMTX

Hans sent me:

can you put this in cont-new.mkxl and test it with options

\unprotect

\def\page_layouts_place_text_line_left
 {\hpack
{\ifdim\leftedgewidth>\zeropoint
\page_layouts_left_edge_element\c!righttext\c!rightstyle\c!rightcolor\c!rightwidth
 \fi
 \ifdim\leftmarginwidth>\zeropoint
\page_layouts_left_margin_element\c!righttext\c!rightstyle\c!rightcolor\c!rightwidth\plusone
 \fi
 \ifdim\makeupwidth>\zeropoint
   \page_layouts_text_body_element_e_r_m_l
 \fi
 \ifdim\rightmarginwidth>\zeropoint
\page_layouts_right_margin_element\c!lefttext\c!leftstyle\c!leftcolor\c!leftwidth\zerocount
 \fi
 \ifdim\rightedgewidth>\zeropoint
\page_layouts_right_edge_element\c!lefttext\c!leftstyle\c!leftcolor\c!leftwidth
 \fi}}

\protect


 With this both   inright  and  inmargin work in LMTX and MKIV

So everything is working for me now.

Thank you for taking the time,
Charlie


> On 12 Jul 2021, at 06:20, Pablo Rodriguez  wrote:
> 
> On 7/11/21 5:07 PM, Charles Doherty wrote:
>> [...]
>> the left page of the double spread places the page number on the left
>> margin of the page and in the right page it is placed on the right
>> margin. This is what I would like to get in LMTX as well. Am I doing
>> something wrong here?
> 
> Hi Charles,
> 
> I think that "inright" is what you want:
> 
>  \setuppagenumbering[alternative=doublesided,
>  location=inright]
> 
>  \starttext
>  \dorecurse{20}{\input knuth }
>  \stoptext
> 
> With current latest from 2021.07.10 21:51, "location=inright" behaves as
> you expect using LMTX.
> 
> Using MKIV with the current latest, there is no difference between
> "location=inright" and "location=inmargin".
> 
> I don’t know whether this is intended or not.
> 
> I hope it might help,
> 
> Pablo
> --
> http://www.ousia.tk
> ___
> 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
> ___

***
CHARLES DOHERTY
13 BANCROFT ROAD
TALLAGHT
DUBLIN 
D24 YH2V
home: +353 1 2447483
Mobile: +353 863868629
charles.dohe...@icloud.com





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


[NTG-context] Header for a book

2021-07-12 Thread Fabrice Couvreur
Hi,
For my book, the header for each chapter should be like the attached image. I
don't know if I am using the best method, but the result looks like what I
want. Nevertheless, I am having some problems :
1. the header appears on each page ;
2. the title of the chapter should not appear in the body of the text.
Thanks for your help.
Fabrice

\definecolor[MyColorA][r=0.8784, g=0.8784, b=0.8784]
\defineframedtext
  [FramedText]
  [
offset=0.6em,
style=,
toffset=\lineheight,
background=color,
backgroundcolor=MyColorA,
foregroundstyle={\switchtobodyfont[11pt]},
align={left, broad},
frame=off,
width=\textwidth,
  ]


\setuplabeltext
 [en]
 [chapter=CHAPITRE]

\setuphead
   [chapter]
   [bodypartlabel=]


\startsetups [header]
 \labeltext{chapter} \getmarking[chapternumber]
\stopsetups

\setupheadertexts
  []
  [{\FramedText{{\cap\labeltext{chapter}\space\getmarking[chapternumber]}
 \\
\bfc\getmarking[chapter]}}]
  []
  [\FramedText{{\cap\labeltext{chapter}\space \getmarking[chapternumber]}
 \\
   \bfc\getmarking[chapter]}]


\setuppagenumbering
 [alternative=doublesided,location=]
\starttext
\startchapter [title=La récurrence]
  \startsection[title={Le principe de récurrence}]
 \dorecurse{10}{\input knuth}
  \stopsection
  \startsection[title={Le raisonement par récurrence}]
  \dorecurse{10}{\input knuth}
  \stopsection
  \startsection[title={Récurrences fortes}]
  \dorecurse{10}{\input knuth}
  \stopsection
   \startsection[title={Exercices corrigés}]
  \dorecurse{10}{\input knuth}
  \stopsection
\stopchapter
\startchapter [title=Combinatoire-Dénombrement]
\dorecurse{10}{\input knuth}
\stopchapter

\stoptext[image: pied_3.png]
___
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
___


[NTG-context] Moving the old book-structure to a recent ConTeXt

2021-07-12 Thread Gerben Wierda
Years ago I wrote a book (Chess and the Art of Enterprise Architecture) using 
ConTeXt.

The setup was (I think Taco’s) basic book project setup, with a chapters, 
environments, products, etc. subdirectory where you work in the chapters 
directory and can both produce individual chapters and the whole book. The main 
tool to produce was texexec.

ConTeXt has moved on considerably since then (2014-2015).

So, I tried teh old project to see if it still works, but found out it didn’t. 
There still is a texexec in my MacTeX, but the compilation fails:

texexec --pdf --mode=SCREEN  ../products/prd_book.tex
resolvers   | initialization | fatal error: kpse library is accessed (key: 
original)

Is there a new ‘book’ project structure/template for the modern/standalone 
ConTeXt?

Note, I have both a standalone ConTeXt (for another project) and the MacTeX 
distribution on my system. PATH:

/Library/TeX/texbin:/usr/local/context-osx-64/tex/texmf-osx-64/bin:

Thanks,

Gerben Wierda (LinkedIn )
R Enterprise Architecture  (main site)
Book: Chess and the Art of Enterprise Architecture 
Book: Mastering ArchiMate 

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


Re: [NTG-context] Moving the old book-structure to a recent ConTeXt

2021-07-12 Thread Henning Hraban Ramm


> Am 12.07.2021 um 10:25 schrieb Gerben Wierda :
> 
> Years ago I wrote a book (Chess and the Art of Enterprise Architecture) using 
> ConTeXt.
> 
> The setup was (I think Taco’s) basic book project setup, with a chapters, 
> environments, products, etc. subdirectory where you work in the chapters 
> directory and can both produce individual chapters and the whole book. The 
> main tool to produce was texexec.
> 
> ConTeXt has moved on considerably since then (2014-2015).
> 
> So, I tried teh old project to see if it still works, but found out it 
> didn’t. There still is a texexec in my MacTeX, but the compilation fails:
> 
> texexec --pdf --mode=SCREEN  ../products/prd_book.tex
> resolvers   | initialization | fatal error: kpse library is accessed 
> (key: original)
> 
> Is there a new ‘book’ project structure/template for the modern/standalone 
> ConTeXt?

The project struture with project/product/environment/components is still the 
same.

"texexec" is MkII, you must call "context" for MkIV (with --luatex) and LMTX.

You will probably need to update several setups, there were many changes since 
MkII.

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


Re: [NTG-context] weekend upload

2021-07-12 Thread Floris van Manen

with the latest version not everything gets drawn as intended.


$ context --version
mtx-context | ConTeXt Process Management 1.04
mtx-context | current version: 2021.07.10 21:51




On 12/07/2021 10:07, Hans Hagen wrote:
I need to ckeck if the range checked does negative numbers ... anyway, 
you can do this


\startMPpage[offset=2mm, stacking={1,2,3,4}]

   boxit.A("\boxframed{Box A}");
   boxit.B("\boxframed{Box B}");
   boxit.C("\boxframed{Box C}");

   defaultdx := 0pt;
   defaultdy := 0pt;

   A.c = origin;

   B.w - A.e = (1cm, 0);

   0.5[ A.s, B.s ] - C.n = (0, 1cm);

   draw image (drawunboxed(A,B,C)) withstacking 2;

   drawarrow A.s +- C.w withstacking 3 ;
   drawarrow B.s +- C.e withstacking 4 ;

   newpath highlight;

   highlight := (A.sw -- B.se -- B.ne -- A.nw) enlarged EmWidth;
   fill highlight withcolor "darkgray" withstacking 1;

\stopMPpage
___
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
___


Re: [NTG-context] weekend upload

2021-07-12 Thread Hans Hagen

On 7/12/2021 5:31 AM, Aditya Mahajan wrote:

On Sun, 11 Jul 2021, Bruce Horrocks wrote:


On 9 Jul 2021, at 17:29, Hans Hagen  wrote:

This weekend upload has something new for metapost animation lovers:


Forgive my ignorance but what exactly am I supposed to be seeing here? I run 
the example and get two rows of ten boxes. They don't move so it's not like an 
animated GIF was put into the PDF and they don't appear to be consecutive 
frames that could be joined into an animated GIF.


For me, this feature provides the same capability as 'layers' in a graphical program. 
Consider the diagram shown in page 1 of the attached PDF. Suppose I want to 
"highlight" boxes A and B by drawing a square around them. That is easy; simply 
determine the bounding box of A, B (I do that manually here), and expand it a bit and 
draw it. Simple. See page 2.

Now, suppose I want to fill this highlighted box. Suddenly, we have a problem. The 
highlight box needs to be "behind" the other boxes. How do we do it. We 
determine the location of boxes A, B, and C, but do not draw them. Determine the 
highlight box. Now draw the highlight box first and then draw the boxes. Suddenly the 
code became an order of magnitude more complicated.

With the new stacking mechanism, I can just put the highlight box on "stack 
-1", and everything works well. See page 4. What's also super cool is that I can 
control what gets shown by changing the stacking key.

Let's assume that the last MPpage was a \startuseMPgraphic{boxes}  
\stopuseMPgraphic. Suppose I wanted to use these pictures in a presentation. On 
the first slide, I can use

 \useMPgraphic[stacking=0]{boxes}

to show the three boxes, and on the next slide, I can use

 \useMPgraphic[stacking={-1,0}]{boxes}

to show the boxes and the highlight. Drawing such "conditional" graphics was 
cumbersome in the past. Now, it is easier.

If you show a bunch of such "conditional" graphics in a sequence, you get an 
animation (or you could wrap around the animation module).

Aditya

PS: Hans, stacking doesn't completely work with the boxes macro. drawunboxed is always 
drawn on stack 0, which the bpath is drawn on the right stack. That is the reason I use 
stack = -1 to put the highlight in the "background".


in a netx upload this will work ok

\startMPpage[offset=2mm, stacking={1,2}]

draw fullsquare scaled 4cm withstacking 2 withcolor "red" ;
draw image (
draw fullsquare scaled 2cm withstacking 3 withcolor "green" 
withstacking 3 ;
draw fullsquare scaled 1cm withstacking 4 withcolor "blue" 
withstacking 4 ;

) withstacking 2 withcolor "cyan";

drawarrow llcorner currentpicture .. origin withstacking 3;
\stopMPpage





-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
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
___


Re: [NTG-context] weekend upload

2021-07-12 Thread Hans Hagen

On 7/12/2021 5:31 AM, Aditya Mahajan wrote:

On Sun, 11 Jul 2021, Bruce Horrocks wrote:


On 9 Jul 2021, at 17:29, Hans Hagen  wrote:

This weekend upload has something new for metapost animation lovers:


Forgive my ignorance but what exactly am I supposed to be seeing here? I run 
the example and get two rows of ten boxes. They don't move so it's not like an 
animated GIF was put into the PDF and they don't appear to be consecutive 
frames that could be joined into an animated GIF.


For me, this feature provides the same capability as 'layers' in a graphical program. 
Consider the diagram shown in page 1 of the attached PDF. Suppose I want to 
"highlight" boxes A and B by drawing a square around them. That is easy; simply 
determine the bounding box of A, B (I do that manually here), and expand it a bit and 
draw it. Simple. See page 2.

Now, suppose I want to fill this highlighted box. Suddenly, we have a problem. The 
highlight box needs to be "behind" the other boxes. How do we do it. We 
determine the location of boxes A, B, and C, but do not draw them. Determine the 
highlight box. Now draw the highlight box first and then draw the boxes. Suddenly the 
code became an order of magnitude more complicated.

With the new stacking mechanism, I can just put the highlight box on "stack 
-1", and everything works well. See page 4. What's also super cool is that I can 
control what gets shown by changing the stacking key.

Let's assume that the last MPpage was a \startuseMPgraphic{boxes}  
\stopuseMPgraphic. Suppose I wanted to use these pictures in a presentation. On 
the first slide, I can use

 \useMPgraphic[stacking=0]{boxes}

to show the three boxes, and on the next slide, I can use

 \useMPgraphic[stacking={-1,0}]{boxes}

to show the boxes and the highlight. Drawing such "conditional" graphics was 
cumbersome in the past. Now, it is easier.

If you show a bunch of such "conditional" graphics in a sequence, you get an 
animation (or you could wrap around the animation module).

Aditya

PS: Hans, stacking doesn't completely work with the boxes macro. drawunboxed is always 
drawn on stack 0, which the bpath is drawn on the right stack. That is the reason I use 
stack = -1 to put the highlight in the "background".
I need to ckeck if the range checked does negative numbers ... anyway, 
you can do this


\startMPpage[offset=2mm, stacking={1,2,3,4}]

  boxit.A("\boxframed{Box A}");
  boxit.B("\boxframed{Box B}");
  boxit.C("\boxframed{Box C}");

  defaultdx := 0pt;
  defaultdy := 0pt;

  A.c = origin;

  B.w - A.e = (1cm, 0);

  0.5[ A.s, B.s ] - C.n = (0, 1cm);

  draw image (drawunboxed(A,B,C)) withstacking 2;

  drawarrow A.s +- C.w withstacking 3 ;
  drawarrow B.s +- C.e withstacking 4 ;

  newpath highlight;

  highlight := (A.sw -- B.se -- B.ne -- A.nw) enlarged EmWidth;
  fill highlight withcolor "darkgray" withstacking 1;

\stopMPpage

but only the first edge in an image picture is adapted ... (i actually 
know that i need to fix that in mplib because i noticed the same issue 
with color etc (some old issue)


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