Hi Hans,

On Sun, 2026-02-08 at 13:34 +0100, Hans Hagen via ntg-context wrote:
> On 2/8/2026 7:34 AM, Max Chernoff via ntg-context wrote:
> > I'm using the latest version (2026.01.08 23:30), and I get the same
> > results with MkIV and LMTX. Demonstration:
>
> >      %% Define the text background
> >      \definecolor[transparent][s=1, t=0, a=1]
>
>  > \definetextbackground[bg][...]
>
> You know that you're behaving badly here, right? Overloading not only a
> rather core command but also a language.

Yeah, I probably should have picked a better name. My real document uses
a name that doesn't conflict, but I switched to a shorter name for the
MWE. I see now that the log complains about overloaded macros, so I'll
make sure to use a non-overloaded name next time.

On Sun, 2026-02-08 at 15:36 +0100, Hans Hagen via ntg-context wrote:
> On 2/8/2026 3:00 PM, Henning Hraban Ramm wrote:
> > Am 08.02.26 um 13:24 schrieb Hans Hagen via ntg-context:
> > > > Is there a different mechanism that I can use to avoid this?
> > >
> > > There always is ... if only to keep Hraban in keeping up and updating
> > > mode,
> >
> > You’re sabotaging the deadline of my book! (I can do that on my own, you
> > know… One week left and still >250 pages to go, <whine>)
> >
> > But since you attached only a .tuc file, I can’t update anything. ;-P
>
> ok, no mercy ... tex attached

That works great, thanks! The only problem is that if the background
offset is too large, then it covers up the text in the previous line:

    \definebar
      [mybar]
      [color=darkred,
       continue=yes,
       mp=mybar:round,
       order=reverse]

    \startuseMPgraphic{mybar:round}
        numeric offset; offset = 0.33 LineHeight;

        fill unitsquare
            xyscaled  (RuleWidth + 2 offset, LineHeight + 2 offset)
            shifted   (-offset, -offset - StrutDepth + RuleDepth)
            cornered  3ExHeight
            withcolor RuleColor
        ;
    \stopuseMPgraphic

    \starttext
        \samplefile{tufte}
        \mybar{\samplefile{tufte}\removeunwantedspaces}
        \samplefile{tufte}
        \mybar{some text that goes over the line bla bla bla bla bla bla bla 
bla bla bla bla}
        \samplefile{tufte}
    \stoptext

Is there an (easy) way to fix this? If not, it's fairly easy to work
around by just using a smaller offset value.

Thanks,
-- Max
___________________________________________________________________________________
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