* two nested \mathbin command changes spacing
@ 2018-04-30 16:50 Ulrike Fischer
2018-05-01 8:12 ` Hans Hagen
2018-05-17 21:47 ` Hans Hagen
0 siblings, 2 replies; 4+ messages in thread
From: Ulrike Fischer @ 2018-04-30 16:50 UTC (permalink / raw)
To: ntg-context
In the following document the second a is much nearer placed to the
V:
\starttext
$V \mathbin{a} W \qquad V \mathbin{\mathbin{a}} W $
\stoptext
(in the second case an italic kern seems to be missing)
Can one avoid this side effect of nested \math-command? When
building symbols it is not always easy to avoid such nestings.
--
Ulrike Fischer
http://www.troubleshooting-tex.de/
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: two nested \mathbin command changes spacing
2018-04-30 16:50 two nested \mathbin command changes spacing Ulrike Fischer
@ 2018-05-01 8:12 ` Hans Hagen
2018-05-01 10:01 ` Ulrike Fischer
2018-05-17 21:47 ` Hans Hagen
1 sibling, 1 reply; 4+ messages in thread
From: Hans Hagen @ 2018-05-01 8:12 UTC (permalink / raw)
To: ntg-context
On 4/30/2018 6:50 PM, Ulrike Fischer wrote:
> In the following document the second a is much nearer placed to the
> V:
>
> \starttext
> $V \mathbin{a} W \qquad V \mathbin{\mathbin{a}} W $
> \stoptext
>
> (in the second case an italic kern seems to be missing)
>
> Can one avoid this side effect of nested \math-command? When
> building symbols it is not always easy to avoid such nestings.
it becomes a chicken-egg issue because one can argue that a wrapped
mathbin is no longer a pure bin and so ... it's again an indication that
a wrong boundingbox (width) relying on always some kind of italic to fix
it is a bad approach and recursively going into a bin (or whatever) node
to see if there is a nucleus chactacer would be yet another
'configureble option' ... all is possible but the more we get of that
the more one needs to be aware of it and provide control over the
opposite (keep in mind that such control is then a formula wide one as
math lists are only processed when fully collected)
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 / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: two nested \mathbin command changes spacing
2018-05-01 8:12 ` Hans Hagen
@ 2018-05-01 10:01 ` Ulrike Fischer
0 siblings, 0 replies; 4+ messages in thread
From: Ulrike Fischer @ 2018-05-01 10:01 UTC (permalink / raw)
To: ntg-context
Am Tue, 1 May 2018 10:12:42 +0200 schrieb Hans Hagen:
> On 4/30/2018 6:50 PM, Ulrike Fischer wrote:
>> In the following document the second a is much nearer placed to the
>> V:
>>
>> \starttext
>> $V \mathbin{a} W \qquad V \mathbin{\mathbin{a}} W $
>> \stoptext
>>
>> (in the second case an italic kern seems to be missing)
>>
>> Can one avoid this side effect of nested \math-command? When
>> building symbols it is not always easy to avoid such nestings.
> it becomes a chicken-egg issue because one can argue that a wrapped
> mathbin is no longer a pure bin and so ... it's again an indication that
> a wrong boundingbox (width) relying on always some kind of italic to fix
> it is a bad approach
Well yes, I already suspected this when I saw "italic" in the log.
What would be a better approach?
The question who started the investigation wanted to get a binary
symbol "\hat{\otimes}". How does one define it so the spacing is
correct? It doesn't need be the fontloader that catches all the
case. It would be quite okay to insert some code that says "hey
handle me like \otimes". And it would also okay to assume a "good
font".
But even with cambria it doesn't work correctly in context
currently. The displacement is slight (only 0.3pt) but at large zoom
one can see it:
%\setupbodyfont[cambria] %without it the spacing is more pronounced
\starttext
$ V \otimes W $
$ V \mathbin{\hat{\otimes}} W $
$ V \Umathchar 2 0 "2297 W $
$ V \mathbin{\Umathchar 0 0 "2297} W $
$ V \mathbin{\Umathchar 2 0 "2297} W $
$ V \mathbin{\Umathaccent 0 0 "302 \Umathchar 0 0 "2297} W $
\stoptext
--
Ulrike Fischer
http://www.troubleshooting-tex.de/
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: two nested \mathbin command changes spacing
2018-04-30 16:50 two nested \mathbin command changes spacing Ulrike Fischer
2018-05-01 8:12 ` Hans Hagen
@ 2018-05-17 21:47 ` Hans Hagen
1 sibling, 0 replies; 4+ messages in thread
From: Hans Hagen @ 2018-05-17 21:47 UTC (permalink / raw)
To: ntg-context
On 4/30/2018 6:50 PM, Ulrike Fischer wrote:
> In the following document the second a is much nearer placed to the
> V:
>
> \starttext
> $V \mathbin{a} W \qquad V \mathbin{\mathbin{a}} W $
> \stoptext
>
> (in the second case an italic kern seems to be missing)
>
> Can one avoid this side effect of nested \math-command? When
> building symbols it is not always easy to avoid such nestings.
this is again a side effect of bad glyph boundingboxes
anyway, the tex engine collapses nested ord nodes so i generalized that
in the upcoming engine
\mathflattenmode \numexpr
0 % off
+ 1 % ord
+ 2 % bin
+ 4 % rel
+ 8 % punct
+ 16 % inner
\relax
so you can get rid of nested same-class (actually this is only done when
no super or subscript) .. as a side effect you get a sequence of math
char nodes and that will then listen to the other italics enforcing flag
(for fonts with weird character boundingboxes)
i didn't test side effects but at least we can influence it (the default
is of course 1 which is what tex naturally does)
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 / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-05-17 21:47 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-30 16:50 two nested \mathbin command changes spacing Ulrike Fischer
2018-05-01 8:12 ` Hans Hagen
2018-05-01 10:01 ` Ulrike Fischer
2018-05-17 21:47 ` Hans Hagen
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).