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 via email to