[NTG-context] Problem with backgrounds and page breaks

2005-01-10 Thread Matthias Weber
Hello,
when using text background colors in enumerations, I run into a problem
whenever the enumeration appears on the beginning of a page: Then,
the background extends over some part (sometimes all) of the previous 
page.

I can manually correct this by putting a \break just before the 
enumeration, but this
is a little tedious, as I am frequently reformatting the document. 
Below is a small example.

Thanks for any help!
(TeXExec 5.2.3 , ConTeXt  ver: 2004.11.23  fmt: 2004.12.16  int: 
english  mes: english)

Matthias

%ConText
\mainlanguage   [en]
\setupcolors[state=start]
\setupcolor[rgb]
% Exercises and Activities
\definecolor[exc] [r=.94,g=.9,b=.9]
\definetextbackground
[exbackground]
[backgroundcolor=exc,
corner=round,
before=\blank,
after=\blank,
leftoffset=5pt,
rightoffset=5pt,
topoffset=5pt,
bottomoffset=5pt,
frame=on,
framecolor=darkgreen,
location=paragraph,
color=darkgreen]

\defineenumeration
[exercise]
[before={\starttextbackground[exbackground]},
after={\stoptextbackground},
way=bysection,
text=Exercise,
start=1,
location=hanging,
letter=rm]
\setuppapersize[S6][S6]
\setupbodyfont[12pt]
\starttext
\input tufte \input tufte
new line
new line
new line
\startexercise
Please explain how to get rid of the additional framed stuff on page 1.
\stopexercise
\input tufte
\stoptext
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] Problem with backgrounds and page breaks

2005-01-10 Thread Hans Hagen
Matthias Weber wrote:
[before={\starttextbackground[exbackground]},
try:
  [before={\testpage[2]\starttextbackground[exbackground]},
that way a pagebreak is forced when less than three lines are left
Hans
-
  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
-
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] Problem with backgrounds and page breaks

2005-01-10 Thread Matthias Weber
Thanks, Hans, this fixes it most of the time. But the problem still 
occurs with  one new line
less. (Example again at the bottom) :(

Matthias

On Jan 10, 2005, at 12:49 PM, Hans Hagen wrote:
Matthias Weber wrote:
[before={\starttextbackground[exbackground]},
try:
  [before={\testpage[2]\starttextbackground[exbackground]},
that way a pagebreak is forced when less than three lines are left
Hans
-
  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
-
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


\mainlanguage   [en]
\setupcolors[state=start]
\setupcolor[rgb]
% Exercises and Activities
\definecolor[exc] [r=.94,g=.9,b=.9]
\definetextbackground
[exbackground]
[backgroundcolor=exc,
corner=round,
before=\blank,
after=\blank,
leftoffset=5pt,
rightoffset=5pt,
topoffset=5pt,
bottomoffset=5pt,
frame=on,
framecolor=darkgreen,
location=paragraph,
color=darkgreen]

\defineenumeration
[exercise]
 [before={\testpage[2]\starttextbackground[exbackground]},
after={\stoptextbackground},
way=bysection,
text=Exercise,
start=1,
location=hanging,
letter=rm]
\setuppapersize[S6][S6]
\setupbodyfont[12pt]
\starttext
\input tufte \input tufte
new line
new line
%new line
\startexercise
Please explain how to get rid of the additional framed stuff on page 1.
\stopexercise
\input tufte
\stoptext
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] Problem with backgrounds and page breaks

2005-01-10 Thread Matthias Weber
Thanks, that brings it down to two problematic cases in a 400 page 
document,
and I can live with that.

Matthias

On Jan 10, 2005, at 1:57 PM, Hans Hagen wrote:
Matthias Weber wrote:
Thanks, Hans, this fixes it most of the time. But the problem still 
occurs with  one new line
less. (Example again at the bottom) :(
in your case the testpage should test for 3 lines, because you have 
5pt margin +  a blank before it

\testpage[3]
actually the best solution is when i start introducing special 
background options (no time for that now, o for the moment use the 
testpage); that way i can  hook it in the righ tplace

Hans
-
  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
-
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context

___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context