ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <j.hagen@xs4all.nl>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>,
	Aditya Mahajan <adityam@umich.edu>
Subject: Re: headers again
Date: Fri, 14 Aug 2020 08:34:43 +0200	[thread overview]
Message-ID: <0c939e0f-5eaa-8425-44c8-a51e5d1a4550@xs4all.nl> (raw)
In-Reply-To: <nycvar.YAK.7.78.908.2008131942010.1544@nqv-guvaxcnq>

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 
spot)

changing something like this for sure will break something else

Hans



-- 

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

      parent reply	other threads:[~2020-08-14  6:34 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-13  0:03 jbf
2020-08-13  2:53 ` Aditya Mahajan
2020-08-13  3:35   ` jbf
2020-08-13  5:36     ` Aditya Mahajan
2020-08-13  5:57       ` jbf
2020-08-13 18:16   ` Wolfgang Schuster
2020-08-13 23:44     ` Aditya Mahajan
2020-08-14  0:28       ` jbf
2020-08-14  9:04         ` Wolfgang Schuster
2020-08-14  6:34       ` Hans Hagen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0c939e0f-5eaa-8425-44c8-a51e5d1a4550@xs4all.nl \
    --to=j.hagen@xs4all.nl \
    --cc=adityam@umich.edu \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).