ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* [NTG-context] Text background starting in the middle of the last line of a page
@ 2026-02-18 12:14 Florent Michel
  2026-02-18 12:31 ` [NTG-context] " Hans Hagen via ntg-context
  0 siblings, 1 reply; 3+ messages in thread
From: Florent Michel @ 2026-02-18 12:14 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1132 bytes --]

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
```

Cheers,
Florent

[-- Attachment #1.2: Type: text/html, Size: 1191 bytes --]

[-- Attachment #2: Type: text/plain, Size: 511 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / 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
___________________________________________________________________________________

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

* [NTG-context] Re: Text background starting in the middle of the last line of a page
  2026-02-18 12:14 [NTG-context] Text background starting in the middle of the last line of a page Florent Michel
@ 2026-02-18 12:31 ` Hans Hagen via ntg-context
  2026-02-18 12:40   ` Florent Michel
  0 siblings, 1 reply; 3+ messages in thread
From: Hans Hagen via ntg-context @ 2026-02-18 12:31 UTC (permalink / raw)
  To: ntg-context; +Cc: Hans Hagen

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 : ntg-context@ntg.nl / 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
___________________________________________________________________________________

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

* [NTG-context] Re: Text background starting in the middle of the last line of a page
  2026-02-18 12:31 ` [NTG-context] " Hans Hagen via ntg-context
@ 2026-02-18 12:40   ` Florent Michel
  0 siblings, 0 replies; 3+ messages in thread
From: Florent Michel @ 2026-02-18 12:40 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 3304 bytes --]

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 <
ntg-context@ntg.nl> 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 : ntg-context@ntg.nl /
> 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
>
> ___________________________________________________________________________________
>

[-- Attachment #1.2: Type: text/html, Size: 4507 bytes --]

[-- Attachment #2: Type: text/plain, Size: 511 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / 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
___________________________________________________________________________________

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

end of thread, other threads:[~2026-02-18 12:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-18 12:14 [NTG-context] Text background starting in the middle of the last line of a page Florent Michel
2026-02-18 12:31 ` [NTG-context] " Hans Hagen via ntg-context
2026-02-18 12:40   ` Florent Michel

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