ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* [NTG-context] Working with layer sets with Metapost
@ 2024-02-14 23:54 Emanuel Han via ntg-context
  2024-02-15  7:19 ` [NTG-context] " Mikael Sundqvist
  0 siblings, 1 reply; 7+ messages in thread
From: Emanuel Han via ntg-context @ 2024-02-14 23:54 UTC (permalink / raw)
  To: ntg-context; +Cc: Emanuel Han


[-- Attachment #1.1: Type: text/plain, Size: 2172 bytes --]

Dear list,

the attached .tex file is the minimal working example we discussed today in the online meeting.
I realized that the approach of looping through k of p[k] 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 approach we don't have a fixed order of the layers.
So the definition of the layers would be something like
picture layerA;
layerA:=image(
label("Word 1", z1);
);

picture layerW;
layerW:=image(
label("Mot 2", z2);
);

picture layerM;
layerM:=image(
label("Parola 3", z3);
);

picture layerC;
layerC:=image(
label("Wort 4", z3+z1);
);

picture layerY;
layerY:=image(
label("Nummer 5", z2+z3);
);

picture layerU;
layerU:=image(
label("number 6", 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 "myset".

myset layersubsetGamma;
layersubsetGamma:={layerU,layerM};

In my logic, the layers will be drawn in the order of their appearance within the {}. 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 PDF page, and thus the layer sets are related to each other by an inner order. That's why I would use an array variable here with [].
I don't know how to append a set. In the following example, I assumed there would be a function myappend(<initial set>, <the things what the initial set should be appended with>)
myset layerset[];
layerset1 := {layerW,layerA};
layerset2 := myappend{layerset1, layerY};
layerset3 := myappend{layerset2, layersubsetGamma};
layerset4 := myappend{layerset2, layerU};
layerset5 := myappend{layerset4, layersubsetGamma};

Finally, I would need each layerset[k] typeset on its own pdf page. And of course on each page k, only the layers which appear in the definition of the layerset[k] should be drawn on top of each other in the order as they appear in that definition.
I'm very curious to hear your suggestions.
Thanks
Emanuel


[-- Attachment #1.2: Type: text/html, Size: 3538 bytes --]

[-- Attachment #2: multipage_metapost_mwe-very_simple.tex --]
[-- Type: application/x-tex, Size: 1781 bytes --]

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

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-02-17 10:08 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-14 23:54 [NTG-context] Working with layer sets with Metapost Emanuel Han via ntg-context
2024-02-15  7:19 ` [NTG-context] " Mikael Sundqvist
2024-02-15 21:07   ` Emanuel Han via ntg-context
2024-02-15 22:10     ` Emanuel Han via ntg-context
2024-02-16  5:52       ` Emanuel Han via ntg-context
2024-02-16  6:56         ` Mikael Sundqvist
2024-02-17 10:03           ` Emanuel Han via ntg-context

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