ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Re: Page number in outer margin?
  2004-04-13  0:28 Page number in outer margin? John Culleton
@ 2004-04-12 21:14 ` Willi Egger
  0 siblings, 0 replies; 2+ messages in thread
From: Willi Egger @ 2004-04-12 21:14 UTC (permalink / raw)


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

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

* Page number in outer margin?
@ 2004-04-13  0:28 John Culleton
  2004-04-12 21:14 ` Willi Egger
  0 siblings, 1 reply; 2+ messages in thread
From: John Culleton @ 2004-04-13  0:28 UTC (permalink / raw)


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.
-- 
John Culleton
Able Typesetters and Indexers
http://wexfordpress.com

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

end of thread, other threads:[~2004-04-13  0:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-04-13  0:28 Page number in outer margin? John Culleton
2004-04-12 21:14 ` Willi Egger

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