[NTG-context] headers again

Hans Hagen j.hagen at xs4all.nl
Fri Aug 14 08:34:43 CEST 2020

On 8/14/2020 1:44 AM, Aditya Mahajan wrote:
> On Thu, 13 Aug 2020, Wolfgang Schuster wrote:
>> Aditya Mahajan schrieb am 13.08.2020 um 04:53:
>>> On Thu, 13 Aug 2020, jbf wrote:
>>>> Where running heads (headers) are concerned, if I use \chapter I have no
>>>> problems, nor should I expect any. But because I am also using \title,
>>>> given that I need some unnumbered chapters interspersed  among them, I
>>>> run into difficulties with headers. Numbered chapters have the correct
>>>> headers, unnumbered ones (with \title) either don't have them, or do not
>>>> have the proper chapter header (they pick up the header from the
>>>> previous numbered chapter).
>>>> At the moment the only thing I have in the preamble is the expected set
>>>> of commands for the numbered chapters:
>>>>     [{\hfill\getmarking[chapter]\hfill}][]
>>>>      [{\hfill\documentvariable{metadata:title}\hfill}][]
>>>> I thought that might work for the unnumbered ones (\title), thinking
>>>> that maybe \title inherits from \chapter, but it doesn't. But no amount
>>>> of variations on the above commands (repeating them but replacing
>>>> 'chapter' with 'title'; adding [title] or just title, in the first set
>>>> of commands in various positions...) gives me the correct result.
>>>> I am assuming, of course, that there is a solution to this difficulty,
>>>> and that it may be simple. But I haven't found it. Is the problem that I
>>>> am using \title in the main body to get my unnumbered chapters? I
>>>> wouldn't think so? It produces the correct result, utlimatley, in the
>>>> TOC, Is it possible that I may have something else in my preamble that
>>>> is causing the problem? If so, I can't expect someone to 'guess' that
>>>> from outside! But at the moment I don't think that is the problem.
>>>> If not a direct solution, are there any clues someone might give me that
>>>> will lead me to finding my own solution? It would be much appreciated.
>>> A rose by any other name would smell as sweet ...
>>> \showframe
>>> \setupheadertexts[\setups{header}]
>>> \startsetups header
>>>     \getmarking[chapter]
>>> \stopsetups
>>> \starttext
>>> \startchapter[title={This is a chapter}]
>>>     \input knuth
>>>     \page
>>>     \input knuth
>>> \stopchapter
>>> \startchapter[title={This is a title}, number=no]
>>>     \input ward
>>>     \page
>>>     \input knuth
>>> \stopchapter
>>> \stoptext
>> Don't do this, unnumbered chapter still increase the counter and
>> when you add another chapter afterwards you wonder why the number
>> is wrong.
> (this reply is in jest ....)
> incrementnumber=no,
>> The correct way here is to reset the marking entries
>> at the begin of a new chapter or title with
>> \setuphead
>>    [chapter,title]
>>    [marking=reset]
> Agreed. This is a better solution. Any idea why this is not the default?

because this is all kind of tricky wrt when to reset ... chapters can 
start a new page or not ... esp in a double sided layout it can be that 
one does or doesn't do things that neeed to be reflected on a following 
page (so in a complex setup when one changes headers or other properties 
oneself, one also might have to make sure a \page happens at the right 

changing something like this for sure will break something else



                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl

More information about the ntg-context mailing list