Sometimes, in order to seperate the headertext from the text area, I need draw a line just under the headertext.
\setuppagenumbering
[location=,
alternative=doublesided]
\definepagebreak
[chapterpagebreak]
[yes,header,footer,right]
\setuphead
[chapter]
[style=\bfc,
header={empty,nomarking},
page=chapterpagebreak]
\def\pageoddoreven{%
\ifodd\pagenumber
{\getmarking[sectionnumber]\hskip1em\getmarking[section][first]}
\else
{Chapter~\getmarking[chapternumber]\hskip1em\getmarking[chapter]}
\fi}
\setupheadertexts
[text][\pageoddoreven][pagenumber]
\setupheader
[style=bold,after=\thinrule]
\starttext
\chapter{First Chapter}
this is the first chapter
\page
the second page of the first chapter
\chapter{Second Chapter}
this is the second chapter
\page
the second page of the second chapter
\stoptext
but the \thinrule
will be across the whole page, that is what I what.
I want a line that is only across the text area, not extending to the left and right margin. How can I draw this line?
Best Answer
As Timothy Li noted, Aditya's solution draws the line on every page. It is possible to define a header (or footer) that only appears on pages with content. For my purposes, I used a footer, but the following code could equally be applied to just the header: