On Wed, 28 Jun 2006, Thomas Moore wrote:
Dear ConTeXt gurus:
I am not a context guru, but will still give it a shot ;)
OK, I have gotten some off-list help from Mojca, who has answered most of my questions and helped me polish the two page version of my code (thanks, Mojca!). I have included what he helped me work out below. There is one remaining problem. The first page is correct, but very subsequent page has a correct-looking header and another superimposed. The second superimposed header is not wide enough and has the wrong page number (the number of the previous page), though the page number is on the correct side. It is as if the page output command from TeX is issuing the \setups command *twice*, once before fully updating variables like \rightmarginwidth and the page number, and once after setups have been done correctly. Is this a bug, or am I doing something stupid?
Thanks for any insight, Tom
I am not sure what about the exact layout you are trying to achieve. Does this give you what you want. \setuppapersize[letter] \setuppagenumbering [alternative=doublesided,location=] \setuplayout [backspace=1.0in, topspace=0.5in, width=4.5in, height=9.5in, rightmargin=2.35in, rightmargindistance=0.15in, leftmargin=0in, leftmargindistance=0in, header=\normallineheight, headerdistance=\dimexpr0.5in-\normallineheight, footer=0in] \setupheadertexts[chapter][pagenumber][pagenumber][chapter] \setupbackgrounds[header][text][bottomframe=on,rulethickness=1pt] \starttext \chapter{Test} This is a test of some math stuff. $0 = g_{\mu\nu}dx^\nu dx^\nu$. \dorecurse{10}{\input knuth} \showlayout \stoptext Aditya
Code follows:
\usemodule[amsl] \usemodule[newmat]
\setuppapersize[letter] \setuppagenumbering [alternative=doublesided] \setuplayout [backspace=1.0in, topspace=0.5in, width=4.5in, height=9.5in, rightmargin=2.35in, rightmargindistance=0.15in, leftmargin=0in, leftmargindistance=0in, header=0.5 in, footer=0in]
\definelayer [leftpage] [hoffset=\the\dimexpr\cutspace-\leftmarginwidth-\leftmargindistance \relax, % for left pages voffset=\topspace, width=\paperwidth, height=\paperheight]
\definelayer [rightpage] [hoffset=\the\dimexpr\backspace\relax, % for right pages voffset=\topspace, width=\paperwidth, height=\paperheight]
\setupbackgrounds [leftpage] [background=leftpage] \setupbackgrounds [rightpage] [background=rightpage]
\startsetups page:setup
\setlayerframed [leftpage] [preset=lefttop] [width=\dimexpr\textwidth+\leftmarginwidth+\leftmargindistance \relax, % for left pages rulethickness=1pt, frame=off, bottomframe=on] {\pagenumber\hfill\getmarking[chapter][first]} % for left pages
\setlayerframed [rightpage] [preset=lefttop] [width=\dimexpr\textwidth+\rightmarginwidth+\rightmargindistance \relax, % for right pages rulethickness=1pt, frame=off, bottomframe=on] {\getmarking[chapter][first]\hfill\pagenumber} % for right pages
\stopsetups
\setupheadertexts [\setups{page:setup}]
\starttext \chapter{Test} This is a test of some math stuff. $0 = g_{\mu\nu}dx^\nu dx^\nu$. \dorecurse{10}{\input knuth}
\showlayout \stoptext _______________________________________________ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
-- Aditya Mahajan, EECS Systems, University of Michigan http://www.eecs.umich.edu/~adityam || Ph: 7342624008