ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Background placement
@ 2006-05-22  9:57 nico
  2006-05-22 18:32 ` Aditya Mahajan
  0 siblings, 1 reply; 4+ messages in thread
From: nico @ 2006-05-22  9:57 UTC (permalink / raw)


Hello,

The placement of backgrounded text is sometimes unexpected: it forces a  
page break even if there's much room in the page to put the whole thing.  
Searching in the mailing list I've found one thread about the subject  
(http://archive.contextgarden.net/message/20051205.090518.90cc69d4.en.html),  
but playing with \setupinterlinespace as suggested doesn't help.

The problem often occurs just after a heading starting at the top of a  
page (section, enumeration title). Here is an example showing the  
behaviour:

\setuplayout[middle]
\setupcolors[state=start]

% Background
\definecolor[ScreenGray][s=.95]
\setupbackground
   [background=screen,
    frame=on,
    strut=yes,
    width=broad,
    before=\blank,
    after=\blank,
    framecolor=ScreenGray,
    align=right]

% Verbatim environment for programlisting
\definetyping[programlisting]

\setuptyping[programlisting]
             [bodyfont=small,
              before={\startbackground},
              after={\stopbackground}]

\starttext

\input tufte

\input tufte

\input tufte
\input tufte
\input tufte

\section{joke}
Here is an example:

\startprogramlisting
Some code
\stopprogramlisting

And the text continues...

\stoptext

Regards,
BG

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

* Re: Background placement
  2006-05-22  9:57 Background placement nico
@ 2006-05-22 18:32 ` Aditya Mahajan
  2006-05-22 22:29   ` nico
  0 siblings, 1 reply; 4+ messages in thread
From: Aditya Mahajan @ 2006-05-22 18:32 UTC (permalink / raw)


On Mon, 22 May 2006, nico wrote:

> The problem often occurs just after a heading starting at the top of a
> page (section, enumeration title). Here is an example showing the
> behaviour:

I had a similar problem in the past, and Hans suggested to use 
starttextbackground instead of background. background is supposed to be 
deprecated.

Try the following code and see if you get what you want.

setuplayout[middle]
\setupcolors[state=start]

\definecolor[ScreenGray][s=0.95]

\definetextbackground[listing]
    [backgrond=screen,
     frame=on,
     strut=yes,
     width=broad,
     location=paragraph,
     framecolor=ScreenGray,
     align=right]

\definetyping[programlisting]

\setuptyping[programlisting]
    [bodyfont=small,
     before={\starttextbackground[listing]},
     after={\stoptextbackground}]

\starttext

\input tufte

\input tufte

\input tufte
\input tufte
\input tufte

\startprogramlisting
Some code
\stopprogramlisting

and the text continues ....


\stoptext


Aditya

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

* Re: Background placement
  2006-05-22 18:32 ` Aditya Mahajan
@ 2006-05-22 22:29   ` nico
  2006-05-22 23:03     ` Hans Hagen
  0 siblings, 1 reply; 4+ messages in thread
From: nico @ 2006-05-22 22:29 UTC (permalink / raw)


On Mon, 22 May 2006 14:32:45 -0400 (EDT), Aditya Mahajan  
<adityam@umich.edu> wrote:

> On Mon, 22 May 2006, nico wrote:
>
>> The problem often occurs just after a heading starting at the top of a
>> page (section, enumeration title). Here is an example showing the
>> behaviour:
>
> I had a similar problem in the past, and Hans suggested to use
> starttextbackground instead of background. background is supposed to be
> deprecated.

Deprecated? Really?

> Try the following code and see if you get what you want.
>
> setuplayout[middle]
> \setupcolors[state=start]
>
> \definecolor[ScreenGray][s=0.95]
>
> \definetextbackground[listing]

Yes, thanks, it works (this time I haven't the weird behaviour I had some  
time ago with textbackground... strange). But it's time consuming and  
looks then as an overkill solution. To build a 400p book (on a slow  
machine, it's true):

- It takes 396s with background,
- It takes 539s with textbackground, and I've 260 MP graph files generated!

Regards,
BG

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

* Re: Background placement
  2006-05-22 22:29   ` nico
@ 2006-05-22 23:03     ` Hans Hagen
  0 siblings, 0 replies; 4+ messages in thread
From: Hans Hagen @ 2006-05-22 23:03 UTC (permalink / raw)


nico wrote:
> On Mon, 22 May 2006 14:32:45 -0400 (EDT), Aditya Mahajan  
> <adityam@umich.edu> wrote:
>
>   
>> On Mon, 22 May 2006, nico wrote:
>>
>>     
>>> The problem often occurs just after a heading starting at the top of a
>>> page (section, enumeration title). Here is an example showing the
>>> behaviour:
>>>       
>> I had a similar problem in the past, and Hans suggested to use
>> starttextbackground instead of background. background is supposed to be
>> deprecated.
>>     
>
> Deprecated? Really?
>
>   
>> Try the following code and see if you get what you want.
>>
>> setuplayout[middle]
>> \setupcolors[state=start]
>>
>> \definecolor[ScreenGray][s=0.95]
>>
>> \definetextbackground[listing]
>>     
>
> Yes, thanks, it works (this time I haven't the weird behaviour I had some  
> time ago with textbackground... strange). But it's time consuming and  
> looks then as an overkill solution. To build a 400p book (on a slow  
> machine, it's true):
>
> - It takes 396s with background,
> - It takes 539s with textbackground, and I've 260 MP graph files generated!
>   
runtime? if so, try --automp

-- 

-----------------------------------------------------------------
                                          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] 4+ messages in thread

end of thread, other threads:[~2006-05-22 23:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-05-22  9:57 Background placement nico
2006-05-22 18:32 ` Aditya Mahajan
2006-05-22 22:29   ` nico
2006-05-22 23:03     ` Hans Hagen

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