On Thu, 6 Feb 2020 16:28:04 +0100
Pablo Rodriguez <oi...@gmx.es> wrote:

> Dear list,
> 
> I have the following sample:
> 
>     \starttext
>     \input knuth
>     \page[right]
>     \setuplayout[page]
>         \externalfigure[\jobname.pdf][page=1]
>     \stoptext
> 
> My question is how to get a page from the document you‘re compiling
> repeated inside the same document.
> 
> I have tried to search both i-context.pdf and the wiki, but “mirror” and
> “repeat” seem to be bad options.

You can store each finished page in a box and access the content
of the stored box afterwards.

\installshipoutmethod{savepages}
  {\dowithnextbox
     {\invokepagehandler{normal}{\copy\nextbox}%
      \putboxincache{savedpages}{\number\realpageno}\nextbox}
   \hbox}

\setuppaper[method=savepages]

\starttext

\dorecurse{8}
  {\expanded{\chapter{Chapter \recurselevel}}
   \dorecurse{\recurselevel}{\samplefile{weisman}}}

\startlayout[page]
\directboxfromcache{savedpages}{5}
\page
\directboxfromcache{savedpages}{2}
\stoplayout

\stoptext

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to