Re: [NTG-context] Disable overlay on chapter pages

2017-08-04 Thread Mikael P. Sundqvist
On Fri, Aug 4, 2017 at 9:53 AM, Hans Hagen  wrote:
> On 8/3/2017 8:11 PM, Mikael P. Sundqvist wrote:
>
>> that solves the other problem that appeared. What about the one I
>> originally posted in this thread? Is it possible to pause backgrounds
>> on chapter pages?
>
> one of the many ways ...
>
> \definelayer
>   [chapter]
>   [width=\paperwidth,
>height=\paperheight]
>
> \defineoverlay
>   [pagebackground]
>   [\directsetup{pagebackground}]
>
> \setupbackgrounds
>   [page]
>   [background=pagebackground]
>
> \startsetups pagebackground
> \doifelsemode {chapterpage} {
> \setlayer
>   [chapter]
>   [preset=middle]
>   {\scale[width=\textwidth]{CHAPTER}}
> \globaldisablemode[chapterpage]
> } {
> \setlayer
>   [chapter]
>   [preset=middle]
>   {\scale[width=\textwidth]{WHATEVER}}
> }
> \placelayer[chapter]
> \stopsetups
>
> \startsetups chapter:before
> \globalenablemode[chapterpage]
> \stopsetups
>
> \setuphead
>   [chapter]
>   [before=\setup{chapter:before}]
>
> \starttext
> \chapter{foo} test \page test
> \chapter{bar} test \page test
> \stoptext
>
> -
>   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
> ___

Many thanks! It now works as expected. Just if someone finds this
thread in the future, to get the texts into the margin, I ended up
with something like the code below.

/Mikael


\showframe

\setuppagenumbering[alternative=doublesided]

\setuplayout[
%alternative=doublesided,
location=middle,
width=10cm,
backspace=2in,
]


\definelayer
  [chapter]
  [width=\paperwidth,
   height=\paperheight,
   location=right]

\defineoverlay
  [pagebackground]
  [\directsetup{pagebackground}]

\setupbackgrounds
  [page]
  [background=pagebackground]

\startsetups pagebackground
\doifelsemode {chapterpage} {
\setlayer
  [chapter]
  [x=\dimexpr\backspace+\textwidth+\rightmargindistance\relax,
   y=3in,
   location={right,bottom}]
  {\getmarking[chapternumber]}
\globaldisablemode[chapterpage]
} {
\setlayer
  [chapter]
   [x=\dimexpr\backspace+\textwidth+\rightmargindistance\relax,
   y=3in,
   location={right,bottom}]
  {\doifrightpageelse{\getmarking[chapter]}{}}
}
\placelayer[chapter]
\stopsetups

\startsetups chapter:before
\globalenablemode[chapterpage]
\stopsetups

\define[2]\mychaptercommand{\midaligned{#2}}

\setuphead
  [chapter]
  
[align=middle,style=\tfa,align=middle,command=\mychaptercommand,before=\setup{chapter:before}]

\starttext
\chapter{foo} test \page test \page test \page test
\chapter{bar} test \page test \page test \page test


\stoptext
___
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] Disable overlay on chapter pages

2017-08-04 Thread Hans Hagen

On 8/3/2017 8:11 PM, Mikael P. Sundqvist wrote:


that solves the other problem that appeared. What about the one I
originally posted in this thread? Is it possible to pause backgrounds
on chapter pages?

one of the many ways ...

\definelayer
  [chapter]
  [width=\paperwidth,
   height=\paperheight]

\defineoverlay
  [pagebackground]
  [\directsetup{pagebackground}]

\setupbackgrounds
  [page]
  [background=pagebackground]

\startsetups pagebackground
\doifelsemode {chapterpage} {
\setlayer
  [chapter]
  [preset=middle]
  {\scale[width=\textwidth]{CHAPTER}}
\globaldisablemode[chapterpage]
} {
\setlayer
  [chapter]
  [preset=middle]
  {\scale[width=\textwidth]{WHATEVER}}
}
\placelayer[chapter]
\stopsetups

\startsetups chapter:before
\globalenablemode[chapterpage]
\stopsetups

\setuphead
  [chapter]
  [before=\setup{chapter:before}]

\starttext
\chapter{foo} test \page test
\chapter{bar} test \page test
\stoptext

-
  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] Disable overlay on chapter pages

2017-08-03 Thread Mikael P. Sundqvist
On Thu, Aug 3, 2017 at 7:29 PM, Pablo Rodriguez  wrote:
> On 08/03/2017 06:03 PM, Hans Hagen wrote:
>> [...]
>> \definemargindata
>>[margintext:chapter]
>>[margintext]
>>[width=\outermarginwidth,
>> location=outer,
>> align=flushouter]
>> [...]
>> \definemargindata[margintext:section]
>>[margintext]
>>[width=\innermarginwidth,
>> location=inner,
>> align=flushinner]
>
> Many thanks for your reply, Hans.
>
> I didn’t know that these margin widths and aligments even existed.
>
> Pablo
> --
> http://www.ousia.tk
> ___
> 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
> ___

Hi,

that solves the other problem that appeared. What about the one I
originally posted in this thread? Is it possible to pause backgrounds
on chapter pages?

/Mikael
___
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] Disable overlay on chapter pages

2017-08-03 Thread Pablo Rodriguez
On 08/03/2017 06:03 PM, Hans Hagen wrote:
> [...]
> \definemargindata
>[margintext:chapter]
>[margintext]
>[width=\outermarginwidth,
> location=outer,
> align=flushouter]
> [...]
> \definemargindata[margintext:section]
>[margintext]
>[width=\innermarginwidth,
> location=inner,
> align=flushinner]

Many thanks for your reply, Hans.

I didn’t know that these margin widths and aligments even existed.

Pablo
-- 
http://www.ousia.tk
___
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] Disable overlay on chapter pages

2017-08-03 Thread Hans Hagen

On 8/3/2017 10:35 AM, Jean-Pierre Delange wrote:

Hi Pablo,

Dealing with the sample you has given to Mikael I find a difficulty on page 2 : 
if you replace 'Foo' and 'Bar' (three letters), by 'Introduction' and 
'section', see what happen to 'section', page 2.

Here is your MWE :


  \showframe
 \setuppagenumbering[alternative=doublesided]

 \definemargindata[margintext:chapter]
 [margintext]
 [width=\rightmarginwidth, location=outer, align=flushleft]

 \defineheadalternative
 [margintext:chapter]
 [margintext]
 [margintext=margintext:chapter]

 \definemargindata[margintext:section]
 [margintext]
 [width=\leftmarginwidth, location=inner]

 \defineheadalternative
 [margintext:section]
 [margintext]
 [margintext=margintext:section]

 \setuphead[chapter]
 [alternative=margintext:chapter, style=\tf, number=no]
 \setuphead[section]
 [alternative=margintext, style=\tf, number=no]

 \starttext

 \chapter{Introduction}
 \dorecurse{15}{\section{Section}\input ward\par}

 \stoptext

- Mail original -
De: "Mikael P. Sundqvist" <mic...@gmail.com>
À: "mailing list for ConTeXt users" <ntg-context@ntg.nl>
Envoyé: Mercredi 2 Août 2017 22:33:16
Objet: Re: [NTG-context] Disable overlay on chapter pages

On Wed, Aug 2, 2017 at 10:23 PM, Henning Hraban Ramm <te...@fiee.net> wrote:

Am 2017-08-02 um 19:28 schrieb Mikael P. Sundqvist <mic...@gmail.com>:


I do not want to change the output of the chapters/sections themself.

I want to have a "running header", but in the margin rather than in
the header. I get that with the code I gave, but I want to disable it
for new chapters _on the page where the chapter begins_.


I guess this is a case for setups.

\startsetups[chapterpage]
\setupheadertexts[][][][]
\stopsetups

\setuphead[chapter][setup=chapterpage]

Something like this, I didn’t check.


\showframe

\setuplayout
  [backspace=3cm,
   margin=2cm,
   width=middle]

\setuppagenumbering
  [alternative=doublesided]

\definemargindata
  [margintext:chapter]
  [margintext]
  [width=\outermarginwidth,
   location=outer,
   align=flushouter]

\defineheadalternative
  [margintext:chapter]
  [margintext]
  [margintext=margintext:chapter]

\definemargindata[margintext:section]
  [margintext]
  [width=\innermarginwidth,
   location=inner,
   align=flushinner]

\defineheadalternative
  [margintext:section]
  [margintext]
  [margintext=margintext:section]

\setuphead
  [chapter]
  [alternative=margintext:chapter,
   style=\tf,
   number=no]

\setuphead
  [section]
  [alternative=margintext,
   style=\tf,
   number=no]

\starttext

\chapter{Introduction}

\dorecurse{15}{\section{Section}\input ward\par}

\stoptext

-
  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] Disable overlay on chapter pages

2017-08-03 Thread Jean-Pierre Delange
Hi Pablo,

Dealing with the sample you has given to Mikael I find a difficulty on page 2 : 
if you replace 'Foo' and 'Bar' (three letters), by 'Introduction' and 
'section', see what happen to 'section', page 2.

Here is your MWE :


 \showframe
\setuppagenumbering[alternative=doublesided]

\definemargindata[margintext:chapter]
[margintext]
[width=\rightmarginwidth, location=outer, align=flushleft]

\defineheadalternative
[margintext:chapter]
[margintext]
[margintext=margintext:chapter]

\definemargindata[margintext:section]
[margintext]
[width=\leftmarginwidth, location=inner]

\defineheadalternative
[margintext:section]
[margintext]
[margintext=margintext:section]

\setuphead[chapter]
[alternative=margintext:chapter, style=\tf, number=no]
\setuphead[section]
[alternative=margintext, style=\tf, number=no]

\starttext

\chapter{Introduction}
\dorecurse{15}{\section{Section}\input ward\par}

\stoptext

- Mail original -
De: "Mikael P. Sundqvist" <mic...@gmail.com>
À: "mailing list for ConTeXt users" <ntg-context@ntg.nl>
Envoyé: Mercredi 2 Août 2017 22:33:16
Objet: Re: [NTG-context] Disable overlay on chapter pages

On Wed, Aug 2, 2017 at 10:23 PM, Henning Hraban Ramm <te...@fiee.net> wrote:
> Am 2017-08-02 um 19:28 schrieb Mikael P. Sundqvist <mic...@gmail.com>:
>
>> I do not want to change the output of the chapters/sections themself.
>>
>> I want to have a "running header", but in the margin rather than in
>> the header. I get that with the code I gave, but I want to disable it
>> for new chapters _on the page where the chapter begins_.
>
> I guess this is a case for setups.
>
> \startsetups[chapterpage]
> \setupheadertexts[][][][]
> \stopsetups
>
> \setuphead[chapter][setup=chapterpage]
>
> Something like this, I didn’t check.
>
>
> Greetlings, Hraban
> ---
> http://www.fiee.net
> http://wiki.contextgarden.net
> GPG Key ID 1C9B22FD
>
> ___
> 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
> ___

Thank you for your answer, Henning.

I am sorry, but it does not work. The problem is that I don't have the
marking text in the header, but in overlays in the margins. I tried to
replace your

\setupheadertexts[][][][]

inside the setup with

\setupbackgrounds[text][rightmargin][background=]

but with no luck. But maybe you are right that one should use setups.

/Mikael
___
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] Disable overlay on chapter pages

2017-08-02 Thread Mikael P. Sundqvist
On Wed, Aug 2, 2017 at 10:23 PM, Henning Hraban Ramm  wrote:
> Am 2017-08-02 um 19:28 schrieb Mikael P. Sundqvist :
>
>> I do not want to change the output of the chapters/sections themself.
>>
>> I want to have a "running header", but in the margin rather than in
>> the header. I get that with the code I gave, but I want to disable it
>> for new chapters _on the page where the chapter begins_.
>
> I guess this is a case for setups.
>
> \startsetups[chapterpage]
> \setupheadertexts[][][][]
> \stopsetups
>
> \setuphead[chapter][setup=chapterpage]
>
> Something like this, I didn’t check.
>
>
> Greetlings, Hraban
> ---
> http://www.fiee.net
> http://wiki.contextgarden.net
> GPG Key ID 1C9B22FD
>
> ___
> 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
> ___

Thank you for your answer, Henning.

I am sorry, but it does not work. The problem is that I don't have the
marking text in the header, but in overlays in the margins. I tried to
replace your

\setupheadertexts[][][][]

inside the setup with

\setupbackgrounds[text][rightmargin][background=]

but with no luck. But maybe you are right that one should use setups.

/Mikael
___
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] Disable overlay on chapter pages

2017-08-02 Thread Henning Hraban Ramm
Am 2017-08-02 um 19:28 schrieb Mikael P. Sundqvist :

> I do not want to change the output of the chapters/sections themself.
> 
> I want to have a "running header", but in the margin rather than in
> the header. I get that with the code I gave, but I want to disable it
> for new chapters _on the page where the chapter begins_.

I guess this is a case for setups.

\startsetups[chapterpage]
\setupheadertexts[][][][]
\stopsetups

\setuphead[chapter][setup=chapterpage]

Something like this, I didn’t check.


Greetlings, Hraban
---
http://www.fiee.net
http://wiki.contextgarden.net
GPG Key ID 1C9B22FD

___
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] Disable overlay on chapter pages

2017-08-02 Thread Pablo Rodriguez
On 08/02/2017 07:28 PM, Mikael P. Sundqvist wrote:
> Hi Pablo,
> 
> many thanks for your answer! I think I might have described my issue a
> bit vague. Just to clarify:
> 
> I do not want to change the output of the chapters/sections themself.
> 
> I want to have a "running header", but in the margin rather than in
> the header. I get that with the code I gave, but I want to disable it
> for new chapters _on the page where the chapter begins_.

Sorry, Mikael, I misunderstood what you needed.

I’m afraid I don’t know how to check whether you are in the chapter page
or not.

Pablo
-- 
http://www.ousia.tk
___
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] Disable overlay on chapter pages

2017-08-02 Thread Mikael P. Sundqvist
On Wed, Aug 2, 2017 at 7:21 PM, Pablo Rodriguez  wrote:
> On 08/02/2017 12:00 PM, Mikael P. Sundqvist wrote:
>> Hi,
>>
>> I'm trying to print chapter and section titles in the margins, and it
>> works fine, except that the chapter title is also printed on the same
>> page as the chapter starts, which I find unnecessary.
>
> Hi Mikael,
>
> margintext as alternative for \setuphead may be a better approach:
>
> \showframe
> \setuppagenumbering[alternative=doublesided]
>
> \definemargindata[margintext:chapter]
> [margintext]
> [width=\rightmarginwidth, location=outer, align=flushleft]
>
> \defineheadalternative
> [margintext:chapter]
> [margintext]
> [margintext=margintext:chapter]
>
> \definemargindata[margintext:section]
> [margintext]
> [width=\leftmarginwidth, location=inner]
>
> \defineheadalternative
> [margintext:section]
> [margintext]
> [margintext=margintext:section]
>
> \setuphead[chapter]
> [alternative=margintext:chapter, style=\tf, number=no]
> \setuphead[section]
> [alternative=margintext, style=\tf, number=no]
>
> \starttext
>
> \chapter{Foo}
> \dorecurse{15}{\section{Bar}\input ward\par}
>
> \stoptext
>
> All this comes from Hans replying to a question of mine some days ago
> and from the last lines from typo-mar.mkiv.
>
> I hope I got it right ;-),
>
> Pablo
>
> --
> http://www.ousia.tk
> ___
> 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
> ___

Hi Pablo,

many thanks for your answer! I think I might have described my issue a
bit vague. Just to clarify:

I do not want to change the output of the chapters/sections themself.

I want to have a "running header", but in the margin rather than in
the header. I get that with the code I gave, but I want to disable it
for new chapters _on the page where the chapter begins_.

If you have a copy of Bringhursts book, you know what I mean.

If it is still not clear what I mean please ask me to clarify it further.

/Mikael
___
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] Disable overlay on chapter pages

2017-08-02 Thread Pablo Rodriguez
On 08/02/2017 12:00 PM, Mikael P. Sundqvist wrote:
> Hi,
> 
> I'm trying to print chapter and section titles in the margins, and it
> works fine, except that the chapter title is also printed on the same
> page as the chapter starts, which I find unnecessary.

Hi Mikael,

margintext as alternative for \setuphead may be a better approach:

\showframe
\setuppagenumbering[alternative=doublesided]

\definemargindata[margintext:chapter]
[margintext]
[width=\rightmarginwidth, location=outer, align=flushleft]

\defineheadalternative
[margintext:chapter]
[margintext]
[margintext=margintext:chapter]

\definemargindata[margintext:section]
[margintext]
[width=\leftmarginwidth, location=inner]

\defineheadalternative
[margintext:section]
[margintext]
[margintext=margintext:section]

\setuphead[chapter]
[alternative=margintext:chapter, style=\tf, number=no]
\setuphead[section]
[alternative=margintext, style=\tf, number=no]

\starttext

\chapter{Foo}
\dorecurse{15}{\section{Bar}\input ward\par}

\stoptext

All this comes from Hans replying to a question of mine some days ago
and from the last lines from typo-mar.mkiv.

I hope I got it right ;-),

Pablo

-- 
http://www.ousia.tk
___
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
___