Am Sonntag, 23. Juni 2024, 14:35:13 MESZ schrieb Gerion Entrup: > Am Freitag, 21. Juni 2024, 19:00:03 MESZ schrieb Hans Hagen via ntg-context: > > -- support for stacking at the tex end (maybe for presentations) > > > > \starttext > > > > \definestacking[one] > > \definestacking[two] > > > > \startbuffer > > This is a test \stacking [one] {and a proof} of \stacking [two] > > {concept} indeed > > \stacking [one] {\blackrule [width=4cm]} is it and the question is how > > \stacking > > [two] {\scale [s=2] {fancy}} we can go > > > > \startstacking[one] > > \startformula > > \sqrt{1+x} > > \stopformula > > \stopstacking > > > > and how useful \stacking[two]{\inframed{it}} is. > > \stopbuffer > > > > \startstackingsteps[one,two,{one,two}] > > \startTEXpage[offset=1ts] > > \getbuffer > > \stopTEXpage > > \stopstackingsteps > > > > \startTEXpage[offset=1ts] \setupstacking[criterium={one}] \getbuffer > > \stopTEXpage > > \startTEXpage[offset=1ts] \setupstacking[criterium={two}] \getbuffer > > \stopTEXpage > > \startTEXpage[offset=1ts] \setupstacking[criterium={one,two}] \getbuffer > > \stopTEXpage > > > > \stoptext > > Very nice, thank you! > > I see some similarities to the "visible on" technique [1], I posted in a previous thread. > What comes there really handy are range specifiers, what seems not possible with this interface. > For example: "visible on=<2->" renders the content on every page except the first one > or "visible on=<1-5,13-15>" on the first page up to the fifth page and from page 13 to 15. > > The mechanism stems from the Beamer overlay specifications, see section 9.3 of the manual [2] > and can be much more complicated with modes (section 9.6.2). > > To add this to the new interface, if you want that, the stack layers above need some kind of order, > which is implicit for numbers: > ``` > \definestacking{one} > \definestacking{two} > \definestacking{three} > \definestackingorder{one,two, three} > ... > \setupstacking[criterium={one-three}] > ``` > The order could also be implicitly defined after the order of the \definestacking calls. > > Or would it be possible to have numbers always automatically (additionally) available as stacking layer? > So that this "just" works: > ``` > \startbuffer > This is a test \stacking [1] {and a proof} of \stacking [2] {concept} indeed. > \stopbuffer > ... > \setupstacking[criterium={1-}] > ``` > > I also wondered, if it is possible to define a lot of layers semiautomatically in Lua > (in some graphics I needed around 20 layers). It seems that numbers in layer names currently are not allowed. > Is code like this possible somehow? > > ``` > \startluacode > for i = 1, 20 do > context.definestacking(string.format("l\letterpercent.d", i)) > end > \stopluacode > ``` > > Gerion > > > [1] https://github.com/luhsra/texmf/blob/main/tex/latex/beamertools/beamertools.sty > [2] https://ctan.org/pkg/beamer > I need to correct myself (I had a typo in my tests before). Numbers as stacking layer names are possible. This Lua code works fine: ``` \startluacode for i = 1, 20 do context("\\definestacking[l\letterpercent.d]", i) end \stopluacode ``` Gerion