# Re: [NTG-context] bug in latest beta?

```Hi Pablo,

Indeed the document I was talking about has been typeset with various versions
of mkiv, but now I observe that sometimes the pagebreaks are made in a very
strange way. Since I can’t make a minimal example, I put on the following link
an excerpt of the PDF document where the bad pagebreaks can be seen: ```
```

(Please see pages 19 and 32). It seems that this happens, sometimes, but as far
as I can say from my experiments the bad pagebreak happens always before a «
proclaim » which is defined as follows:

\defineenumeration[proclaim]
[text=,
before={\blank\startbackground[frame=off,leftframe=on,
rulethickness=2pt,framecolor=darkred,
background=color,
backgroundcolor=screen]},
after={\stopbackground\blank},
style=slanted,
title=yes,
titleleft=,
titleright={.},
alternative=hanging,
width=fit,
right={~},
way=bysection,
prefix=yes,
prefixsegments={chapter:section}]

Actually I found a workaround for this by changing the above definition into:

\defineenumeration[proclaim]
[text=,
before={\blank\startmarginrule[rulethickness=1pt,rulecolor=darkred]},
after={\stopmarginrule},
style=slanted,
title=yes,
titleleft=,
titleright={.},
alternative=hanging,
width=fit,
right={~},
way=bysection,
prefix=yes,
prefixsegments={chapter:section}]

However it would be better to understand why the first definition does not work
properly, in a rather random way.

Best regards: OK

> On 01 Jun 2015, at 00:16, Hans Hagen <pra...@wxs.nl> wrote:
>
> On 5/31/2015 1:56 PM, Pablo Rodriguez wrote:
>> On 05/28/2015 07:10 PM, Hans Hagen wrote:
>>> On 5/27/2015 10:38 PM, Pablo Rodriguez wrote:
>>>> [...]
>>>> Compiling it with beta from 2015.03.25 22:13, page break is fine.
>>>>
>>>> But with latest beta from 2015.05.24 12:42 (or even with beta from
>>>> 2015.05.15 11:42 includes a wrong page break. The setups for widow and
>>>> orphan lines move the two last lines to the next page.
>>>>
>>>> Could anyone confirm this bug?
>>>
>>> i wonder if it's a bug or just tex's decision ... you can use
>>>
>>> \showmakeup[penalty]
>>>
>>> and see what penalties get injected
>>>
>>> are the linebreaks identical, i.e. same hyphenation?
>>
>>
>> Hyphenation is the same in both documents.
>>
>>> btw, brokenpenalty 1 gives a different result
>>
>> Page break is wrong when any of the three values (brokenpenalty,
>> widowpenalty or clubpenalty) is 0 or above 9999.
>>
>> I replacing \subsection with \section gives the right page break:
>>
>>     \showframe\showgrid
>>     \setuplayout[setups=*lessstrict]
>>     \startsetups[*lessstrict]
>>         \setup[reset]
>>         \widowpenalty=10000
>>         \clubpenalty=10000
>>         \brokenpenalty=0
>>     \stopsetups
>>     \setupbodyfont[pagella, 12.6pt]
>>     \starttext
>>     \chapter{Quotes}
>>     \section{Zapf}
>>     \dorecurse{4}{\input zapf\par}
>>     \section{Knuth}
>>     \input knuth
>>     \stoptext
>>
>> Why does \subsection cause a different page break than \section?
>
> because there are penalties related to (sub)sections in a way that keeps them
> together but at the same time still permits breaks in case of too many
> successive ones .. and penalties determine the way the page is broken
>
> Hans
>
> -----------------------------------------------------------------
>                                          Hans Hagen | PRAGMA ADE
>              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>    tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
>                                             | 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://tex.aanhet.net
> archive  : http://foundry.supelec.fr/projects/contextrev/
> wiki     : http://contextgarden.net
> ___________________________________________________________________________________

___________________________________________________________________________________