On 2/28/24 12:24, Pablo Rodriguez via ntg-context wrote:
> [...]
> This is why beforequadruple would make sense. I guess some Lua magic
> could do that, computing x to the follwing page that "x % 4 = 3" (and
> then \page[x]).
>
> I will try to find a trick for that, but not now.

Replying to myself, this is a command to compute next numbers before and
after quadruples (with application to \realpageno):

 \starttext
  \def\beforequadruplenumber#1%
    {\ifnum\modulonumber{4}{#1} = 1
       \the\numexpr #1 + 2
     \orelse\ifnum\modulonumber{4}{#1} = 2
       \the\numexpr #1 + 1
     \orelse\ifnum\modulonumber{4}{#1} = 3
       \the\numexpr #1 + 4
      \else
       \the\numexpr #1 + 3
     \fi}

  \def\afterquadruplenumber#1%
    {\ifnum\modulonumber{4}{#1} = 1
       \the\numexpr #1 + 4
     \orelse\ifnum\modulonumber{4}{#1} = 2
       \the\numexpr #1 + 3
     \orelse\ifnum\modulonumber{4}{#1} = 3
       \the\numexpr #1 + 2
      \else
       \the\numexpr #1 +1
     \fi}

  \dorecurse{25}{\recurselevel: \beforequadruplenumber{\recurselevel}\\}
  \dorecurse{25}{\recurselevel: \afterquadruplenumber{\recurselevel}\\}

  %\page[123]
  %\null
  \page[\beforequadruplenumber{\realpageno}]
  before quadruple
  \page[\afterquadruplenumber{\realpageno}]
  afterquadruple
  \stoptext

Michael, if this fits your needs, please add it to the wiki.

I hope it helps,

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

Reply via email to