From: Wolfgang Schuster <wolfgang.schuster.lists@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: custom header/footer for 1st/other pages of section
Date: Tue, 11 Aug 2020 20:06:52 +0200 [thread overview]
Message-ID: <23f3fb6b-b8f7-43d8-c1f7-202c142a5afa@gmail.com> (raw)
In-Reply-To: <BYAPR11MB25651B4FCD274F1D627532DABD450@BYAPR11MB2565.namprd11.prod.outlook.com>
Mike Cooper schrieb am 11.08.2020 um 19:20:
>
>
>> -----Original Message-----
>> From: Wolfgang Schuster [mailto:wolfgang.schuster.lists@gmail.com]
>> Sent: Tuesday, August 11, 2020 10:07 AM
>> To: mailing list for ConTeXt users
>> Cc: Mike Cooper
>> Subject: Re: [NTG-context] custom header/footer for 1st/other pages of section
>>
>>
>> Mike Cooper schrieb am 10.08.2020 um 23:40:
>>>
>>>
>>> Thank you Wolfgang!
>>>
>>> I tried to change your code from chapters to sections (since that's what I was
>> already using) but it didn't work. So, I switched my sections to chapters and it
>> works great! But it also caused me to run into other things I'd set up manually that
>> I'm having to figure out---good way to learn! Haha!
>>
>> You can only set header or footer settings when the section starts on a
>> new page. Permitting these two values for every section without this
>> restrictions can lead to problems because there can be cases where you
>> have different section levels on the same page and the setting from the
>> last command on the page counts.
>
> That makes sense. I wasn't really thinking of my sections as "chapters" per se. And I was forcing sections (each >5 pages) to start on new (odd) pages. But switching to chapters is fine and takes care of some other stuff I was forcing.
You don't have to use \chapter as first level section which starts on a
new page, you can do the same with \section when you use
\setuphead
[section]
[page={yes,odd}]
>>> One thing I *CANNOT* figure out: I've been using \doifoddpageelse to put in a
>> blank/empty page at the end of a section (if needed) so that new sections always
>> start on an odd page. This is still working with the change to chapters from
>> sections, EXCEPT for the first chapter (after TOC)! Totally stuck with that one...
>>
>> Let me guess you divide your document into section blocks (frontmatter,
>> bodymatter etc.).
>>
>> When this is the case you have to first disable the page setting for
>> these blocks because they interfere with the header/footer setting. To
>> disable the page breaks add
>>
>> \setupsectionblock
>> [frontpart,bodypart]
>> [page=no]
>>
>> to your document setups.
>
> How does this interact with \startsectionblockenvrironment? I found this on wiki.contextgarden.net/Table_of_Contents for suppressing header/footer on TOC. I did not specify frontmatter before, but moving the header/footer content into the environment file messed up my formerly clean TOC page. :-) So, I've currently got:
>
> \startsectionblockenvironment[frontpart]
> \setupheader[state=none]
> \setupfooter[state=none]
> \stopsectionblockenvironment
>
> Do I keep this and also include your code above? Or can both things be taken care of together somehow?
Both a different setups for different purposes.
In my setup I tell ConTeXt not to force a page break when it encounters
\startfrontmatter or \stopfrontmatter because I insert the break with
\chapter.
With the sectionblockenvironment-environment you can set a list of
settings which are inserted at the start of block, i.e. your settings
above do the same as
\startfrontmatter
\setupheader[...]
\setupfooter[...]
...
\stopfrontmatter
where I added the setting to the start of the block. The advantage of
\startsectionblockenvironment is that you have separated the layout from
the content.
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
___________________________________________________________________________________
next prev parent reply other threads:[~2020-08-11 18:06 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-06 15:15 Mike Cooper
2020-08-06 20:58 ` Wolfgang Schuster
2020-08-10 21:40 ` Mike Cooper
2020-08-11 6:37 ` Henning Hraban Ramm
2020-08-11 17:01 ` Mike Cooper
2020-08-11 17:14 ` Wolfgang Schuster
2020-08-11 17:45 ` Mike Cooper
2020-08-11 16:07 ` Wolfgang Schuster
2020-08-11 17:20 ` Mike Cooper
2020-08-11 18:06 ` Wolfgang Schuster [this message]
2020-08-20 17:37 ` Mike Cooper
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=23f3fb6b-b8f7-43d8-c1f7-202c142a5afa@gmail.com \
--to=wolfgang.schuster.lists@gmail.com \
--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).