[NTG-context] Grey background for pages belonging to last section of every chapter
Wolfgang Schuster
schuster.wolfgang at gmail.com
Fri Jan 30 20:05:01 CET 2015
> Am 30.01.2015 um 19:28 schrieb Rob Heusdens <robheus at xs4all.nl>:
>
>> Use text backgrounds.
>>
>> \definetextbackground
>> [SummaryBackground]
>> [frame=off,
>> background=color,
>> backgroundcolor=gray]
>>
>> \definehead[summary][section]
>>
>> \setuphead
>> [summary]
>> [before=,
>> beforesection={\blank\starttextbackground[SummaryBackground]},
>> aftersection={\stoptextbackground\blank}]
>>
>> \starttext
>>
>> \startsection[title=Knuth]
>>
>> \input{knuth}
>>
>> \stopsection
>>
>> \startsummary[title=Zapf]
>>
>> \input{zapf}
>>
>> \stopsummary
>>
>> \stoptext
>>
>> Wolfgang
>
> Hello Wolfgang,
>
> Your example works. After adjusting the \summary to using \startsummary,
> \stopsummary, and using your code, with only minor additions, as below:
>
> \definetextbackground
> [SummaryBackground]
> [frame=off,
> background=color,
> backgroundcolor=gray,
> backgroundoffset=2ex] % <- added
>
> \definehead[summary][section]
>
> \setuphead[summary]
> [number=no, % <- added
> style=bold, % <- added
> before=,
> beforesection={\page\starttextbackground[SummaryBackground]}, % <-
> changed \blank to \page
> aftersection={\stoptextbackground\page}] % <- changed \blank to \page
>
> I get some unwanted result. See the picture.
>
> The bold does not show up, and a small portion of the topleft corner of
> the background frame is missing....
>
> Changing bold to italic also has no effect.
>
> Something strange....
>
> Also trying with \blank instead of \page, the background then starts right
> after the previous section, and it seems the indentation causes the
> missing background on the first line.
>
> So I placed "\noindentation\page" into beforesection (replacing \blank)
> and get the background result I want, but still the bold is missing in the
> summary title, and too much whitespace appears before the section title.
>
> The title should be placed in the same position as normal text would
> appear (and as a side note: in fact I am copying a style that was used in
> a printed book that I typeset, in which each section title - except for
> the summary - is just a normal sentence (or 2) typeset bold, with the rest
> of the text appearing after the section title just as after a normal
> sentence, so no vertical space between title and first sentence of the
> section. Since it appears in the content also, I had to use section
> commands, but is this behaviour duplicatable using setuphead for section?)
>
>
> How can I adjust that?
Make a working minimal example which shows the problem because I’cant
reproduce the problems you mention.
Wolfgang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.ntg.nl/pipermail/ntg-context/attachments/20150130/5d0b7392/attachment-0001.html>
More information about the ntg-context
mailing list