Thanks a lot Hans for your quick reply! I confirm that
\setupalign[tolerant] solves the second point.

I am still facing the first issue when moving the start of the highlight so
that it starts on the (updated) last line of the first page. Is there
something I am doing incorrectly?

```
\setuppapersize[A7]

\setupalign[tolerant]

\definetextbackground[highlight][
   background=color,
   backgroundcolor=yellow,
]

\starttext
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
commodo consequat. Duis aute irure dolor in reprehenderit in voluptate
velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat
\highlight{cupidatat non proident, sunt in culpa qui officia deserunt
mollit anim id est laborum.}
\stoptext
```

Cheers,
Florent

Le mer. 18 févr. 2026 à 12:32, Hans Hagen via ntg-context <
[email protected]> a écrit :

> On 2/18/2026 1:14 PM, Florent Michel wrote:
> > Hi,
> >
> > I am facing two minor issues with text backgrounds, both demonstrated in
> > the example below:
> > * If the background starters in the middle of the last line of a page,
> > the highlight extends down the end of the page in a full horizontal
> > line. (See end of page 1 in the output.)
> > * It seems that characters extending into the margin are not
> > highlighted. (See ‘anim’ on page 2 in the output.)
> >
> > Is there a way to change the behaviour of the text background to correct
> > the above two points?
> >
> > ```
> > \setuppapersize[A7]
> >
> > \definetextbackground[highlight][
> >    background=color,
> >    backgroundcolor=yellow,
> > ]
> >
> > \starttext
> > Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
> > tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
> > veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
> > commodo consequat. Duis aute irure dolor in reprehenderit in voluptate
> > velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint
> > occaecat cupidatat non proident, sunt \highlight{in culpa qui officia
> > deserunt mollit anim id est laborum.}
> > \stoptext
>
> It doesn't extend, but it's an overfull line, use
>
> \setupalign[tolerant]
>
>
> -----------------------------------------------------------------
>                                            Hans Hagen | PRAGMA ADE
>                Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>         tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
> -----------------------------------------------------------------
>
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : [email protected] /
> https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
> webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
> archive  : https://github.com/contextgarden/context
> wiki     : https://wiki.contextgarden.net
>
> ___________________________________________________________________________________
>
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : [email protected] / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

Reply via email to