ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* [NTG-context] right and left arrowfill
@ 2023-06-21 20:10 Hans van der Meer via ntg-context
  2023-06-22 13:11 ` Hans Hagen via ntg-context
  0 siblings, 1 reply; 8+ messages in thread
From: Hans van der Meer via ntg-context @ 2023-06-21 20:10 UTC (permalink / raw)
  To: NTG ConTeXt; +Cc: Hans van der Meer


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

A few days ago I drew attention to the fact that \rightarrowfill and \leftarrowfill are broken in the latest ConTeXt. Imho that should not happen with basic TeX macro's.
Although one can recreate their definitions from the TeX-book (see the MWE attached), I still do not understand why it should be needed.

yours sincerely
dr. Hans van der Meer

 

[-- Attachment #1.2.1: Type: text/html, Size: 906 bytes --]

[-- Attachment #1.2.2: hboxarrowfill.tex --]
[-- Type: application/octet-stream, Size: 1014 bytes --]

\setupbodyfont[lmodern,10pt]
\starttext
Test \type{\rightarrowfill} and \type{\leftarrowfill}
\blank
\ConTeXt\ \contextversion
\blank
dotfill [\hbox to\textwidth{\dotfill}]
\blank
dotfill [\hbox to5cm{\dotfill}]
\blank
rightarrowfill [\hbox to5cm{\rightarrowfill}]
\blank
leftarrowfill [\hbox to5cm{\leftarrowfill}]
\blank
\blank
hrulefill [\hbox to5cm{\hrulefill}]
\blank
rightarrowfill = \meaning\rightarrowfill
\blank
leftarrowfill = \meaning\leftarrowfill
\blank
Redefine tex{rightarrowfill} from the \TeX-book p.357
\crlf
\def\rightarrowfill{$\mathsurround=\zeropoint \mathord- \mkern-6mu
	\cleaders\hbox{$\mkern-2mu \mathord- \mkern-2mu$}\hfill
	\mkern-6mu \mathord\rightarrow$}
rightarrowfill [\hbox to5cm{\rightarrowfill}]
\blank
Redefine tex{leftarrowfill} from the \TeX-book p.357
\def\leftarrowfill{$\mathsurround=\zeropoint \mathord\leftarrow \mkern-6mu
	\cleaders\hbox{$\mkern-2mu \mathord- \mkern-2mu$}\hfill
	\mkern-6mu \mathord-$}
\crlf
leftarrowfill [\hbox to5cm{\leftarrowfill}]
\blank
\stoptext

[-- Attachment #1.2.3: Type: text/html, Size: 212 bytes --]

[-- Attachment #1.2.4: hboxarrowfill.pdf --]
[-- Type: application/pdf, Size: 15253 bytes --]

[-- Attachment #1.2.5: Type: text/html, Size: 212 bytes --]

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

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : https://contextgarden.net
___________________________________________________________________________________

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

* Re: [NTG-context] right and left arrowfill
  2023-06-21 20:10 [NTG-context] right and left arrowfill Hans van der Meer via ntg-context
@ 2023-06-22 13:11 ` Hans Hagen via ntg-context
  2023-06-22 13:32   ` Hans van der Meer via ntg-context
  0 siblings, 1 reply; 8+ messages in thread
From: Hans Hagen via ntg-context @ 2023-06-22 13:11 UTC (permalink / raw)
  To: Hans van der Meer via ntg-context; +Cc: Hans Hagen

On 6/21/2023 10:10 PM, Hans van der Meer via ntg-context wrote:
> A few days ago I drew attention to the fact that \rightarrowfill and \leftarrowfill are broken in the latest ConTeXt. Imho that should not happen with basic TeX macro's.
> Although one can recreate their definitions from the TeX-book (see the MWE attached), I still do not understand why it should be needed.

\starttext

     x \rightarrowfill x

     x \leftarrowfill x

\stoptext

works ok here

Hans


-----------------------------------------------------------------
                                           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://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : https://contextgarden.net
___________________________________________________________________________________

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

* Re: [NTG-context] right and left arrowfill
  2023-06-22 13:11 ` Hans Hagen via ntg-context
@ 2023-06-22 13:32   ` Hans van der Meer via ntg-context
  2023-06-22 15:38     ` Hans Hagen via ntg-context
  2023-06-23 10:43     ` Carlos via ntg-context
  0 siblings, 2 replies; 8+ messages in thread
From: Hans van der Meer via ntg-context @ 2023-06-22 13:32 UTC (permalink / raw)
  To: NTG ConTeXt; +Cc: Hans van der Meer


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

\starttext
   x \rightarrowfill x

   x \leftarrowfill x

hbox to 5cm:

   y\hbox to5cm{\rightarrowfill}y

   y\hbox to5cm{\leftarrowfill}y
\stoptext

But obviously not in an dimensioned \hbox, whereas Knuth's version does that too.



> On 22 Jun 2023, at 15:11, Hans Hagen via ntg-context <ntg-context@ntg.nl> wrote:
> 
>    x \rightarrowfill x
> 
>    x \leftarrowfill x

yours sincerely
dr. Hans van der Meer



[-- Attachment #1.2.1: Type: text/html, Size: 3435 bytes --]

[-- Attachment #1.2.2: hboxarrowfill.pdf --]
[-- Type: application/pdf, Size: 8037 bytes --]

[-- Attachment #1.2.3: Type: text/html, Size: 271 bytes --]

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

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : https://contextgarden.net
___________________________________________________________________________________

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

* Re: [NTG-context] right and left arrowfill
  2023-06-22 13:32   ` Hans van der Meer via ntg-context
@ 2023-06-22 15:38     ` Hans Hagen via ntg-context
  2023-06-23 10:43     ` Carlos via ntg-context
  1 sibling, 0 replies; 8+ messages in thread
From: Hans Hagen via ntg-context @ 2023-06-22 15:38 UTC (permalink / raw)
  To: Hans van der Meer via ntg-context; +Cc: Hans Hagen

On 6/22/2023 3:32 PM, Hans van der Meer via ntg-context wrote:
> \starttext
>     x \rightarrowfill x
> 
>     x \leftarrowfill x
> 
> hbox to 5cm:
> 
>     y\hbox to5cm{\rightarrowfill}y
> 
>     y\hbox to5cm{\leftarrowfill}y
> \stoptext
> 
> But obviously not in an dimensioned \hbox, whereas Knuth's version does that too.
\permanent\protected\def\adaptive{\dowithnextbox{\adaptivecheckbox\nextbox\box\nextbox}}

y\adaptive\hbox to5cm{x\rightarrowfill x}y

y\adaptive\hbox to5cm{x\leftarrowfill x}y

will keep you occupied for a while because now you have to grep for 
adaptive

Hans


-----------------------------------------------------------------
                                           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://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : https://contextgarden.net
___________________________________________________________________________________

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

* Re: [NTG-context] right and left arrowfill
  2023-06-22 13:32   ` Hans van der Meer via ntg-context
  2023-06-22 15:38     ` Hans Hagen via ntg-context
@ 2023-06-23 10:43     ` Carlos via ntg-context
  2023-06-23 11:38       ` Hans Hagen via ntg-context
  1 sibling, 1 reply; 8+ messages in thread
From: Carlos via ntg-context @ 2023-06-23 10:43 UTC (permalink / raw)
  To: ntg-context; +Cc: Carlos

On Thu, Jun 22, 2023 at 03:32:25PM +0200, Hans van der Meer via ntg-context wrote:
> \starttext
>    x \rightarrowfill x
> 
>    x \leftarrowfill x
> 
> hbox to 5cm:
> 
>    y\hbox to5cm{\rightarrowfill}y
> 
>    y\hbox to5cm{\leftarrowfill}y
> \stoptext
> 
> But obviously not in an dimensioned \hbox, whereas Knuth's version does that too.
> 
> 
> 
> > On 22 Jun 2023, at 15:11, Hans Hagen via ntg-context <ntg-context@ntg.nl> wrote:
> > 
> >    x \rightarrowfill x
> > 
> >    x \leftarrowfill x
> 
> yours sincerely
> dr. Hans van der Meer
> 
> 

I find this interesting. I agree with Hans vdM.

So what would be the acceptable standard given an x length of a glue? 

In the above examples, it's all preset.

Is a rule of thumb — no pun intended here — to apply thereafter
a glue, in this case a \vrule that follows the box and precedes the
other glue? that is, the \rightarrowfill or \leftarrowfill?

I mean. Once you get the glues messed up, the whole box crumbles. 

How good would \meaning be here, notwithstanding the valuable info of
the macro it provides, if it can't print out, let alone source it up,
the more accurate dimension, let alone the measurement.

So, one would need to know the preset layout of the page to have an idea
about it? 

Hans H. pulled the old modified trick of 'works here'. 

Like a magician… now all of a sudden evetything works, but unlike TeX's

\hbox to 1in{\vrule \rightarrowfill \ 1in \leftarrowfill\vrule} 

or

\hbox to 1cm{\vrule \rightarrowfill \ 1cm \leftarrowfill\vrule} 

which gives an accurate description, not to mention measurement, 

a 

\vbox to 5pt{x\vrule\rightarrowfill \ x \leftarrowfill\vrule\ x}

or 

x \rightarrowfill x
x \leftarrowfill x 

or

\vbox to 3pt{x\vrule\rightarrowfill \  \leftarrowfill\vrule\ x}

\ \rightarrowfill \ 
\ \leftarrowfill \ 


in LMTX doesn't say much 

-- 
C for yourself.

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : https://contextgarden.net
___________________________________________________________________________________

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

* Re: [NTG-context] right and left arrowfill
  2023-06-23 10:43     ` Carlos via ntg-context
@ 2023-06-23 11:38       ` Hans Hagen via ntg-context
  2023-06-23 13:21         ` Carlos via ntg-context
  0 siblings, 1 reply; 8+ messages in thread
From: Hans Hagen via ntg-context @ 2023-06-23 11:38 UTC (permalink / raw)
  To: Carlos via ntg-context; +Cc: Hans Hagen

On 6/23/2023 12:43 PM, Carlos via ntg-context wrote:
> On Thu, Jun 22, 2023 at 03:32:25PM +0200, Hans van der Meer via ntg-context wrote:
>> \starttext
>>     x \rightarrowfill x
>>
>>     x \leftarrowfill x
>>
>> hbox to 5cm:
>>
>>     y\hbox to5cm{\rightarrowfill}y
>>
>>     y\hbox to5cm{\leftarrowfill}y
>> \stoptext
>>
>> But obviously not in an dimensioned \hbox, whereas Knuth's version does that too.
>>
>>
>>
>>> On 22 Jun 2023, at 15:11, Hans Hagen via ntg-context <ntg-context@ntg.nl> wrote:
>>>
>>>     x \rightarrowfill x
>>>
>>>     x \leftarrowfill x
>>
>> yours sincerely
>> dr. Hans van der Meer
>>
>> 
> 
> I find this interesting. I agree with Hans vdM.
> 
> So what would be the acceptable standard given an x length of a glue?
> 
> In the above examples, it's all preset.
> 
> Is a rule of thumb — no pun intended here — to apply thereafter
> a glue, in this case a \vrule that follows the box and precedes the
> other glue? that is, the \rightarrowfill or \leftarrowfill?
> 
> I mean. Once you get the glues messed up, the whole box crumbles.

I'm not sure how you can mess up glue so that the box is no longer a 
box. Boxes remain boxes.

> How good would \meaning be here, notwithstanding the valuable info of
> the macro it provides, if it can't print out, let alone source it up,
> the more accurate dimension, let alone the measurement.

I don't follow. Does this come from ChapGPT?

> So, one would need to know the preset layout of the page to have an idea
> about it?
> 
> Hans H. pulled the old modified trick of 'works here'.

Well, when used in a paragraph it works indeed. No trick involved. But 
as it uses a specific mechanism in an hbox you need to trigger that 
(unless you want to add overhead that will kake tex crawl).

> Like a magician… now all of a sudden evetything works, but unlike TeX's

Not sure what this refers to. Much of TeX is magick but what is bad 
about that?

> \hbox to 1in{\vrule \rightarrowfill \ 1in \leftarrowfill\vrule}
> 
> or
> 
> \hbox to 1cm{\vrule \rightarrowfill \ 1cm \leftarrowfill\vrule}
> 
> which gives an accurate description, not to mention measurement,

It depends on what you expect. First of all, your assumption that the 
arrow fill is the same as in plain tex is wrong.

(1) one can define an arrow fill using a leader that uses some (happen 
to be present in tex math fonts) glyphs: repeated minuses followed by 
some magic kern and an arrow head.

(2) You can hope that the magick kern is right and that the minus aligns 
with the arrows bar.

(3) You also assume that the math font matches the text font.

(4) Normally an arrow fill is something math anyway. Where there can 
also be something on top or below, or where it can be a top or bottom 
accent.

> a
> 
> \vbox to 5pt{x\vrule\rightarrowfill \ x \leftarrowfill\vrule\ x}
> 
> or
> 
> x \rightarrowfill x
> x \leftarrowfill x
> 
> or
> 
> \vbox to 3pt{x\vrule\rightarrowfill \  \leftarrowfill\vrule\ x}
> 
> \ \rightarrowfill \
> \ \leftarrowfill \
> 
> 
> in LMTX doesn't say much
What should it say? You get a space, an arrow and a discarded space.

That said: I think you miss a few points here:

(1) I know Hans vd Meer well and he knows ConTeXt well. He's quite 
capable of figuring out how to use advanced features and I bet he likes 
the following variant of arrows in text. Next time we meet I'll show him 
some more adaptive tricks (although I bet he can figure them out himself).

\starttext

% \setupexternalfigures
%   [location={default,global}]

% \startsetups adaptive:test
%     \setbox\usedadaptivebox\hbox to \usedadaptivewidth yoffset 
-\usedadaptivedepth \bgroup
%         \externalfigure
%           [cow.pdf]
%           [width=\usedadaptivewidth,
%            height=\dimexpr\usedadaptiveheight+\usedadaptivedepth\relax]%
%    \egroup
% \stopsetups

\startsetups adaptive:test
     \setbox\usedadaptivebox\hbox to \usedadaptivewidth yoffset .25ex 
\bgroup
         \startMPcode
             drawarrow ((0,0) -- (\the\usedadaptivewidth,0)) randomized 
(ExHeight/2);
         \stopMPcode
    \egroup
\stopsetups

\dorecurse{5}{
     \dostepwiserecurse{1}{150}{1}{%
         this~#1.##1 is~#1.##1 test~#1.##1
         {\adaptivebox[strut=yes,setups=adaptive:test]{\strut}}
     }
     \blank
}

\stoptext

(2) If someone wants a plain (or fot that matter latex) solution then 
one can use these macro packages or write a macro that mimicks 
expectations.

(3) I don't like "Hans H. pulled the old modified trick of 'works 
here'." kind of remarks because they have a rather negative undertone 
and I don't know how to read that.


Hans

-----------------------------------------------------------------
                                           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://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : https://contextgarden.net
___________________________________________________________________________________

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

* Re: [NTG-context] right and left arrowfill
  2023-06-23 11:38       ` Hans Hagen via ntg-context
@ 2023-06-23 13:21         ` Carlos via ntg-context
  2023-06-23 14:12           ` Hans Hagen via ntg-context
  0 siblings, 1 reply; 8+ messages in thread
From: Carlos via ntg-context @ 2023-06-23 13:21 UTC (permalink / raw)
  To: ntg-context; +Cc: Carlos

On Fri, Jun 23, 2023 at 01:38:23PM +0200, Hans Hagen via ntg-context wrote:
> On 6/23/2023 12:43 PM, Carlos via ntg-context wrote:
> > On Thu, Jun 22, 2023 at 03:32:25PM +0200, Hans van der Meer via ntg-context wrote:
> > > \starttext
> > >     x \rightarrowfill x
> > > 
> > >     x \leftarrowfill x
> > > 
> > > hbox to 5cm:
> > > 
> > >     y\hbox to5cm{\rightarrowfill}y
> > > 
> > >     y\hbox to5cm{\leftarrowfill}y
> > > \stoptext
> > > 
> > > But obviously not in an dimensioned \hbox, whereas Knuth's version does that too.
> > > 
> > > 
> > > 
> > > > On 22 Jun 2023, at 15:11, Hans Hagen via ntg-context <ntg-context@ntg.nl> wrote:
> > > > 
> > > >     x \rightarrowfill x
> > > > 
> > > >     x \leftarrowfill x
> > > 
> > > yours sincerely
> > > dr. Hans van der Meer
> > > 
> > > 
> > 
> > I find this interesting. I agree with Hans vdM.
> > 
> > So what would be the acceptable standard given an x length of a glue?
> > 
> > In the above examples, it's all preset.
> > 
> > Is a rule of thumb — no pun intended here — to apply thereafter
> > a glue, in this case a \vrule that follows the box and precedes the
> > other glue? that is, the \rightarrowfill or \leftarrowfill?
> > 
> > I mean. Once you get the glues messed up, the whole box crumbles.
> 
> I'm not sure how you can mess up glue so that the box is no longer a box.
> Boxes remain boxes.

I guess that's the same mentality behind a fixed glue in LMTX, while
trying not to mess up the box. Back to point A and the main reason of the
op's question. 

Then again, the only way to resemble what TeX does is by re/defining
and copied verbatim from The TeXbook  both rightarrowfill and
leftarrowfill

and unlike with TeX in which an 

\hbox to 1in{\vrule \rightarrowfill \ 1cm \leftarrowfill\vrule} 

it says 1cm but it'd be more than that, and accurately so 


> 
> > How good would \meaning be here, notwithstanding the valuable info of
> > the macro it provides, if it can't print out, let alone source it up,
> > the more accurate dimension, let alone the measurement.
> 
> I don't follow. Does this come from ChapGPT?
> 

That's funny. 

But as chatgpt says:
"Sorry about that. \meaning\rightarrowfill is 
\begingroup \scratchunicode 8594\relax \adaptivebox [mathfiller][alterna­
tive=8594]{\hss \strut \hss }\endgroup "

That's what lmtx returned after Hans vdM sample


> > So, one would need to know the preset layout of the page to have an idea
> > about it?
> > 
> > Hans H. pulled the old modified trick of 'works here'.
> 
> Well, when used in a paragraph it works indeed. No trick involved. But as it
> uses a specific mechanism in an hbox you need to trigger that (unless you
> want to add overhead that will kake tex crawl).
> 
> > Like a magician… now all of a sudden evetything works, but unlike TeX's
> 
> Not sure what this refers to. Much of TeX is magick but what is bad about
> that?
> 
> > \hbox to 1in{\vrule \rightarrowfill \ 1in \leftarrowfill\vrule}
> > 
> > or
> > 
> > \hbox to 1cm{\vrule \rightarrowfill \ 1cm \leftarrowfill\vrule}
> > 
> > which gives an accurate description, not to mention measurement,
> 
> It depends on what you expect. First of all, your assumption that the arrow
> fill is the same as in plain tex is wrong.

Why would it be wrong? 

When I type 

\hbox to 3cm{\rightarrowfill} without a vrule

that's what I would normally expect


> 
> (1) one can define an arrow fill using a leader that uses some (happen to be
> present in tex math fonts) glyphs: repeated minuses followed by some magic
> kern and an arrow head.
> 

Can you apply it to pagination without breaking? 

Highly doubt it.


> (2) You can hope that the magick kern is right and that the minus aligns
> with the arrows bar.
> 
> (3) You also assume that the math font matches the text font.
> 
> (4) Normally an arrow fill is something math anyway. Where there can also be
> something on top or below, or where it can be a top or bottom accent.
> 
> > a
> > 
> > \vbox to 5pt{x\vrule\rightarrowfill \ x \leftarrowfill\vrule\ x}
> > 
> > or
> > 
> > x \rightarrowfill x
> > x \leftarrowfill x
> > 
> > or
> > 
> > \vbox to 3pt{x\vrule\rightarrowfill \  \leftarrowfill\vrule\ x}
> > 
> > \ \rightarrowfill \
> > \ \leftarrowfill \
> > 
> > 
> > in LMTX doesn't say much
> What should it say? You get a space, an arrow and a discarded space.
> 
> That said: I think you miss a few points here:
> 
> (1) I know Hans vd Meer well and he knows ConTeXt well. He's quite capable
> of figuring out how to use advanced features and I bet he likes the
> following variant of arrows in text. Next time we meet I'll show him some
> more adaptive tricks (although I bet he can figure them out himself).
> 
> \starttext
> 
> % \setupexternalfigures
> %   [location={default,global}]
> 
> % \startsetups adaptive:test
> %     \setbox\usedadaptivebox\hbox to \usedadaptivewidth yoffset
> -\usedadaptivedepth \bgroup
> %         \externalfigure
> %           [cow.pdf]
> %           [width=\usedadaptivewidth,
> %            height=\dimexpr\usedadaptiveheight+\usedadaptivedepth\relax]%
> %    \egroup
> % \stopsetups
> 
> \startsetups adaptive:test
>     \setbox\usedadaptivebox\hbox to \usedadaptivewidth yoffset .25ex \bgroup
>         \startMPcode
>             drawarrow ((0,0) -- (\the\usedadaptivewidth,0)) randomized
> (ExHeight/2);
>         \stopMPcode
>    \egroup
> \stopsetups
> 
> \dorecurse{5}{
>     \dostepwiserecurse{1}{150}{1}{%
>         this~#1.##1 is~#1.##1 test~#1.##1
>         {\adaptivebox[strut=yes,setups=adaptive:test]{\strut}}
>     }
>     \blank
> }
> 
> \stoptext
> 
> (2) If someone wants a plain (or fot that matter latex) solution then one
> can use these macro packages or write a macro that mimicks expectations.
> 
> (3) I don't like "Hans H. pulled the old modified trick of 'works here'."
> kind of remarks because they have a rather negative undertone and I don't
> know how to read that.
> 

No. I didn't mean anything by it. Just that I disagree with the
implementation. Again, I expect what TeX returns rather than what LMTX
returns. 

No need to re-invent the wheel. (if there's undertone in that so be it) 

And of course it's working! Everything works, right? And that's exactly what
I meant. 

> 
> Hans
> 
> -----------------------------------------------------------------
>                                           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://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki     : https://contextgarden.net
> ___________________________________________________________________________________

-- 
CChheecckk yyoouurr dduupplleexx sswwiittcchh..

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : https://contextgarden.net
___________________________________________________________________________________

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

* Re: [NTG-context] right and left arrowfill
  2023-06-23 13:21         ` Carlos via ntg-context
@ 2023-06-23 14:12           ` Hans Hagen via ntg-context
  0 siblings, 0 replies; 8+ messages in thread
From: Hans Hagen via ntg-context @ 2023-06-23 14:12 UTC (permalink / raw)
  To: Carlos via ntg-context; +Cc: Hans Hagen

On 6/23/2023 3:21 PM, Carlos via ntg-context wrote:

>> I'm not sure how you can mess up glue so that the box is no longer a box.
>> Boxes remain boxes.
> 
> I guess that's the same mentality behind a fixed glue in LMTX, while
> trying not to mess up the box. Back to point A and the main reason of the
> op's question.

I have no clue what "the same mentality behind a fixed glue in LMTX" 
means here. It's not like LMTX has a mentality of its own, after all 
it's not an AI (fwiw). Here we use \uleaders that have some 
feedback-after-typesetting loopback. Eventually I might add some extra 
callback features but only when it has no impact on performance. For now 
it's experimental.

That said, I wonder how many users can predict the plainish tex result of:

\ruledhbox to 2in{\vrule \rightarrowfill \ 1cm \leftarrowfill\vrule}

\ruledhbox to 1cm{\vrule \rightarrowfill \ 1cm \leftarrowfill\vrule}

Which then makes an argument for

% \permanent\protected\def\adaptive
%   {\dowithnextbox{\adaptivecheckbox\nextbox\box\nextbox}}

\adaptive\ruledhbox to 2in{\vrule \rightarrowfill \ 1cm 
\leftarrowfill\vrule}

\adaptive\ruledhbox to 1cm{\vrule \rightarrowfill \ 1cm 
\leftarrowfill\vrule}

doing its thing. Anyway, it is a not using "math arrows in text" that 
determines the functionality but "math arrows in math" that does (and in 
that respect we're driven by demands from power math users like Alan and 
Mikael); so. we're more focussed on shapes and proper rendering; these 
fillers in text are sort of special

> Then again, the only way to resemble what TeX does is by re/defining
> and copied verbatim from The TeXbook  both rightarrowfill and
> leftarrowfill

and hope for the best

> and unlike with TeX in which an
> 
> \hbox to 1in{\vrule \rightarrowfill \ 1cm \leftarrowfill\vrule}
> 
> it says 1cm but it'd be more than that, and accurately so

Well, plain tex says:

\def\rightarrowfill{$\m@th\smash-\mkern-7mu%
   \cleaders\hbox{$\mkern-2mu\smash-\mkern-2mu$}\hfill
   \mkern-7mu\mathord\rightarrow$}

so, you get a smashed minus, some backtracking (a kern, not a glue), 
then optional leaders, and finally an overlayed arrowhead

and you then cross your fingers that the minus sits on the same axis as 
the arrowhead because this is pretty much a cmr bound definition (and 
there are math fonts out there that don't fit this definition, although 
we got some fixes in the meantime)

in lmtx (using luametatex) we use \Uhextensible instead which build from 
an opentype extensible

(which makes me wonder: do users really expect all \macros in plain, 
latex and context do to the same? i bet not because \end in latex is 
definitely something else than \end in plain)

>>> How good would \meaning be here, notwithstanding the valuable info of
>>> the macro it provides, if it can't print out, let alone source it up,
>>> the more accurate dimension, let alone the measurement.
>>
>> I don't follow. Does this come from ChapGPT?
>>
> 
> That's funny.
> 
> But as chatgpt says:
> "Sorry about that. \meaning\rightarrowfill is
> \begingroup \scratchunicode 8594\relax \adaptivebox [mathfiller][alterna­
> tive=8594]{\hss \strut \hss }\endgroup "
> 
> That's what lmtx returned after Hans vdM sample

Nothing wrong with that, but in the meantime that can be

\permanent\protected\def\mathfiller#1%
   {\adaptivebox[mathfiller][\c!alternative=#1]{\hss\strut\hss}}

because we don't need the scratch code (was used when we played with 
it), so a next version wil say:

   \meaningfull\rightarrowfill

or:

   frozen instance macro:\mathfiller {8594}

or more texie

   \meaningasis\rightarrowfill

like:

   \frozen \instance \def \rightarrowfill \mathfiller {8594}

>> It depends on what you expect. First of all, your assumption that the arrow
>> fill is the same as in plain tex is wrong.
> 
> Why would it be wrong?

because context is not plain

> When I type
> 
> \hbox to 3cm{\rightarrowfill} without a vrule
> 
> that's what I would normally expect

as plain user maybe

>> (1) one can define an arrow fill using a leader that uses some (happen to be
>> present in tex math fonts) glyphs: repeated minuses followed by some magic
>> kern and an arrow head.
>>
> 
> Can you apply it to pagination without breaking?
> 
> Highly doubt it.

you seem to know the plain definition so ... leaders don't break

> No. I didn't mean anything by it. Just that I disagree with the
> implementation. Again, I expect what TeX returns rather than what LMTX
> returns.

well, using an arrow fill in running text is rare but who knows how 
uleaders evolve (after users start using it)

> No need to re-invent the wheel. (if there's undertone in that so be it)

if so, so use plain

> And of course it's working! Everything works, right? And that's exactly what
> I meant.

Hans

-----------------------------------------------------------------
                                           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://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : https://contextgarden.net
___________________________________________________________________________________

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

end of thread, other threads:[~2023-06-23 14:13 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-21 20:10 [NTG-context] right and left arrowfill Hans van der Meer via ntg-context
2023-06-22 13:11 ` Hans Hagen via ntg-context
2023-06-22 13:32   ` Hans van der Meer via ntg-context
2023-06-22 15:38     ` Hans Hagen via ntg-context
2023-06-23 10:43     ` Carlos via ntg-context
2023-06-23 11:38       ` Hans Hagen via ntg-context
2023-06-23 13:21         ` Carlos via ntg-context
2023-06-23 14:12           ` Hans Hagen via ntg-context

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