From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HTML_MESSAGE,MAILING_LIST_MULTI,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: from cgl.ntg.nl (Cgl.ntg.nl [5.39.185.202]) by inbox.vuxu.org (Postfix) with ESMTP id C9A6E2762C for ; Thu, 15 Feb 2024 22:11:02 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id 1628F482B80 for ; Thu, 15 Feb 2024 22:10:45 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at cgl.ntg.nl Authentication-Results: cgl.ntg.nl (amavisd-new); dkim=fail (2048-bit key) reason="fail (message has been altered)" header.d=labonneheure.ch Received: from cgl.ntg.nl ([127.0.0.1]) by localhost (cgl.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id yp95MdjtagDC for ; Thu, 15 Feb 2024 22:10:44 +0100 (CET) Received: from cgl.ntg.nl (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id A2F8A4841D8 for ; Thu, 15 Feb 2024 22:08:14 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id 022A8483A7F for ; Thu, 15 Feb 2024 22:07:29 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at cgl.ntg.nl Received: from cgl.ntg.nl ([127.0.0.1]) by localhost (cgl.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id brWuYRaozw6C for ; Thu, 15 Feb 2024 22:07:28 +0100 (CET) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=45.13.66.34; helo=outbound00.knthost.com; envelope-from=emanuel@labonneheure.ch; receiver= Received: from outbound00.knthost.com (outbound00.knthost.com [45.13.66.34]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by cgl.ntg.nl (Postfix) with ESMTPS id E4CDC4834BE for ; Thu, 15 Feb 2024 22:07:27 +0100 (CET) Date: Thu, 15 Feb 2024 22:07:22 +0100 DKIM-Filter: OpenDKIM Filter v2.10.3 outbound00.knthost.com F1FBA3B90F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=labonneheure.ch; s=default; t=1708031245; bh=p90ZbLKcZzyNV1KlAunreb+SPCNw3tNI0zNtZey9euc=; h=Date:From:To:In-Reply-To:References:Subject; b=UpVAzgMIYkBGtHBUtoUKF66N1EoczFhtsgnDcbnsJiTns8kQSO5j7sqruwo/Phuve kGtYc7F6vZDATOSi88x0vPr38PEyjmFExhxPyK4GZPRUXFsPhzj0mOyJ2HCTzfN8Ne 0ntNPToHqkcph4cQpm/FdqU9xRan4virsibdlPXrWcc/NIUu3cLUwEQR+lMeUOZerW CnC4cx3EfEt9uV82br3S8p+MyttO81TojKu8eUNs8D/SJJ7y4bsqn0PdhIQYHzD4V8 DmvS8FMpRwnRiRxBKU09pXgJ0nwBuJJEKX2pC2O71VqmrqHw49ja9cn6+K9/HS79xM KfryFt4TAc7zg== To: mailing list for ConTeXt users Message-ID: In-Reply-To: References: X-Mailer: Mailspring MIME-Version: 1.0 Message-ID-Hash: GVPKCRG2BUUZHEXJXDCWWIYMXBYILREZ X-Message-ID-Hash: GVPKCRG2BUUZHEXJXDCWWIYMXBYILREZ X-MailFrom: emanuel@labonneheure.ch X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list Reply-To: mailing list for ConTeXt users Subject: [NTG-context] Re: Working with layer sets with Metapost List-Id: mailing list for ConTeXt users Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Emanuel Han via ntg-context Cc: Emanuel Han Content-Type: multipart/mixed; boundary="===============2271255935258825815==" --===============2271255935258825815== Content-Type: multipart/alternative; boundary="65ce7d0a_6b8b4567_799d" --65ce7d0a_6b8b4567_799d Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Dear Mikael, thanks a lot=21 this seems to be the solution=21 And it looks beatiful enough to me =F0=9F= =98=84 I'll try to port all my layers to this new method and see if I run into n= ew problems again =F0=9F=98=85 Emanuel On =46eb. 15 2024, at 8:19 am, Mikael Sundqvist wrot= e: > Hi > > On Thu, =46eb 15, 2024 at 1:03=E2=80=AFAM Emanuel Han via ntg-context > wrote: > > > > Dear list, > > > > the attached .tex file is the minimal working example we discussed to= day in the online meeting. > > > > I realized that the approach of looping through k of p=5Bk=5D is not = fitting my needs, because it's not flexible enough. > > > > I need another approach, one which works with layer sets. > > > > I would stop using p as an array, because with the layer sets approac= h we don't have a fixed order of the layers. > > > > So the definition of the layers would be something like > > > > picture layerA; > > layerA:=3Dimage( > > label(=22Word 1=22, z1); > > ); > > > > picture layerW; > > layerW:=3Dimage( > > label(=22Mot 2=22, z2); > > ); > > > > picture layerM; > > layerM:=3Dimage( > > label(=22Parola 3=22, z3); > > ); > > > > picture layerC; > > layerC:=3Dimage( > > label(=22Wort 4=22, z3+z1); > > ); > > > > picture layerY; > > layerY:=3Dimage( > > label(=22Nummer 5=22, z2+z3); > > ); > > > > picture layerU; > > layerU:=3Dimage( > > label(=22number 6=22, z2+z1); > > ); > > > > After that, I would define layer sets and layer subsets. This will be= done manually for each layer set and each layer subset. > > I don't know the proper syntax to do that. Let's assume we could use = a variable type called =22myset=22. > > > > myset layersubsetGamma; > > layersubsetGamma:=3D=7BlayerU,layerM=7D; > > > > In my logic, the layers will be drawn in the order of their appearanc= e within the =7B=7D. In the example, drawn content of layerM might cover = drawn content of layerU. > > > > Contrary to a layer subset, each layer set will result in a PD=46 pag= e, and thus the layer sets are related to each other by an inner order. T= hat's why I would use an array variable here with =5B=5D. > > > > I don't know how to append a set. In the following example, I assumed= there would be a function myappend(, ) > > > > myset layerset=5B=5D; > > layerset1 :=3D =7BlayerW,layerA=7D; > > layerset2 :=3D myappend=7Blayerset1, layerY=7D; > > layerset3 :=3D myappend=7Blayerset2, layersubsetGamma=7D; > > layerset4 :=3D myappend=7Blayerset2, layerU=7D; > > layerset5 :=3D myappend=7Blayerset4, layersubsetGamma=7D; > > > > =46inally, I would need each layerset=5Bk=5D typeset on its own pdf p= age. And of course on each page k, only the layers which appear in the de= finition of the layerset=5Bk=5D should be drawn on top of each other in t= he order as they appear in that definition. > > > > I'm very curious to hear your suggestions. > > > > Not beautiful, perhaps, but maybe something like this could work=3F I > think there is no way out of doing some manual work to tell what you > want included on each page. > > =5CstartuseMPgraphic=7Bbase=7D > z1 =3D origin ; > z2 =3D (10,50) ; > z3 =3D (40,30) ; > > picture layerA; > layerA:=3Dimage( > label(=22Word 1=22, z1); > ); > > picture layerW; > layerW:=3Dimage( > label(=22Mot 2=22, z2); > ); > > picture layerM; > layerM:=3Dimage( > label(=22Parola 3=22, z3); > ); > > picture layerC; > layerC:=3Dimage( > label(=22Wort 4=22, z3+z1); > ); > > picture layerY; > layerY:=3Dimage( > label(=22Nummer 5=22, z2+z3); > ); > > picture layerU; > layerU:=3Dimage( > label(=22number 6=22, z2+z1); > ); > =5CstopuseMPgraphic > > =5CstartuseMPgraphic=7BGamma=7D > draw layerU ; > draw layerM ; > =5CstopuseMPgraphic > > =5CstartuseMPgraphic=7Blayerset1=7D > =5CincludeMPgraphic=7Bbase=7D > draw layerW ; > draw layerA ; > =5CstopuseMPgraphic > > =5CstartuseMPgraphic=7Blayerset2=7D > =5CincludeMPgraphic=7Blayerset1=7D ; > draw layerY ; > =5CstopuseMPgraphic > > =5CstartuseMPgraphic=7Blayerset3=7D > =5CincludeMPgraphic=7Blayerset2=7D ; > =5CincludeMPgraphic=7BGamma=7D ; > =5CstopuseMPgraphic > > > =5CstartuseMPgraphic=7Blayerset4=7D > =5CincludeMPgraphic=7Blayerset2=7D ; > draw layerU ; > =5CstopuseMPgraphic > > =5CstartuseMPgraphic=7Blayerset5=7D > =5CincludeMPgraphic=7Blayerset4=7D ; > =5CincludeMPgraphic=7BGamma=7D ; > =5CstopuseMPgraphic > > =5Cstarttext > =5CstartTEXpage=5Boffset=3D1DK=5D > =5CuseMPgraphic=7Blayerset1=7D > =5CstopTEXpage > > =5CstartTEXpage=5Boffset=3D1DK=5D > =5CuseMPgraphic=7Blayerset2=7D > =5CstopTEXpage > > =5CstartTEXpage=5Boffset=3D1DK=5D > =5CuseMPgraphic=7Blayerset3=7D > =5CstopTEXpage > > =5CstartTEXpage=5Boffset=3D1DK=5D > =5CuseMPgraphic=7Blayerset4=7D > =5CstopTEXpage > > =5CstartTEXpage=5Boffset=3D1DK=5D > =5CuseMPgraphic=7Blayerset5=7D > =5CstopTEXpage > > =5Cstoptext > /Mikael > =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F= =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F= =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F= =5F=5F=5F=5F=5F=5F=5F=5F=5F > If your question is of interest to others as well, please add an entry = to the Wiki=21 > > maillist : ntg-context=40ntg.nl / https://mailman.ntg.nl/mailman3/lists= /ntg-context.ntg.nl > webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirro= r) > archive : https://github.com/contextgarden/context > wiki : https://wiki.contextgarden.net > =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F= =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F= =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F= =5F=5F=5F=5F=5F=5F=5F=5F=5F > --65ce7d0a_6b8b4567_799d Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline
Dear Mikael,
thanks a lot=21
this seems to be t= he solution=21 And it looks beatiful enough to me =F0=9F=98=84
I'll try to port all my layers = to this new method and see if I run into new problems again =F0=9F=98=85

Emanuel<= /div>

On =46eb. 15 = 2024, at 8:19 am, Mikael Sundqvist <mickep=40gmail.com> wrote:
Hi

On Thu, =46eb 15, 2024 at 1:03=E2= =80=AFAM Emanuel Han via ntg-context
<ntg-context=40ntg.nl&g= t; wrote:
>
> Dear list,
>
> the attached .tex file is the minimal working example we discusse= d today in the online meeting.
>
> I realized t= hat the approach of looping through k of p=5Bk=5D is not fitting my needs= , because it's not flexible enough.
>
> I need = another approach, one which works with layer sets.
>
> I would stop using p as an array, because with the layer sets app= roach we don't have a fixed order of the layers.
>
> So the definition of the layers would be something like
&= gt;
> picture layerA;
> layerA:=3Dimage(
<= div>> label(=22Word 1=22, z1);
> );
>
<= div>> picture layerW;
> layerW:=3Dimage(
> l= abel(=22Mot 2=22, z2);
> );
>
> pi= cture layerM;
> layerM:=3Dimage(
> label(=22Par= ola 3=22, z3);
> );
>
> picture la= yerC;
> layerC:=3Dimage(
> label(=22Wort 4=22, = z3+z1);
> );
>
> picture layerY;
> layerY:=3Dimage(
> label(=22Nummer 5=22, z2+z3= );
> );
>
> picture layerU;
<= div>> layerU:=3Dimage(
> label(=22number 6=22, z2+z1);
> );
>
> After that, I would define = layer sets and layer subsets. This will be done manually for each layer s= et and each layer subset.
> I don't know the proper syntax t= o do that. Let's assume we could use a variable type called =22myset=22.<= /div>
>
> myset layersubsetGamma;
> laye= rsubsetGamma:=3D=7BlayerU,layerM=7D;
>
> In my = logic, the layers will be drawn in the order of their appearance within t= he =7B=7D. In the example, drawn content of layerM might cover drawn cont= ent of layerU.
>
> Contrary to a layer subset, = each layer set will result in a PD=46 page, and thus the layer sets are r= elated to each other by an inner order. That's why I would use an array v= ariable here with =5B=5D.
>
> I don't know how = to append a set. In the following example, I assumed there would be a fun= ction myappend(<initial set>, <the things what the initial set s= hould be appended with>)
>
> myset layerset=5B= =5D;
> layerset1 :=3D =7BlayerW,layerA=7D;
> la= yerset2 :=3D myappend=7Blayerset1, layerY=7D;
> layerset3 :=3D= myappend=7Blayerset2, layersubsetGamma=7D;
> layerset4 :=3D= myappend=7Blayerset2, layerU=7D;
> layerset5 :=3D myappend=7B= layerset4, layersubsetGamma=7D;
>
> =46inally, = I would need each layerset=5Bk=5D typeset on its own pdf page. And of cou= rse on each page k, only the layers which appear in the definition of the= layerset=5Bk=5D should be drawn on top of each other in the order as the= y appear in that definition.
>
> I'm very curio= us to hear your suggestions.
>

Not beautiful, = perhaps, but maybe something like this could work=3F I
think th= ere is no way out of doing some manual work to tell what you
wa= nt included on each page.

=5CstartuseMPgraphic=7Bbase=7D
z1 =3D origin ;
z2 =3D (10,50) ;
z3 =3D (40,3= 0) ;

picture layerA;
layerA:=3Dimage(
l= abel(=22Word 1=22, z1);
);

picture layerW;
<= div>layerW:=3Dimage(
label(=22Mot 2=22, z2);
);
=
picture layerM;
layerM:=3Dimage(
label(=22Pa= rola 3=22, z3);
);

picture layerC;
laye= rC:=3Dimage(
label(=22Wort 4=22, z3+z1);
);

=
picture layerY;
layerY:=3Dimage(
label(=22Nummer= 5=22, z2+z3);
);

picture layerU;
layer= U:=3Dimage(
label(=22number 6=22, z2+z1);
);
=5CstopuseMPgraphic

=5CstartuseMPgraphic=7BGamma=7D
=
draw layerU ;
draw layerM ;
=5CstopuseMPgraphic<= /div>
=5CstartuseMPgraphic=7Blayerset1=7D
=5CincludeMPg= raphic=7Bbase=7D
draw layerW ;
draw layerA ;
=5CstopuseMPgraphic

=5CstartuseMPgraphic=7Blayerset2=7D
=5CincludeMPgraphic=7Blayerset1=7D ;
draw layerY ;
=5CstopuseMPgraphic

=5CstartuseMPgraphic=7Blayerset3= =7D
=5CincludeMPgraphic=7Blayerset2=7D ;
=5CincludeMP= graphic=7BGamma=7D ;
=5CstopuseMPgraphic


=5Cs= tartuseMPgraphic=7Blayerset4=7D
=5CincludeMPgraphic=7Blayerset2= =7D ;
draw layerU ;
=5CstopuseMPgraphic

=5CstartuseMPgraphic=7Blayerset5=7D
=5CincludeMPgraphic=7Blaye= rset4=7D ;
=5CincludeMPgraphic=7BGamma=7D ;
=5Cstopus= eMPgraphic

=5Cstarttext

=5CstartTEXpage=5Boff= set=3D1DK=5D
=5CuseMPgraphic=7Blayerset1=7D
=5CstopTE= Xpage

=5CstartTEXpage=5Boffset=3D1DK=5D
=5CuseMPg= raphic=7Blayerset2=7D
=5CstopTEXpage

=5CstartTEXp= age=5Boffset=3D1DK=5D
=5CuseMPgraphic=7Blayerset3=7D
= =5CstopTEXpage

=5CstartTEXpage=5Boffset=3D1DK=5D
= =5CuseMPgraphic=7Blayerset4=7D
=5CstopTEXpage

=5C= startTEXpage=5Boffset=3D1DK=5D
=5CuseMPgraphic=7Blayerset5=7D
=5CstopTEXpage

=5Cstoptext

/Mikael
=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F= =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F= =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F= =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F
If your question is of intere= st to others as well, please add an entry to the Wiki=21

ma= illist : ntg-context=40ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg= -context.ntg.nl
webpage : https://www.pragma-ade.nl / https://c= ontext.aanhet.net (mirror)
archive : https://github.com/context= garden/context
wiki : https://wiki.contextgarden.net
= =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F= =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F= =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F= =5F=5F=5F=5F=5F=5F=5F=5F
--65ce7d0a_6b8b4567_799d-- --===============2271255935258825815== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___________________________________________________________________________________ --===============2271255935258825815==--