# Re: [NTG-context] Strange pagebreaks in LMTX

```Hi Wolfgang,

of background: indeed it solves the problem of incorrect page breaks, but it
seems that \setuptextbackground « leftframe=on » is not honoured, that is one
cannot say for instance:```
```
\setuptextbackground[frame=off,leftframe=on]

while using \background this would be possible.
The other issue, as you pointed out is the way the end of \textbackground can
be controlled (even though for my case it is not an issue).

The \sidebar mechanism in order to have a vertical line on the left of each
exercise does not work properly neither, because it is difficult to control
precisely where it ends.

Best regards: OK

> On 4 Sep 2019, at 18:32, Wolfgang Schuster
> <wolfgang.schuster.li...@gmail.com> wrote:
>
> Hans Hagen schrieb am 04.09.2019 um 17:58:
>> On 9/4/2019 2:24 PM, Otared Kavian wrote:
>>> Hi all,
>>>
>>> I have a document which typesets correctly in mkiv giving a PDF file with 7
>>> pages, but the same document typeset with lmtx gives two pages with a
>>> strange pagebreak on the second page. Up to now, unfortunately, I could not
>>> create a minimal example to show this behaviour, so I put the files in the
>>> folder here:
>>>
>>>
>>>
>>> and the PDF file obtained with mkiv is here
>>>
>>>     https://www.dropbox.com/s/udbz0lulat9vum7/bug-pagebreaks-mkiv.pdf?dl=0
>>>
>>> while the one obtained with lmtx is here
>>>
>>>     https://www.dropbox.com/s/t6kge5lq8otju4y/bug-pagebreaks-lmtx.pdf?dl=0
>>>
>>> Also, the TeX file typesets correctly with lmtx, if I don't use textrules,
>>> so  I wonder whether there has been some changes in the way such textrules
>>> have to be used.
>>> As far as I can remember, two months ago the same file was typeset with
>>> lmtx without any problem.
>>>
>>> Thanks in advance for any help,
>>> Best regards: OK
>> you have some interaction between textrules and backgrounds (and that can be
>> a matter of very small differences in dimensions and rounding and such .. i
>> just don't see a quick way out) ... esp these backgrounds are an old
>> mechanism (maybe i should alias it to textbackgrounds in lmtx)
>>
>> much better is to use this:
>>
>> \definetextbackground
>>   [xx]
>>   [location=paragraph]
>>
>> \starttextbackground[xx]
>> \stoptextbackground
>>
>> can you try to use that instead? less page overflow too
>>
>> (actually i should iontegrate some title line in that)
> A limitation of textbackgrounds is the limited control over the vertical
> space at page breaks.
>
> With the old background mechanism you get the normal topoffset and
> bottomoffset values
> but with textbackgrounds you can just control the space at the end and end of
> the environment.
>
> \showframe[text][text]
>
> \starttext
>
> \dorecurse{3}{\samplefile{knuth}}
>
> \startbackground[topoffset=1em,bottomoffset=1em]
> \dorecurse{2}{\samplefile{knuth}}
> \stopbackground
>
> \dorecurse{2}{\samplefile{knuth}}
>
> \page
>
> \definetextbackground[xx][location=paragraph,frame=off,background=color,backgroundcolor=gray,topoffset=1em,bottomoffset=1em]
>
> \dorecurse{3}{\samplefile{knuth}}
>
> \starttextbackground[xx]
> \dorecurse{2}{\samplefile{knuth}}
> \stoptextbackground
>
> \dorecurse{2}{\samplefile{knuth}}
>
> \stoptext
>
> Wolfgang
>

___________________________________________________________________________________