ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* everybeforeoutput vs everyafteroutput
@ 2017-03-10  9:07 Michael Eidenbenz
  2017-03-10 16:36 ` Hans Hagen
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Eidenbenz @ 2017-03-10  9:07 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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? 
thanks michael





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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: everybeforeoutput vs everyafteroutput
  2017-03-10  9:07 everybeforeoutput vs everyafteroutput Michael Eidenbenz
@ 2017-03-10 16:36 ` Hans Hagen
  2017-03-11 21:55   ` Michael Eidenbenz
  0 siblings, 1 reply; 3+ messages in thread
From: Hans Hagen @ 2017-03-10 16:36 UTC (permalink / raw)
  To: ntg-context

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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: everybeforeoutput vs everyafteroutput
  2017-03-10 16:36 ` Hans Hagen
@ 2017-03-11 21:55   ` Michael Eidenbenz
  0 siblings, 0 replies; 3+ messages in thread
From: Michael Eidenbenz @ 2017-03-11 21:55 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 2649 bytes --]

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 <http://www.pragma-ade.nl/> | www.pragma-pod.nl <http://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
> ___________________________________________________________________________________


[-- Attachment #1.2: Type: text/html, Size: 18294 bytes --]

[-- Attachment #2: Type: text/plain, Size: 492 bytes --]

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-03-11 21:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-10  9:07 everybeforeoutput vs everyafteroutput Michael Eidenbenz
2017-03-10 16:36 ` Hans Hagen
2017-03-11 21:55   ` Michael Eidenbenz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).