On Sun, 11 Mar 2007 14:15:47 +1100
Robin Kirkham
Hi Wolfgang,
Many thanks for you help. I solved this problem by simply
\setuplayout[% ... , leftedge=20mm, rightedge=20mm] \setupheader[after=\hrule]
It seems that if you give only one argument to \setupheader, it applies to the whole header, including the left and right edges. So, I just extend the edges off the page (or anywhere I need -- I don't use the edges for anything else).
I'll use your \vrule idea to control the line thickness, although the \hrule default is about right anyway.
Hi Robin, you can use \hrule height xx pt|cm|... to change the rulethickness. I needed \vrule in my example because TeX was in horizontal mode where you can only use \vrule, \hrule therefore can only be used in vertical mode, you can see is depends on the current TeX if you can use \hrule or \vrule. Another thing is that your solution place the rule below the header text, my method use the headerbackground and is therefore independant from the current textstyle and size. I played with your solution and found a few problem. I think there are also problem that can appear with my solution but I had not tried to find them. \setuplayout [location=middle, leftedge=20mm, rightedge=20mm] \setuppapersize[A5][A4] %\showframe \setupheader [after=\hrule] \starttext \input knuth \page \setupheader[state=empty] \input knuth \page \setuppagenumbering[location=] \setupheader[state=start] \input knuth \stoptext Wolfgang
Thanks,
Robin
Moreover, how do you get a rule in the header that extends from the left of the left margin, right across to the right of the right margin (including the gaps in between)?
On 06/03/2007, at 10:00 PM, ntg-context-request@ntg.nl wrote:
From: Oliver Buerschaper
Date: 6 March 2007 9:19:23 PM Subject: Re: [NTG-context] Some questions about context And another question (in other topic): how we can do lines at header and footer like fancyheaders in latex?
For your headers try this:
\setupheader [text] [after=\hrule]
Hi Robin,
I tried to make something working and came to the following three methods to draw a rule under the header at the whole pagewidth.
If you use ConTeXts default layout with different margins you should use bigger values for the rulewidth than only pagewidth.
\setuplayout[location=middle,cutspace=\backspace,width=middle] %\setuppapersize[A5][A4] %\showframe
\startuseMPgraphic{headerrule} setbounds currentpicture to unitsquare xyscaled (\the\paperwidth,\the \headerheight); draw (0,0)--(\the\paperwidth,0); \stopuseMPgraphic
\defineoverlay [headerrule] [\useMPgraphic{headerrule}]
\defineoverlay [headerrule] [\vrule height\headerheight width0pt% \vrule width\paperwidth height 0.4pt\relax]
\defineoverlay [headerrule] [{\framed[width=\paperwidth,height= \headerheight,frame=off,bottomframe=on]{}}]
\setupbackgrounds [header] [text] [background=headerrule]
\starttext
\input knuth
\stoptext
Wolfgang
_______________________________________________ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context