Re: [NTG-context] headers again

2020-08-14 Thread Wolfgang Schuster

jbf schrieb am 14.08.2020 um 02:28:


I will let the people with far superior knowledge than I have work 
through this, but I am following it with interest. All I can say is 
that by adopting Aditya's solution, ensuring that for the unnumbered 
titles I also included 'number=no', the numbered chapters did 
increment correctly, after being interrupted by an unnumbered one.





\starttext

\startchapter[title={Chapter one}] \stopchapter

\startchapter[title={Chapter two},number=no] \stopchapter

\startchapter[title={Chapter three}] \stopchapter

\startchapter[title={Chapter four},number=no] \stopchapter

\startchapter[title={Chapter five}] \stopchapter

\startchapter[title={Chapter six},number=no] \stopchapter

\startchapter[title={Chapter seven}] \stopchapter

\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
___


Re: [NTG-context] headers again

2020-08-14 Thread Hans Hagen

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
___


Re: [NTG-context] headers again

2020-08-13 Thread jbf
I will let the people with far superior knowledge than I have work 
through this, but I am following it with interest. All I can say is that 
by adopting Aditya's solution, ensuring that for the unnumbered titles I 
also included 'number=no', the numbered chapters did increment 
correctly, after being interrupted by an unnumbered one.


Julian

On 14/8/20 9: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?

Aditya

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


Re: [NTG-context] headers again

2020-08-13 Thread Aditya Mahajan
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?

Aditya___
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
___


Re: [NTG-context] headers again

2020-08-13 Thread Wolfgang Schuster

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
___


Re: [NTG-context] headers again

2020-08-12 Thread jbf
Rightly so, and as I was producing such an MWE (stripping away a lot of 
other 'clutter') I found what was causing the problem. At one stage, 
trying to solve the problem, I had created a MyChapter definition and 
had left a command referencing it in the following:


\setuphead
  [chapter][header=empty,alternative=middle,style=\tfa, 
numbercommand=\groupedcommand{}{\blank[1cm]},after={\blank[3cm]},command=\MyChapter]


Give that I was now no longer using MyChapter to solve the problem, that 
command=\MyChapter was causing a conflict. I removed it and, using your 
earlier


\setupheadertexts[\setups{header}]

\startsetups header
  \getmarking[chapter]
\stopsetups

and referencing it in the \chapter or \title items, was able to achieve 
the desired result in every way, including that missing  header on one page.

Thank you.
J

On 13/8/20 3:36 pm, Aditya Mahajan wrote:

On Thu, 13 Aug 2020, jbf wrote:


Almost as perfect as Shakespeare's Juliet! Is there any reason why the header
for the Introduction, done using your approach (it is in frontmatter), does
not produce the header on the last recto page? This intro consists of 8 pages.
Page 7 does not produce the 'Introduction' header. The other relevant recto
pages are all headed 'Introduction' as they should be.

A minimal working example will help in diagnosing what is going on ...

Aditya
___
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
___

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


Re: [NTG-context] headers again

2020-08-12 Thread Aditya Mahajan
On Thu, 13 Aug 2020, jbf wrote:

> Almost as perfect as Shakespeare's Juliet! Is there any reason why the header
> for the Introduction, done using your approach (it is in frontmatter), does
> not produce the header on the last recto page? This intro consists of 8 pages.
> Page 7 does not produce the 'Introduction' header. The other relevant recto
> pages are all headed 'Introduction' as they should be.

A minimal working example will help in diagnosing what is going on ...

Aditya
___
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
___


Re: [NTG-context] headers again

2020-08-12 Thread jbf
Almost as perfect as Shakespeare's Juliet! Is there any reason why the 
header for the Introduction, done using your approach (it is in 
frontmatter), does not produce the header on the last recto page? This 
intro consists of 8 pages. Page 7 does not produce the 'Introduction' 
header. The other relevant recto pages are all headed 'Introduction' as 
they should be.


J

On 13/8/20 12:53 pm, Aditya Mahajan wrote:

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

Aditya

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


Re: [NTG-context] headers again

2020-08-12 Thread Aditya Mahajan
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

Aditya___
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
___