ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Otared Kavian <otared@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Help wanted for layers and pagebackgrounds
Date: Wed, 19 May 2010 18:21:11 +0200	[thread overview]
Message-ID: <41EE1BC8-D5A3-4F7A-AE79-674B8E454CE1@gmail.com> (raw)

Dear all,

I need to have a special layout, in which a number (which is not a page number nor a section number or such) is printed in big size on the right when the pagenumber is even (that is on a leftpage) and printed on the left when the pagenumber is odd (that is a rightpage). With the help of examples gleaned here and there in the manuals, I came up with the following minimal example:

%%%% begin
\setupcolors[state=start]
\setuppagenumbering[location=footer,alternative=doublesided]

\definelayer[NumberRight][width=\paperwidth,height=\paperheight]  
\definelayer[NumberLeft][width=\paperwidth,height=\paperheight] 

%\showframe
\define[1]\myNumber{%
	 \setlayer[NumberRight][preset=righttop,voffset=45mm,hoffset=3mm,reset] % without reset the problem is the same
		 {\offset[location=rt,rightoffset=-3mm]
		    {\tlap{\startcolor[darkgreen] 
					\switchtobodyfont[ss]
					\scale[height=30mm,width=22mm]{#1} 
				\stopcolor}
			}
		 }
		\setlayer[NumberLeft][preset=lefttop,voffset=45mm,hoffset=25mm,reset] % without reset the problem is the same
		 {\offset[location=tl,leftoffset=-3mm]
		    {\tlap{\startcolor[darkgreen] 
					\switchtobodyfont[ss]
					\scale[height=30mm,width=22mm]{#1}
				\stopcolor}
			}
		 }
	}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Maybe the problem is here?
\setupbackgrounds[leftpage] [background=NumberRight] 
\setupbackgrounds[rightpage][background=NumberLeft]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\starttext
\dorecurse{4}{\myNumber{#1}\input knuth.tex \page}
\dorecurse{4}{\myNumber{#1}\dorecurse{5}{\input knuth.tex }\page}
\stoptext
%%%%% end 

The problem is that in some cases (for instance on pages 2, 3, 4 of the above example) the big numbers are overprinted.
In particular the behavior seems not to be the same on all pages, that is after the two \dorecurse above.
I guess my lack of knowledge in using and setting layers is the cause, but can anyone tell me please what am I doing wrong?
This problem arises in a document in which I have to use mkiv, but in mkii one ha the same result.

Thanks in advance and best regards: OK
___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


             reply	other threads:[~2010-05-19 16:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-19 16:21 Otared Kavian [this message]
2010-05-20  8:14 ` Wolfgang Schuster
2010-05-20 11:17   ` Otared Kavian

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=41EE1BC8-D5A3-4F7A-AE79-674B8E454CE1@gmail.com \
    --to=otared@gmail.com \
    --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).