From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/97532 Path: news.gmane.org!.POSTED!not-for-mail From: Michael Eidenbenz Newsgroups: gmane.comp.tex.context Subject: Re: everybeforeoutput vs everyafteroutput Date: Sat, 11 Mar 2017 22:55:03 +0100 Message-ID: References: <3a1e7bc1-5e56-0abe-c3fd-a37faec031be@wxs.nl> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/mixed; boundary="===============8778208522116912513==" X-Trace: blaine.gmane.org 1489269330 25583 195.159.176.226 (11 Mar 2017 21:55:30 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 11 Mar 2017 21:55:30 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Sat Mar 11 22:55:24 2017 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cmoyy-0005yg-Gr for gctc-ntg-context-518@m.gmane.org; Sat, 11 Mar 2017 22:55:24 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id DABE983C61; Sat, 11 Mar 2017 22:55:17 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id SqFfkhOXN2CY; Sat, 11 Mar 2017 22:55:17 +0100 (CET) Original-Received: from zapf.ntg.nl (localhost [IPv6:::1]) by zapf.ntg.nl (Postfix) with ESMTP id 03CAE83C54; Sat, 11 Mar 2017 22:55:17 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 5F73C83C51 for ; Sat, 11 Mar 2017 22:55:16 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id EgW_0dS_pr_u for ; Sat, 11 Mar 2017 22:55:15 +0100 (CET) Original-Received: from edge10.ethz.ch (edge10.ethz.ch [82.130.75.186]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id 1792B83C4E for ; Sat, 11 Mar 2017 22:55:04 +0100 (CET) Original-Received: from CAS20.d.ethz.ch (172.31.51.110) by edge10.ethz.ch (82.130.75.186) with Microsoft SMTP Server (TLS) id 14.3.319.2; Sat, 11 Mar 2017 22:54:53 +0100 Original-Received: from [192.168.88.11] (212.51.141.26) by mail.ethz.ch (172.31.51.110) with Microsoft SMTP Server (TLS) id 14.3.319.2; Sat, 11 Mar 2017 22:55:03 +0100 In-Reply-To: <3a1e7bc1-5e56-0abe-c3fd-a37faec031be@wxs.nl> X-Mailer: Apple Mail (2.3124) X-Originating-IP: [212.51.141.26] X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.16 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: "ntg-context" Xref: news.gmane.org gmane.comp.tex.context:97532 Archived-At: --===============8778208522116912513== Content-Type: multipart/alternative; boundary="Apple-Mail=_BB2EDD97-AF6A-4E09-9F06-51F0A27ED356" --Apple-Mail=_BB2EDD97-AF6A-4E09-9F06-51F0A27ED356 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="us-ascii" 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 wrote: >=20 > On 3/10/2017 10:07 AM, Michael Eidenbenz wrote: >> hello, >>=20 >> 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: >>=20 >> \newtoks\Before >> \appendtoks >> \the\Before >> \global\Before\emptytoks >> \to\everybeforeoutput >>=20 >> \newtoks\After >> \appendtoks >> \the\After >> \global\After\emptytoks >> \to\everyafteroutput >>=20 >> \starttext >> \input{knuth}\par >> \appendtoks{before}\to\Before >> \appendtoks{after}\to\After >> \stoptext >>=20 >>=20 >> this code in page-otr.mkvi seems to put it before the content: >>=20 >> \def\page_otf_set_engine_output_routine#content% >> {\global\output >> {\inotrtrue >> \the\everybeforeoutput >> #content\relax >> \the\everyafteroutput}} >>=20 >> can this be fixed? >=20 > there is nothing wrong .. you feed something in the output routine = there >=20 > 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 >=20 > Hans >=20 > ----------------------------------------------------------------- > 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! >=20 > 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 > = __________________________________________________________________________= _________ --Apple-Mail=_BB2EDD97-AF6A-4E09-9F06-51F0A27ED356 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset="us-ascii"
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

---------------------------------------------------------------= --
          &nb= sp;            = ;            &= nbsp;     Hans Hagen | PRAGMA ADE
          &nb= sp;  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
_______________________________________________________________= ____________________

= --Apple-Mail=_BB2EDD97-AF6A-4E09-9F06-51F0A27ED356-- --===============8778208522116912513== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly9jb250ZXh0LmFhbmhldC5uZXQKYXJjaGl2ZSAgOiBodHRwczovL2JpdGJ1Y2tldC5v cmcvcGhnL2NvbnRleHQtbWlycm9yL2NvbW1pdHMvCndpa2kgICAgIDogaHR0cDovL2NvbnRleHRn YXJkZW4ubmV0Cl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f --===============8778208522116912513==--