ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Header background won't go away
@ 2005-03-15 19:18 Duncan Hothersall
  2005-03-16 21:46 ` Hans Hagen
  0 siblings, 1 reply; 5+ messages in thread
From: Duncan Hothersall @ 2005-03-15 19:18 UTC (permalink / raw)


Hi all.

I have a book with parts and chapters, which wants a tint in the 
background of the header line. I have the following set-up producing 
almost what I want (apologies for the length but I've stripped out as 
much as I can to still show the same effect):

--
\setupsectionblock[bodypart][page=right]
%...
\setuppagenumbering[alternative=doublesided]
\setuplayout[location=doublesided,
         backspace=8.5pc,topspace=5.5pc,top=0pt,topdistance=0pt,
         header=12pt,headerdistance=12pt,height=61pc,footer=16pt,
	bottom=6pc,leftedge=9pc,leftedgedistance=0pt,leftmargin=0pt,
	leftmargindistance=0pt,width=29pc,rightmargindistance=0pt,
	rightmargin=6.5pc,rightedgedistance=0pt,rightedge=6.5pc]
\setuphead[part]
      [placehead=yes,command=\XPart,resetnumber=no,page=right,
       header=high,before=,after=]
\def\XPart#1#2{#1 #2} %simplified
\setuphead[chapter]
      [command=\XChapter,header=high,
       before=\vbox to 14pc\bgroup,after=\vss\egroup]
\def\XChapter#1#2{#1 #2} %simplified
%...
\setupcolors[rgb=no,cmyk=no,spot=yes,state=start]
\definecolor[PantoneTwoNineFour][c=1,m=.56,y=0,k=.18]
\definecolor[IFSblueheadertint][PantoneTwoNineFour][p=.12]
%...
\setupbackgrounds[header]
      [leftedge,leftmargin,text,rightmargin,rightedge]
      [background=color,backgroundcolor=IFSblueheadertint,state=start]
\setupheader[state=start]
\setupheadertexts[margin]
	[]
	[\hfill\llap{\tfx\getmarking[chapter][current]}]
	[\hbox to \leftmarginwidth{\rlap{\tfx\getmarking[section][last]\hfil}}]
	[]
%...
\starttext
\startbodymatter
\part{First part}
Looks good, but still has band on next page
\chapter{First chapter}
Looks good, no band on first page of chapter. \page[yes]
\section{First section}
Looks good, the band is there. \page[yes]
\section{Second section}
Looks good, the band is still there.
\chapter{Second chapter}
Ugh, the band has impinged on my title, and I'm getting an extra odd 
page at the end too.
\stopbodymatter
\stoptext
--

The above code runs in live.contextgarden.net and demonstrates my 
problems, which are:

1. The big problem - the second chapter title page doesn't suppress the 
band, even though the first one did. NB this behaviour seems to change 
depending on whether the previous chapter ends on an odd or even page. 
Bug, or incorrect header setup?

2. Empty pages (like the back of the part title) have the colour band on 
them - how can this be suppressed for empty pages?

3. There's an extra odd page at the end (I've tried a few of the 
suggested fixes for this but can't get them to work).

If anyone can answer, especially question 1, I'd be really grateful!

Thanks,

Duncan
dh@capdm.com

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

* Re: Header background won't go away
  2005-03-15 19:18 Header background won't go away Duncan Hothersall
@ 2005-03-16 21:46 ` Hans Hagen
  0 siblings, 0 replies; 5+ messages in thread
From: Hans Hagen @ 2005-03-16 21:46 UTC (permalink / raw)


Duncan Hothersall wrote:
> Hi all.
> 
> I have a book with parts and chapters, which wants a tint in the 
> background of the header line. I have the following set-up producing 
> almost what I want (apologies for the length but I've stripped out as 
> much as I can to still show the same effect):
> 
> -- 
> \setupsectionblock[bodypart][page=right]
> %...
> \setuppagenumbering[alternative=doublesided]
> \setuplayout[location=doublesided,
>         backspace=8.5pc,topspace=5.5pc,top=0pt,topdistance=0pt,
>         header=12pt,headerdistance=12pt,height=61pc,footer=16pt,
>     bottom=6pc,leftedge=9pc,leftedgedistance=0pt,leftmargin=0pt,
>     leftmargindistance=0pt,width=29pc,rightmargindistance=0pt,
>     rightmargin=6.5pc,rightedgedistance=0pt,rightedge=6.5pc]
> \setuphead[part]
>      [placehead=yes,command=\XPart,resetnumber=no,page=right,
>       header=high,before=,after=]
> \def\XPart#1#2{#1 #2} %simplified
> \setuphead[chapter]
>      [command=\XChapter,header=high,
>       before=\vbox to 14pc\bgroup,after=\vss\egroup]
> \def\XChapter#1#2{#1 #2} %simplified
> %...
> \setupcolors[rgb=no,cmyk=no,spot=yes,state=start]
> \definecolor[PantoneTwoNineFour][c=1,m=.56,y=0,k=.18]
> \definecolor[IFSblueheadertint][PantoneTwoNineFour][p=.12]
> %...
> \setupbackgrounds[header]
>      [leftedge,leftmargin,text,rightmargin,rightedge]
>      [background=color,backgroundcolor=IFSblueheadertint,state=start]
> \setupheader[state=start]
> \setupheadertexts[margin]
>     []
>     [\hfill\llap{\tfx\getmarking[chapter][current]}]
>     [\hbox to \leftmarginwidth{\rlap{\tfx\getmarking[section][last]\hfil}}]
>     []
> %...
> \starttext
> \startbodymatter
> \part{First part}
> Looks good, but still has band on next page
> \chapter{First chapter}
> Looks good, no band on first page of chapter. \page[yes]
> \section{First section}
> Looks good, the band is there. \page[yes]
> \section{Second section}
> Looks good, the band is still there.
> \chapter{Second chapter}
> Ugh, the band has impinged on my title, and I'm getting an extra odd 
> page at the end too.
> \stopbodymatter
> \stoptext
> -- 
> 
> The above code runs in live.contextgarden.net and demonstrates my 
> problems, which are:
> 
> 1. The big problem - the second chapter title page doesn't suppress the 
> band, even though the first one did. NB this behaviour seems to change 
> depending on whether the previous chapter ends on an odd or even page. 
> Bug, or incorrect header setup?
> 
> 2. Empty pages (like the back of the part title) have the colour band on 
> them - how can this be suppressed for empty pages?
> 
> 3. There's an extra odd page at the end (I've tried a few of the 
> suggested fixes for this but can't get them to work).
> 
> If anyone can answer, especially question 1, I'd be really grateful!

you can do a stepwise page change:

   \setuphead[part][page={yes,blank,right}]
   \setuphead[chapter][header=high,page={yes,blank,right}]

also, in order to let backgrounds adapt to each page, say:

   \setupbackgrounds[state=repeat]

otherwise only text|page backgrounds will be calculated each page and the other 
ones when backgrounds are set/changed (otherwise too slow)

Hans

(some day i'll make this nicer)


-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------

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

* Re: Header background won't go away
  2005-03-17  9:25 ` Duncan Hothersall
  2005-03-17  9:34   ` Hans Hagen
@ 2005-03-17  9:46   ` Duncan Hothersall
  1 sibling, 0 replies; 5+ messages in thread
From: Duncan Hothersall @ 2005-03-17  9:46 UTC (permalink / raw)


>> Thanks Hans, fixes problem 2, but 1 remains.
>>
>> So this is maybe a bug?
> 
> you forgot \setupbackgrounds[state=repeat]

Ach. I tried adding it to my \setupbackgrounds[header] command not 
realising that it needed to be on its own. Sorry for the noise. Your 
solution worked in its entirety. Thank you very much!

Duncan

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

* Re: Header background won't go away
  2005-03-17  9:25 ` Duncan Hothersall
@ 2005-03-17  9:34   ` Hans Hagen
  2005-03-17  9:46   ` Duncan Hothersall
  1 sibling, 0 replies; 5+ messages in thread
From: Hans Hagen @ 2005-03-17  9:34 UTC (permalink / raw)


Duncan Hothersall wrote:

> Thanks Hans, fixes problem 2, but 1 remains.
> 
> So this is maybe a bug?

you forgot \setupbackgrounds[state=repeat]

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------

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

* Re: Header background won't go away
       [not found] <20050317081040.DFE97128D3@ronja.ntg.nl>
@ 2005-03-17  9:25 ` Duncan Hothersall
  2005-03-17  9:34   ` Hans Hagen
  2005-03-17  9:46   ` Duncan Hothersall
  0 siblings, 2 replies; 5+ messages in thread
From: Duncan Hothersall @ 2005-03-17  9:25 UTC (permalink / raw)


Hans wrote:

> you can do a stepwise page change:
> 
>    \setuphead[part][page={yes,blank,right}]
>    \setuphead[chapter][header=high,page={yes,blank,right}]
> 
> also, in order to let backgrounds adapt to each page, say:
> 
>    \setupbackgrounds[state=repeat]
> 
> otherwise only text|page backgrounds will be calculated each page and the other 
> ones when backgrounds are set/changed (otherwise too slow)
> 
> Hans
> 
> (some day i'll make this nicer)

Thanks Hans, fixes problem 2, but 1 remains.

So this is maybe a bug?

This is my test file now:

--
\setuppagenumbering[alternative=doublesided]
\setuplayout[location=doublesided,
          backspace=8.5pc,topspace=5.5pc,top=0pt,topdistance=0pt,
          header=12pt,headerdistance=12pt,height=61pc,footer=16pt,
	bottom=6pc,leftedge=9pc,leftedgedistance=0pt,leftmargin=0pt,
	leftmargindistance=0pt,width=29pc,rightmargindistance=0pt,
	rightmargin=6.5pc,rightedgedistance=0pt,rightedge=6.5pc]
\setuphead[part]
       [placehead=yes,resetnumber=no,page={yes,blank,right},
        header=high,before=,after=]
\def\XPart#1#2{#1 #2} %simplified
\setuphead[chapter]
       [header=high,page={yes,blank,right},
        before=\vbox to 14pc\bgroup,after=\vss\egroup]
\def\XChapter#1#2{#1 #2} %simplified
%...
\setupcolors[rgb=no,cmyk=no,spot=yes,state=start]
\definecolor[PantoneTwoNineFour][c=1,m=.56,y=0,k=.18]
\definecolor[IFSblueheadertint][PantoneTwoNineFour][p=.12]
%...
\setupbackgrounds[header]
       [leftedge,leftmargin,text,rightmargin,rightedge]
       [background=color,backgroundcolor=IFSblueheadertint,state=start]
\setupheader[state=start]
\setupheadertexts[margin]
	[]
	[\hfill\llap{\tfx\getmarking[chapter][current]}]
	[\hbox to \leftmarginwidth{\rlap{\tfx\getmarking[section][last]\hfil}}]
	[]
%...
\starttext
\startbodymatter
\part{First part}
Looks good, and no band on next page either!
\chapter{First chapter}
Looks good, no band on first page of chapter. \page[yes]
\section{First section}
Looks good, the band is there. \page[yes]
\section{Second section}
Looks good, the band is still there.
\chapter{Second chapter}
Ugh, the band has impinged on my title again.
\stopbodymatter
\stoptext
--

Thanks,

Duncan

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

end of thread, other threads:[~2005-03-17  9:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-03-15 19:18 Header background won't go away Duncan Hothersall
2005-03-16 21:46 ` Hans Hagen
     [not found] <20050317081040.DFE97128D3@ronja.ntg.nl>
2005-03-17  9:25 ` Duncan Hothersall
2005-03-17  9:34   ` Hans Hagen
2005-03-17  9:46   ` Duncan Hothersall

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