At 2017-10-17T16:58:22+02:00, Tomas Hala wrote:
Add the following \if command:
\startfrontmatter \completecontent \ifodd\pageno\page[empty]\else\setupheadertexts[chapter][pagenumber]\fi \stopfrontmatter
Thanks, that should work. However, searching through setup-en.pdf, I
found the conditional `\doifelseoddpage {CMD} {CMD}', which is precisely
what I needed. Enclosed below is an example which is formatted as I
wanted.
1. I use `header=empty' in \setuphead [chapter], for otherwise I get a
header on the pages where a chapter begins.
2. I use \setupheadertexts twice, first before the beginning of the
front matter, and then before the beginning of the body matter, with
settings appropriate for the respective block.
3. I use `\marking [chapter] {Contents}' before \completecontent, for
otherwise I get no chapter name in the header for the ToC.
4. I use `\doifelseoddpage {\page [empty]} {}' after \completecontent,
to do what you had suggested.
Thanks again for the help.
Regards,
Raghu.
----------------------------------------------------------------------
\starttext
\setuphead
[chapter]
[page={yes,header,footer,right},
header=empty]
\setupheadertexts
[]
\setupfootertexts
[]
\setupheadertexts
[{\getmarking [chapter]}]
[\pagenumber]
[\pagenumber]
[{\getmarking [chapter]}]
\startfrontmatter
\marking [chapter] {Contents}
\completecontent
\doifelseoddpage {\page [empty]} {}
\stopfrontmatter
\setupheadertexts
[{\getmarking [sectionnumber].\ \getmarking [section]}]
[\pagenumber]
[\pagenumber]
[{Chapter \getmarking [chapternumber].\ \getmarking [chapter]}]
\startbodymatter
\dorecurse
{20}
{
\startchapter
[title=A chapter]
\startsection
[title=A section]
Some text
\stopsection
\page
\startsection
[title=A section]
Some text
\stopsection
\page
\startsection
[title=A section]
Some text
\stopsection
\stopchapter
}
\stopbodymatter
\stoptext
--
N. Raghavendra