ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Willi Egger <w.egger@boede.nl>
Subject: Re: Page number in outer margin?
Date: Mon, 12 Apr 2004 23:14:52 +0200	[thread overview]
Message-ID: <407B06CC.3090801@boede.nl> (raw)
In-Reply-To: <200404121428.26409.john@wexfordpress.com>

[-- Attachment #1: Type: text/plain, Size: 1208 bytes --]

Dear John,

I was playing with some code from the "details" manual. My intention was 
to make "thumbholes" i.e. a coloured mark with the chapter number on it 
at the edge of the page at each starting chapter. The idea is then to 
cut the pages before that mark ... Though there is certain progress I am 
unable to use the \headnumber[chapter] in a calculation to move the mark 
down the edge for each chapter until arrived at the bottom and then 
restart at the top ... (This is a wish of a bookbinder for preparing a 
manual ...)

But I was able to make your "problem" work with the same approach. 
Please refer to the attached file "bleedingpagenumber.tex". Though it 
does surely not win a price for beauty, it works. You will have to play 
with the different x and y, width and height components to move the 
pagenumber to the desired place. ...

Kind regards Willi

John Culleton wrote:
> I want to place the page number vertically centered in the 
> outer margin, with some prettyprinting. Does one do this 
> with the \setpagenumber command, the \inmargin command, or 
> some combination thereof?
> 
> I can figure out how to do it in plain TeX but I hate to 
> revert to plain just for this feature.

[-- Attachment #2: bleedingpagenumber.tex --]
[-- Type: text/plain, Size: 1893 bytes --]

% pagenumbers in the margin at half makeupheight
%
% Context file
% filename: bleedingpagenumber.tex
% W. Egger
% 12.04.2004

\setupoutput[pdftex]
\usetypescript[palatino][texnansi]
\setupbodyfont[palatino,rm,12pt]
\setuppapersize[A4][A3,portrait]
\setuplayout[location=middle]
\setupcolors[state=start]

\setuppagenumbering[state=start,location={footer,marginedge}]

\startreusableMPgraphic{Pagenumberbackground}
	path p;
	p := fullcircle scaled 50pt ;
	fill p withcolor blue;
	p := unitsquare xyscaled 50pt shifted (0,-25pt);
	fill p withcolor blue;
    setbounds currentpicture to boundingbox currentpicture leftenlarged 50pt ;
%  	draw bbox currentpicture withcolor red ;
\stopreusableMPgraphic

\defineoverlay[Pagenumberbackground]
	[\useMPgraphic{Pagenumberbackground}]

\definelayer
	[Pagenumber]
	[width=\rightmarginwidth,
	height=\rightmarginwidth]

\startsetups Pagenumber
	\setups[Pagenumber:Number]
	\setups[Pagenumber:Finish]
\stopsetups

\startsetups Pagenumber:Number

	\setlayerframed
		[Pagenumber]
		[x=1mm,
		y=50pt,
		location={right,top}]
		[width=\dimexpr(\cutspace-\rightmargindistance),
		height=\dimexpr(\cutspace-\rightmargindistance),
		foregroundcolor=yellow,
		background=Pagenumberbackground,
		frame=on,
		offset=none,
		align={middle,lohi}]
		{\framed[frame=on,
			width=.8\rightmarginwidth,
			align={left,lohi},
			offset=8pt]
			{\pagenumber}}%
\stopsetups


\startsetups Pagenumber:Finish
	\framed
	[width=\makeupwidth,
	height=\headerheight,
	background=Pagenumber,
	frame=off]
	{}
\stopsetups

\setuptexttexts[margin] [] [\setups{Pagenumber}]

\setupheadnumber[chapter][8]
\starttext
\showframe
\chapter{This is chapter no \headnumber[chapter]}
\chapter{This is chapter no \headnumber[chapter]}
\chapter{This is chapter no \headnumber[chapter]}
\chapter{This is chapter no \headnumber[chapter]}
\chapter{This is chapter no \headnumber[chapter]}

\stoptext

      reply	other threads:[~2004-04-12 21:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-13  0:28 John Culleton
2004-04-12 21:14 ` Willi Egger [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=407B06CC.3090801@boede.nl \
    --to=w.egger@boede.nl \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).