[NTG-context] \setupheadertexts not working when text contains \subject

Bruce Horrocks ntg at scorecrow.com
Fri Jan 14 00:05:22 CET 2022


I've found an unexpected interaction between \setupheadertexts and the \subject command, and I'm hoping that someone can tell me what I'm doing wrong.

Version:  current version: 2022.01.10 08:36

I'm trying to set a book whereby
- chapter title pages have no headers
- left hand (even) pages have the chapter title in the left header and the book title in the right header
- right hand (odd) pages have the book title in the left header and the author's name in the right header

The following MWE does this perfectly provided the \subject line is commented-out. When the \subject line is included then the author name disappears - there's just a blank space in the header.

MWE:
\setuppagenumbering
  [ alternative=doublesided,
    location={footer},
  ]
\definefont [stylePageHeader] [Serif at 10pt]
  
\startsetups ChapterSetup
  \setupheadertexts
        [{\stylePageHeader {My Book}}]              [{\stylePageHeader{\structureuservariable{author}}}]
        [{\stylePageHeader{\getmarking[Chapter]}}]  [{\stylePageHeader {My Book}}]	
  \setupheader[state=empty]
\stopsetups

\definehead [Chapter] [chapter]
\setuphead[Chapter]
  [ page=right,
    number=no,
    before={\setups{ChapterSetup}},
  ]
  
\starttext
\startChapter[title={The Strange Case of the Missing Header}] [author={Bruce}]

\dorecurse{10}{
%\subject{A heading}
\input Knuth
\par
}

\stopChapter
\stoptext


—
Bruce Horrocks
Hampshire, UK



More information about the ntg-context mailing list