Thank you Aditya! Your solution works for me. I added the counter to your code:

\directlua{
counter = 1
}

\startbuffer[Q\directlua{tex.print(counter)}]
\startstackingsteps[1,{1:2}]
   \stacking[1]{First Question}

   \stacking[2]{First Answer}
   \page
 \stopstackingsteps
\stopbuffer
\directlua{counter = counter + 1}

\startbuffer[Q\directlua{tex.print(counter)}]
\startstackingsteps[1,{1:2}]
   \stacking[1]{Second Question}

   \stacking[2]{Second Answer}
   \page
 \stopstackingsteps
\stopbuffer
\directlua{counter = counter + 1}

\starttext

\dorecurse{2}{\getbuffer[Q\recurselevel]}

\stoptext

On 7 Apr 2026, at 3:49, Aditya Mahajan wrote:

On Mon, 6 Apr 2026, Emanuel Han wrote:

Hi list,

I want to show snippets of text on a slide and then add some other snippets of the same text on the next slide. Then, restart with some new text, on a
„cleared“ slide.

Example:

Slide 1: English _______ difficult.
Slide 2: English   is    difficult.
Slide 3: ______ English classes ______ Mick ______ fun.
Slide 4:   The  English classes  with  Mick  are   fun.

Let’s call „question1“ what is to be printed on slide 1.
Let’s call „answer1“ what is to be added to that on slide 2.
Let’s call „question2“ what is to be printed on slide 3.
Let’s call „answer2“ what is to be added to that on slide 4.
And so on.

My first attempt is with stacking.

It works so far, the only problem I couldn’t solve is how to „clear“ the space used up by previous questions (and their answers). Is there a specific way to do this with stacking? I was not successful in finding documentation
about stacking.

You should really think of this as two separate "stacks": one for Q1 and one for Q2.


\setuppapersize[S6][S6]

\startbuffer[Q1]
\startstackingsteps[1,{1:2}]
   \stacking[1]{First Question}

   \stacking[2]{First Answer}
   \page
 \stopstackingsteps
\stopbuffer

\startbuffer[Q2]
\startstackingsteps[1,{1:2}]
   \stacking[1]{Second Question}

   \stacking[2]{Second Answer}
   \page
 \stopstackingsteps
\stopbuffer

\starttext

\dorecurse{2}{\getbuffer[Q\recurselevel]}

\stoptext


And then I tried to include a counter, so that I can re-arrange the order of the questions with just cutting and pasting them somewhere else in the source code, without the need to manually edit the number of the question (even better than that would be a randomizer for the order of the questions). Below is my attempt with the counter, which unfortunately doesn’t work. Maybe it’s
a matter of when the counter variable is stored / updated.

This should be easy with the above structure.

Aditya___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : [email protected] / 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
___________________________________________________________________________________
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : [email protected] / 
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
___________________________________________________________________________________

Reply via email to