From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/4563 Path: main.gmane.org!not-for-mail From: Hans Hagen Newsgroups: gmane.comp.tex.context Subject: Re: Page number in "beeldmerk" Date: Fri, 20 Apr 2001 20:51:47 +0200 Sender: owner-ntg-context@let.uu.nl Message-ID: <3.0.6.32.20010420205147.009e0380@server-1> References: <3AE05862.A82AC269@jet.es> NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Trace: main.gmane.org 1035395218 26735 80.91.224.250 (23 Oct 2002 17:46:58 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 23 Oct 2002 17:46:58 +0000 (UTC) Cc: ntg-context@ntg.nl Original-To: Geert Dobbels In-Reply-To: <3AE05862.A82AC269@jet.es> Xref: main.gmane.org gmane.comp.tex.context:4563 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:4563 At 05:40 PM 4/20/01 +0200, Geert Dobbels wrote: >My problem probably is due to beginner's ignorance..... > >I need to create a document that has a predefined header on the top of >each page. The header is a square with the width of the textblock. >Within that square are 2 company logos and 2 vertical lines. The >pagenumber has to go in the right bottom side of this square and has a >format like in "page xx of yyy". > >Since the normal positioning of pagenumbers in Context does not place >this pagenumber exactly where I need it, I decided to create the whole >header as described above within a "beeldmerk" (don't know the english >name of this command). (to give a better idea of what I want, imagine >the logo on page 63 of the dutch context handleiding, appearing on every >page but with the pagenumber on the position where the pragma email >address appears in the book's example) > >As I feared, the "beeldmerk" is generated and positioned correctly, >except for the pagenumber. This number is in the correct position, is >correct on page 1 and on page 2, but stays 2 on all the pages that come >after page 2. > >Any suggestion on how to avoid that ? Use the backhgounds instead. \setuplayout [header=1cm,headerdistance=1cm] \setupbackgrounds [state=repeat] \setupbackgrounds [header][text] [background={Logos,PageNumber}] \setuppagenumbering [location=] \defineoverlay [Logos] [{\framed [width=\overlaywidth,height=\overlayheight, offset=overlay,align=right,frame=off] {\framed [width=3cm,height=1cm] {logo 1}% \hskip.5em \framed [width=3cm,height=1cm] {logo 2}% \hskip.5em \blackrule [height=1cm,width=2mm,depth=0pt]% \hskip.5em \blackrule [height=1cm,width=2mm,depth=0pt]}}] \defineoverlay [PageNumber] [{\framed [width=\overlaywidth,height=\overlayheight, align={left,low},offset=overlay,frame=off] {page {\pagenumber} of {\lastpage}}}] \starttext test \page test \page \stoptext or faster: \setuplayout [header=1cm,headerdistance=1cm] \setupbackgrounds [state=repeat] \setupheadertexts[\MyPageNumber] \setuppagenumbering [location=] \def\MyPageNumber {\framed [width=\textwidth,height=\headerheight, offset=overlay,align=right,frame=off] {\framed [width=3cm,height=1cm] {logo 1}% \hskip.5em \framed [width=3cm,height=1cm] {logo 2}% \hskip.5em \blackrule [height=1cm,width=2mm,depth=0pt]% \hskip.5em \blackrule [height=1cm,width=2mm,depth=0pt]% \hfill \framed [height=1cm, align={left,low},offset=overlay,frame=off] {page {\pagenumber} of {\lastpage}}}} \starttext test \page test \page \stoptext or faster \setuplayout [header=1cm,headerdistance=1cm] \setupbackgrounds [state=repeat] \setupheadertexts[\MyPageNumber] \setuppagenumbering [location=] \def\MyPageNumber {\vbox to \headerheight {\hbox to \textwidth {\framed[width=3cm,height=1cm]{logo 1}% \hskip.5em \framed[width=3cm,height=1cm]{logo 2}% \hskip.5em \blackrule[height=1cm,width=2mm,depth=0pt]% \hskip.5em \blackrule[height=1cm,width=2mm,depth=0pt]% \hfill page {\pagenumber} of {\lastpage}}}} \starttext test \page test \page \stoptext The alternative with frames is nice for debugging since you can turn on the frames. In the latter example you can use \ruledhbox instead of \hbox for debugging. Hans ------------------------------------------------------------------------- Hans Hagen | PRAGMA ADE | pragma@wxs.nl Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com -------------------------------------------------------------------------