what i'm looking for is a way to
1. postpone a page, just before it is shipped out
2. instead ship out a page with saved tokens (images)
3. and then ship out the postponed page.

it tried to hook into the output routine without success because the \everybeforeoutput is typeset after the page is shipped out.

pageinjection [previouspage] sort of does what i want, but its a blank page without the layout.

any hints how i can solve this?

many thanks michael



On 10 Mar 2017, at 17:36, Hans Hagen <pragma@wxs.nl> wrote:

On 3/10/2017 10:07 AM, Michael Eidenbenz wrote:
hello,

i try to understand the difference of everybeforeoutput and everafteroutput to inject some pages. it seems as there is no difference.
\the\everybeforeoutput is placed after the output of the page:

\newtoks\Before
\appendtoks
\the\Before
\global\Before\emptytoks
\to\everybeforeoutput

\newtoks\After
\appendtoks
\the\After
\global\After\emptytoks
\to\everyafteroutput

\starttext
\input{knuth}\par
\appendtoks{before}\to\Before
\appendtoks{after}\to\After
\stoptext


this code in page-otr.mkvi seems to put it before the content:

\def\page_otf_set_engine_output_routine#content%
 {\global\output
    {\inotrtrue
     \the\everybeforeoutput
     #content\relax
     \the\everyafteroutput}}

can this be fixed?

there is nothing wrong .. you feed something in the output routine there

you can try to use one of the other \before\after ones but be aware of possible interferences with tex's state, hold content etc ... \startpostponing ... might do what you want

Hans

-----------------------------------------------------------------
                                         Hans Hagen | PRAGMA ADE
             Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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
___________________________________________________________________________________