ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* afterpage
@ 2006-08-28 17:19 Paul Jones
  2006-08-28 20:35 ` afterpage Peter Rolf
  0 siblings, 1 reply; 5+ messages in thread
From: Paul Jones @ 2006-08-28 17:19 UTC (permalink / raw)



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

Hello,

I have used Latex in the past and have the following code that inserts
information on certain pages using afterpage.  Is there some way to do a
similar thing in context?

\usepackage{afterpage}
\newcommand{\insertpagea}{\vbox to \textheight{\vfill This page inserted on
page 3 \vfill}}
\newcommand{\insertpageb}{\vbox to \textheight{\vfill This page inserted on
page 4 \vfill}}
\newcommand{\incpage}{\ifthenelse{\value{page}=3}{\insertpagea}{%

\ifthenelse{\value{page}=4}{\insertpageb}{%
                                                \afterpage{\incpage}}}}
\afterpage{\incpage}
\begin{document}
.
.
.
\end{document}

I am not sure if this could be done at a different level also, maybe with
texexec or something.  I basically have a requirement to insert content into
a document on a specific page.  After doing so the table of contents must
still be correct.

I am still fairly new in the Tex world so any help you can give will be very
much appreciated.

Paul

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

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

_______________________________________________
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context

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

* Re: afterpage
  2006-08-28 17:19 afterpage Paul Jones
@ 2006-08-28 20:35 ` Peter Rolf
  2006-08-28 20:55   ` afterpage Hans Hagen
  0 siblings, 1 reply; 5+ messages in thread
From: Peter Rolf @ 2006-08-28 20:35 UTC (permalink / raw)


Hi Paul,

Paul Jones wrote:
> Hello,
> 
> I have used Latex in the past and have the following code that inserts
> information on certain pages using afterpage.  Is there some way to do a
> similar thing in context?
>

\setupoutput[pdf]
\definelayer[info]

\setuplayer[info]
  [height=\paperheight,width=\paperwidth]

\setupbackgrounds[page]
  [background={text,info}]% info layer is above normal text layer

\def\WhichPage#1{%
  \def\docommand##1{\ifnum\pageno=##1\relax
    \setlayerframed[info][x=20mm,y=\dimexpr\paperheight-15mm,location=r]
    [background=color,backgroundcolor=white]
      {\tfb This page is inserted on page \number\pageno}\fi}%
    \rawprocesscommalist[#1]\docommand}%

% put it in a command that is called for every page
\setupheadertexts[\the\pageno\WhichPage{3,4}]


\starttext

\dorecurse{12}{\input zapf\relax
\input tufte\relax}

\stoptext


I hope this fits your needs.

Greetings, Peter

> \usepackage{afterpage}
> \newcommand{\insertpagea}{\vbox to \textheight{\vfill This page inserted
> on page 3 \vfill}}
> \newcommand{\insertpageb}{\vbox to \textheight{\vfill This page inserted
> on page 4 \vfill}}
> \newcommand{\incpage}{\ifthenelse{\value{page}=3}{\insertpagea}{%
>                                                
> \ifthenelse{\value{page}=4}{\insertpageb}{%
>                                                 \afterpage{\incpage}}}}
> \afterpage{\incpage}
> \begin{document}
> .
> .
> .
> \end{document}
> 
> I am not sure if this could be done at a different level also, maybe
> with texexec or something.  I basically have a requirement to insert
> content into a document on a specific page.  After doing so the table of
> contents must still be correct. 
> 
> I am still fairly new in the Tex world so any help you can give will be
> very much appreciated.
> 
> Paul
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> ntg-context mailing list
> ntg-context@ntg.nl
> http://www.ntg.nl/mailman/listinfo/ntg-context

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

* Re: afterpage
  2006-08-28 20:35 ` afterpage Peter Rolf
@ 2006-08-28 20:55   ` Hans Hagen
  2006-08-28 21:17     ` afterpage Peter Rolf
  2006-08-28 21:46     ` afterpage Paul Jones
  0 siblings, 2 replies; 5+ messages in thread
From: Hans Hagen @ 2006-08-28 20:55 UTC (permalink / raw)


Peter Rolf wrote:
> Hi Paul,
>
> Paul Jones wrote:
>   
>> Hello,
>>
>> I have used Latex in the past and have the following code that inserts
>> information on certain pages using afterpage.  Is there some way to do a
>> similar thing in context?
>>
>>     
>
> \setupoutput[pdf]
> \definelayer[info]
>
> \setuplayer[info]
>   [height=\paperheight,width=\paperwidth]
>
> \setupbackgrounds[page]
>   [background={text,info}]% info layer is above normal text layer
>
> \def\WhichPage#1{%
>   \def\docommand##1{\ifnum\pageno=##1\relax
>     \setlayerframed[info][x=20mm,y=\dimexpr\paperheight-15mm,location=r]
>     [background=color,backgroundcolor=white]
>       {\tfb This page is inserted on page \number\pageno}\fi}%
>     \rawprocesscommalist[#1]\docommand}%
>   
...

lemme show you a few tricks:

(1) test for a number in a set (use \expanded{\doifinset....} if in doubt)
(2) use the rightbottom as preset

\def\WhichPage#1%
  {\doifinset{\realfolio}{#1}
     {\setlayerframed
        [info]
        [preset=rightbottom,x=20mm,y=15mm]
        [background=color,backgroundcolor=white]
        {\tfb This page is inserted on page \realfolio}%
       }}


\def\WhichPage#1%
  {\doifinset{\realfolio}{#1}
     {\setlayerframed
        [info]
        [preset=rightbottom,x=20mm,y=15mm]
        [background=color,backgroundcolor=white]
        {\tfb This page is inserted on page \realfolio}%
       }}

or cleaner (no macro and args involved):

\startsetups [at some pages]

  \setlayerframed
    [info]
    [preset=rightbottom,x=20mm,y=15mm]
    [background=color,backgroundcolor=white]
    {\tfb This page is inserted on page \realfolio}

\stopsetups 

\setupheadertexts[\doifinset{\realfolio}{3,4}{\directsetup{at some pages}}]

now, this inserts *as overlay*

however if one wants to insert something after a specific page, there is

% \startpostponing [pagenumber] [+pageoffset]
%
% \startpostponing[2]
%   PAGE 2 \blank
% \stoppostponing
%
% \startpostponing[+1]
%   PAGE +1 \blank
% \stoppostponing
%
% \startpostponing[+2]
%   PAGE +2 \blank
% \stoppostponing
%
% \starttext \dorecurse{4}{\input tufte \page} \stoptext


Hans



-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                             | www.pragma-pod.nl
-----------------------------------------------------------------

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

* Re: afterpage
  2006-08-28 20:55   ` afterpage Hans Hagen
@ 2006-08-28 21:17     ` Peter Rolf
  2006-08-28 21:46     ` afterpage Paul Jones
  1 sibling, 0 replies; 5+ messages in thread
From: Peter Rolf @ 2006-08-28 21:17 UTC (permalink / raw)


Hans Hagen wrote:
> Peter Rolf wrote:
>> Hi Paul,
>>
>> Paul Jones wrote:
>>   
>>> Hello,
>>>
>>> I have used Latex in the past and have the following code that inserts
>>> information on certain pages using afterpage.  Is there some way to do a
>>> similar thing in context?
>>>
>>>     
>> \setupoutput[pdf]
>> \definelayer[info]
>>
>> \setuplayer[info]
>>   [height=\paperheight,width=\paperwidth]
>>
>> \setupbackgrounds[page]
>>   [background={text,info}]% info layer is above normal text layer
>>
>> \def\WhichPage#1{%
>>   \def\docommand##1{\ifnum\pageno=##1\relax
>>     \setlayerframed[info][x=20mm,y=\dimexpr\paperheight-15mm,location=r]
>>     [background=color,backgroundcolor=white]
>>       {\tfb This page is inserted on page \number\pageno}\fi}%
>>     \rawprocesscommalist[#1]\docommand}%
>>   
> ...
> 
> lemme show you a few tricks:
> 
> (1) test for a number in a set (use \expanded{\doifinset....} if in doubt)
> (2) use the rightbottom as preset
>
> \def\WhichPage#1%
>   {\doifinset{\realfolio}{#1}
>      {\setlayerframed
>         [info]
>         [preset=rightbottom,x=20mm,y=15mm]
>         [background=color,backgroundcolor=white]
>         {\tfb This page is inserted on page \realfolio}%
>        }}
> 
> 
> \def\WhichPage#1%
>   {\doifinset{\realfolio}{#1}
>      {\setlayerframed
>         [info]
>         [preset=rightbottom,x=20mm,y=15mm]
>         [background=color,backgroundcolor=white]
>         {\tfb This page is inserted on page \realfolio}%
>        }}
> 
> or cleaner (no macro and args involved):
> 
> \startsetups [at some pages]
> 
>   \setlayerframed
>     [info]
>     [preset=rightbottom,x=20mm,y=15mm]
>     [background=color,backgroundcolor=white]
>     {\tfb This page is inserted on page \realfolio}
> 
> \stopsetups 
> 
> \setupheadertexts[\doifinset{\realfolio}{3,4}{\directsetup{at some pages}}]
> 
> now, this inserts *as overlay*
>
This is much better. Thank you! :)

> however if one wants to insert something after a specific page, there is
>
Oeps, this is what \afterpage does....sorry Paul for the wrong answer ;)

Peter

> % \startpostponing [pagenumber] [+pageoffset]
> %
> % \startpostponing[2]
> %   PAGE 2 \blank
> % \stoppostponing
> %
> % \startpostponing[+1]
> %   PAGE +1 \blank
> % \stoppostponing
> %
> % \startpostponing[+2]
> %   PAGE +2 \blank
> % \stoppostponing
> %
> % \starttext \dorecurse{4}{\input tufte \page} \stoptext
> 
> 
> Hans
> 
> 
> 
> -----------------------------------------------------------------
>                                           Hans Hagen | PRAGMA ADE
>               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>      tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
>                                              | www.pragma-pod.nl
> -----------------------------------------------------------------
> 
> _______________________________________________
> ntg-context mailing list
> ntg-context@ntg.nl
> http://www.ntg.nl/mailman/listinfo/ntg-context
> 
> 

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

* Re: afterpage
  2006-08-28 20:55   ` afterpage Hans Hagen
  2006-08-28 21:17     ` afterpage Peter Rolf
@ 2006-08-28 21:46     ` Paul Jones
  1 sibling, 0 replies; 5+ messages in thread
From: Paul Jones @ 2006-08-28 21:46 UTC (permalink / raw)



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

On 8/28/06, Hans Hagen <pragma@wxs.nl> wrote:
>
> Peter Rolf wrote:
> > Hi Paul,
> >
> > Paul Jones wrote:
> >
> >> Hello,
> >>
> >> I have used Latex in the past and have the following code that inserts
> >> information on certain pages using afterpage.  Is there some way to do
> a
> >> similar thing in context?
> >>
> >>
> >
> > \setupoutput[pdf]
> > \definelayer[info]
> >
> > \setuplayer[info]
> >   [height=\paperheight,width=\paperwidth]
> >
> > \setupbackgrounds[page]
> >   [background={text,info}]% info layer is above normal text layer
> >
> > \def\WhichPage#1{%
> >   \def\docommand##1{\ifnum\pageno=##1\relax
> >     \setlayerframed[info][x=20mm,y=\dimexpr\paperheight-15mm,location=r]
> >     [background=color,backgroundcolor=white]
> >       {\tfb This page is inserted on page \number\pageno}\fi}%
> >     \rawprocesscommalist[#1]\docommand}%
> >
> ...
> however if one wants to insert something after a specific page, there is
>
> % \startpostponing [pagenumber] [+pageoffset]
> %
> % \startpostponing[2]
> %   PAGE 2 \blank
> % \stoppostponing
> %
> % \startpostponing[+1]
> %   PAGE +1 \blank
> % \stoppostponing
> %
> % \startpostponing[+2]
> %   PAGE +2 \blank
> % \stoppostponing
> %
> % \starttext \dorecurse{4}{\input tufte \page} \stoptext
>
>
> Hans
>
> thank you so much.  This is exactly what I was trying to do.

paul

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

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

_______________________________________________
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context

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

end of thread, other threads:[~2006-08-28 21:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-08-28 17:19 afterpage Paul Jones
2006-08-28 20:35 ` afterpage Peter Rolf
2006-08-28 20:55   ` afterpage Hans Hagen
2006-08-28 21:17     ` afterpage Peter Rolf
2006-08-28 21:46     ` afterpage Paul Jones

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).