ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* custom header/footer for 1st/other pages of section
@ 2020-08-06 15:15 Mike Cooper
  2020-08-06 20:58 ` Wolfgang Schuster
  0 siblings, 1 reply; 11+ messages in thread
From: Mike Cooper @ 2020-08-06 15:15 UTC (permalink / raw)
  To: ntg-context


[-- Attachment #1.1.1: Type: text/plain, Size: 1089 bytes --]

Hola,

I imagine this is probably simple but I can't find it...

I want the first page only of each section to have particular content in header/footer, then all the following pages to different specific content.  Right now, I am manually entering it in each section.  I'm hoping there's a way to automate this; put it into the environment file for all sections.

THANKS FOR YOUR HELP!


Mike Cooper
Technical Trainer
Murchison Drilling Schools, Inc.
2501 Juan Tabo NE
Albuquerque, NM 87112
Tel: (505) 293-6271
Fax: (505) 298-5294
Email: mike@murchisondrillingschools.com<mailto:mike@murchisondrillingschools.com>
Website: www.murchisondrillingschools.com<http://www.murchisondrillingschools.com/>
[cid:image007.jpg@01D03ADC.BD6E6850]<https://www.facebook.com/pages/Murchison-Drilling-Schools/158018484232622>  [cid:image008.jpg@01D03ADC.BD6E6850] <http://www.linkedin.com/company/murchison-drilling-schools-inc->   [cid:image009.jpg@01D03ADC.BD6E6850] <https://twitter.com/trainingmds>
Murchison Drilling Schools is now part of
[cid:image001.png@01D63515.857FD120]


[-- Attachment #1.1.2: Type: text/html, Size: 32027 bytes --]

[-- Attachment #1.2: image001.jpg --]
[-- Type: image/jpeg, Size: 812 bytes --]

[-- Attachment #1.3: image002.jpg --]
[-- Type: image/jpeg, Size: 951 bytes --]

[-- Attachment #1.4: image003.jpg --]
[-- Type: image/jpeg, Size: 937 bytes --]

[-- Attachment #1.5: image004.png --]
[-- Type: image/png, Size: 9100 bytes --]

[-- Attachment #2: Type: text/plain, Size: 493 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: custom header/footer for 1st/other pages of section
  2020-08-06 15:15 custom header/footer for 1st/other pages of section Mike Cooper
@ 2020-08-06 20:58 ` Wolfgang Schuster
  2020-08-10 21:40   ` Mike Cooper
  0 siblings, 1 reply; 11+ messages in thread
From: Wolfgang Schuster @ 2020-08-06 20:58 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Mike Cooper schrieb am 06.08.2020 um 17:15:
> Hola,
> 
> I imagine this is probably simple but I can’t find it…
> 
> I want the first page only of each section to have particular content in 
> header/footer, then all the following pages to different specific 
> content.Right now, I am manually entering it in each section.I’m hoping 
> there’s a way to automate this; put it into the environment file for all 
> sections.

Of course you can set different header/footer layouts for chapter pages.

With  \setupheadertexts and \setupfootertexts you set first the text 
which should appear on regular pages.

To have a different text on a chapter page you can use the \definetext 
command to set them (third first argument is the name of the setup and 
the second argument the location). These setups than can applied to the 
chapter with the header and footer key in \setuphead.

%%%% begin example
\setupheadertexts
   [Page \userpagenumber\ of \lastuserpagenumber]

\definetext
   [chapterheader]         % name
   [header]                 % vertical position
   [This is a chapter page] % content

\definetext
   [chapterfooter]
   [footer]
   [pagenumber]

\setuphead
   [chapter]
   [header=chapterheader,
    footer=chapterfooter]

\starttext

\dorecurse{10}
   {\expanded{\chapter{Chapter \recurselevel}}
    \dorecurse{\numexpr2*\recurselevel\relax}{\samplefile{knuth}}}

\stoptext
%%%% end example

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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: custom header/footer for 1st/other pages of section
  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 16:07     ` Wolfgang Schuster
  0 siblings, 2 replies; 11+ messages in thread
From: Mike Cooper @ 2020-08-10 21:40 UTC (permalink / raw)
  To: mailing list for ConTeXt users



> -----Original Message-----
> From: ntg-context [mailto:ntg-context-bounces@ntg.nl] On Behalf Of Wolfgang
> Schuster
> Sent: Thursday, August 06, 2020 2:58 PM
> To: mailing list for ConTeXt users
> Subject: Re: [NTG-context] custom header/footer for 1st/other pages of section
> 
> Mike Cooper schrieb am 06.08.2020 um 17:15:
> > Hola,
> >
> > I imagine this is probably simple but I can’t find it…
> >
> > I want the first page only of each section to have particular content in
> > header/footer, then all the following pages to different specific
> > content.Right now, I am manually entering it in each section.I’m hoping
> > there’s a way to automate this; put it into the environment file for all
> > sections.
> 
> Of course you can set different header/footer layouts for chapter pages.
> 
> With  \setupheadertexts and \setupfootertexts you set first the text
> which should appear on regular pages.
> 
> To have a different text on a chapter page you can use the \definetext
> command to set them (third first argument is the name of the setup and
> the second argument the location). These setups than can applied to the
> chapter with the header and footer key in \setuphead.
> 
> %%%% begin example
> \setupheadertexts
>    [Page \userpagenumber\ of \lastuserpagenumber]
> 
> \definetext
>    [chapterheader]         % name
>    [header]                 % vertical position
>    [This is a chapter page] % content
> 
> \definetext
>    [chapterfooter]
>    [footer]
>    [pagenumber]
> 
> \setuphead
>    [chapter]
>    [header=chapterheader,
>     footer=chapterfooter]
> 
> \starttext
> 
> \dorecurse{10}
>    {\expanded{\chapter{Chapter \recurselevel}}
>     \dorecurse{\numexpr2*\recurselevel\relax}{\samplefile{knuth}}}
> 
> \stoptext
> %%%% end example
> 
> Wolfgang


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!

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

Thanks again!

hasta,
Mike

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: custom header/footer for 1st/other pages of section
  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 16:07     ` Wolfgang Schuster
  1 sibling, 1 reply; 11+ messages in thread
From: Henning Hraban Ramm @ 2020-08-11  6:37 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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

Ehm... Why don’t you just use \setuphead[section][page=right] ?

Hraban
___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: custom header/footer for 1st/other pages of section
  2020-08-10 21:40   ` Mike Cooper
  2020-08-11  6:37     ` Henning Hraban Ramm
@ 2020-08-11 16:07     ` Wolfgang Schuster
  2020-08-11 17:20       ` Mike Cooper
  1 sibling, 1 reply; 11+ messages in thread
From: Wolfgang Schuster @ 2020-08-11 16:07 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Mike Cooper schrieb am 10.08.2020 um 23:40:
> 
> 
>> -----Original Message-----
>> From: ntg-context [mailto:ntg-context-bounces@ntg.nl] On Behalf Of Wolfgang
>> Schuster
>> Sent: Thursday, August 06, 2020 2:58 PM
>> To: mailing list for ConTeXt users
>> Subject: Re: [NTG-context] custom header/footer for 1st/other pages of section
>>
>> Mike Cooper schrieb am 06.08.2020 um 17:15:
>>> Hola,
>>>
>>> I imagine this is probably simple but I can’t find it…
>>>
>>> I want the first page only of each section to have particular content in
>>> header/footer, then all the following pages to different specific
>>> content.Right now, I am manually entering it in each section.I’m hoping
>>> there’s a way to automate this; put it into the environment file for all
>>> sections.
>>
>> Of course you can set different header/footer layouts for chapter pages.
>>
>> With  \setupheadertexts and \setupfootertexts you set first the text
>> which should appear on regular pages.
>>
>> To have a different text on a chapter page you can use the \definetext
>> command to set them (third first argument is the name of the setup and
>> the second argument the location). These setups than can applied to the
>> chapter with the header and footer key in \setuphead.
>>
>> %%%% begin example
>> \setupheadertexts
>>     [Page \userpagenumber\ of \lastuserpagenumber]
>>
>> \definetext
>>     [chapterheader]         % name
>>     [header]                 % vertical position
>>     [This is a chapter page] % content
>>
>> \definetext
>>     [chapterfooter]
>>     [footer]
>>     [pagenumber]
>>
>> \setuphead
>>     [chapter]
>>     [header=chapterheader,
>>      footer=chapterfooter]
>>
>> \starttext
>>
>> \dorecurse{10}
>>     {\expanded{\chapter{Chapter \recurselevel}}
>>      \dorecurse{\numexpr2*\recurselevel\relax}{\samplefile{knuth}}}
>>
>> \stoptext
>> %%%% end example
>>
>> Wolfgang
> 
> 
> 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.

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

No you can change the settings for the page break at the begin of each 
chapter to

   \setuphead
     [chapter]
     [page={yes,header,footer,right}]

which

   1. Finishes the last page of the previous chapter
   2. Disables the header and footer for the next (empty) page
   3. Adds a empty page when necessary to start the new chapter on a 
right page

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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: custom header/footer for 1st/other pages of section
  2020-08-11  6:37     ` Henning Hraban Ramm
@ 2020-08-11 17:01       ` Mike Cooper
  2020-08-11 17:14         ` Wolfgang Schuster
  0 siblings, 1 reply; 11+ messages in thread
From: Mike Cooper @ 2020-08-11 17:01 UTC (permalink / raw)
  To: mailing list for ConTeXt users



> -----Original Message-----
> From: ntg-context [mailto:ntg-context-bounces@ntg.nl] On Behalf Of Henning
> Hraban Ramm
> Sent: Tuesday, August 11, 2020 12:37 AM
> To: mailing list for ConTeXt users
> Subject: Re: [NTG-context] custom header/footer for 1st/other pages of section
> 
> > 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...
> 
> Ehm... Why don’t you just use \setuphead[section][page=right] ?
> 
> Hraban


Haha!  Well...  because I never found that approach in my searching.

But now, I'm not using it because it doesn't work for me.  I was in the middle of guessing I needed to set up doublesided or some such in order for it to work when Wolfgang's other solution came in.

Thanks for your help!

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: custom header/footer for 1st/other pages of section
  2020-08-11 17:01       ` Mike Cooper
@ 2020-08-11 17:14         ` Wolfgang Schuster
  2020-08-11 17:45           ` Mike Cooper
  0 siblings, 1 reply; 11+ messages in thread
From: Wolfgang Schuster @ 2020-08-11 17:14 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Mike Cooper schrieb am 11.08.2020 um 19:01:
> 
> 
>> -----Original Message-----
>> From: ntg-context [mailto:ntg-context-bounces@ntg.nl] On Behalf Of Henning
>> Hraban Ramm
>> Sent: Tuesday, August 11, 2020 12:37 AM
>> To: mailing list for ConTeXt users
>> Subject: Re: [NTG-context] custom header/footer for 1st/other pages of section
>>
>>> 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...
>>
>> Ehm... Why don’t you just use \setuphead[section][page=right] ?
>>
>> Hraban
> 
> 
> Haha!  Well...  because I never found that approach in my searching.
> 
> But now, I'm not using it because it doesn't work for me.  I was in the middle of guessing I needed to set up doublesided or some such in order for it to work when Wolfgang's other solution came in.

When you use "page=left" or "page=right" you need a doublesided document 
but for a singlesided document you can use "page=even" or "page=odd".


There is also another layout method which combines both. The layout is 
taken from a singlesided document which means the left and right margins 
are the same on odd and even page but checks for left or right pages 
work like in a doublesided document.

You can test this with the example below when you uncomment the second 
and third pagenumbering setup-

\setuppagenumbering
   [alternative={singlesided,doublesided}]

%\setuppagenumbering
%  [alternative=singlesided]

%\setuppagenumbering
%  [alternative=doublesided]

\setuphead
   [chapter]
   [page=right]

\showframe

\starttext

\dorecurse{3}
   {\expanded{\chapter{Chapter \recurselevel}}
    \dorecurse{4}{\samplefile{weisman}}}

\stoptext

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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: custom header/footer for 1st/other pages of section
  2020-08-11 16:07     ` Wolfgang Schuster
@ 2020-08-11 17:20       ` Mike Cooper
  2020-08-11 18:06         ` Wolfgang Schuster
  0 siblings, 1 reply; 11+ messages in thread
From: Mike Cooper @ 2020-08-11 17:20 UTC (permalink / raw)
  To: ntg-context



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

THANKS!

 
> > 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?

 
> No you can change the settings for the page break at the begin of each
> chapter to
> 
>    \setuphead
>      [chapter]
>      [page={yes,header,footer,right}]
> 
> which
> 
>    1. Finishes the last page of the previous chapter
>    2. Disables the header and footer for the next (empty) page
>    3. Adds a empty page when necessary to start the new chapter on a right page

Excited to try this once I know what to do with the sectionblock stuff.

Going to fiddle...

THANKS!!!


___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: custom header/footer for 1st/other pages of section
  2020-08-11 17:14         ` Wolfgang Schuster
@ 2020-08-11 17:45           ` Mike Cooper
  0 siblings, 0 replies; 11+ messages in thread
From: Mike Cooper @ 2020-08-11 17:45 UTC (permalink / raw)
  To: ntg-context



> -----Original Message-----
> From: Wolfgang Schuster [mailto:wolfgang.schuster.lists@gmail.com]
> Sent: Tuesday, August 11, 2020 11:15 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 11.08.2020 um 19:01:
> >
> >
> >>
> >> Ehm... Why don’t you just use \setuphead[section][page=right] ?
> >>
> >> Hraban
> >
> >
> > Haha!  Well...  because I never found that approach in my searching.
> >
> > But now, I'm not using it because it doesn't work for me.  I was in the middle of
> > guessing I needed to set up doublesided or some such in order for it to work when
> > Wolfgang's other solution came in.
> 
> When you use "page=left" or "page=right" you need a doublesided document
> but for a singlesided document you can use "page=even" or "page=odd".
> 
> 
> There is also another layout method which combines both. The layout is
> taken from a singlesided document which means the left and right margins
> are the same on odd and even page but checks for left or right pages
> work like in a doublesided document.
> 
> You can test this with the example below when you uncomment the second
> and third pagenumbering setup-
> 
> \setuppagenumbering
>    [alternative={singlesided,doublesided}]
> 
> %\setuppagenumbering
> %  [alternative=singlesided]
> 
> %\setuppagenumbering
> %  [alternative=doublesided]
> 
> \setuphead
>    [chapter]
>    [page=right]
> 
> \showframe
> 
> \starttext
> 
> \dorecurse{3}
>    {\expanded{\chapter{Chapter \recurselevel}}
>     \dorecurse{4}{\samplefile{weisman}}}
> 
> \stoptext
> 
> Wolfgang

Interesting!  Thank you!

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: custom header/footer for 1st/other pages of section
  2020-08-11 17:20       ` Mike Cooper
@ 2020-08-11 18:06         ` Wolfgang Schuster
  2020-08-20 17:37           ` Mike Cooper
  0 siblings, 1 reply; 11+ messages in thread
From: Wolfgang Schuster @ 2020-08-11 18:06 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: custom header/footer for 1st/other pages of section
  2020-08-11 18:06         ` Wolfgang Schuster
@ 2020-08-20 17:37           ` Mike Cooper
  0 siblings, 0 replies; 11+ messages in thread
From: Mike Cooper @ 2020-08-20 17:37 UTC (permalink / raw)
  To: ntg-context

Thank you Wolfgang!!

I was taken away to other work for several days and just got back to this now.

Works great!
THANKS!



> -----Original Message-----
> From: Wolfgang Schuster [mailto:wolfgang.schuster.lists@gmail.com]
> Sent: Tuesday, August 11, 2020 12:07 PM
> 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 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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2020-08-20 17:37 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-06 15:15 custom header/footer for 1st/other pages of section 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
2020-08-20 17:37           ` Mike Cooper

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