ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Wolfgang Schuster <wolfgang.schuster.lists@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>,
	Aditya Mahajan <adityam@umich.edu>
Subject: Re: headers again
Date: Thu, 13 Aug 2020 20:16:40 +0200	[thread overview]
Message-ID: <19b8feec-cd19-e174-1557-cf2d2e2d5c0b@gmail.com> (raw)
In-Reply-To: <nycvar.YAK.7.78.908.2008122250500.1544@nqv-guvaxcnq>

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. 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]

Wolfgang
___________________________________________________________________________________
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-13 18:16 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 [this message]
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

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=19b8feec-cd19-e174-1557-cf2d2e2d5c0b@gmail.com \
    --to=wolfgang.schuster.lists@gmail.com \
    --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).