* Define new symbol by stitching two symbols together
@ 2021-05-22 18:23 Nicola
2021-05-23 10:00 ` Hans Hagen
0 siblings, 1 reply; 4+ messages in thread
From: Nicola @ 2021-05-22 18:23 UTC (permalink / raw)
To: ntg-context
I would like to define new symbols by stitching together existing
glyphs. This is what I have come up so far:
\define[1]\Transition{-\!\![#1]\!\!\rightarrow}
\starttext
\m{L\Transition{A}R}
\stoptext
This should render as -[ ]->, ideally with no space between the dash or
the arrow and the brackets, i.e., -[ should appear like a single glyph;
ditto for ]-->. With the definition above, however, the space is
variable, and in some circumstances the gliphs overlap.
How can I improve the above definition?
Nicola
___________________________________________________________________________________
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: Define new symbol by stitching two symbols together
2021-05-22 18:23 Define new symbol by stitching two symbols together Nicola
@ 2021-05-23 10:00 ` Hans Hagen
2021-05-24 19:46 ` Aditya Mahajan
0 siblings, 1 reply; 4+ messages in thread
From: Hans Hagen @ 2021-05-23 10:00 UTC (permalink / raw)
To: mailing list for ConTeXt users, Nicola
On 5/22/2021 8:23 PM, Nicola wrote:
> I would like to define new symbols by stitching together existing
> glyphs. This is what I have come up so far:
>
> \define[1]\Transition{-\!\![#1]\!\!\rightarrow}
> \starttext
> \m{L\Transition{A}R}
> \stoptext
>
> This should render as -[ ]->, ideally with no space between the dash or
> the arrow and the brackets, i.e., -[ should appear like a single glyph;
> ditto for ]-->. With the definition above, however, the space is
> variable, and in some circumstances the gliphs overlap.
>
> How can I improve the above definition?
don't use these funny \! skips ... use some font related metric:
\define[1]\Transition{-\kern-1ex[#1]\kern-1.1ex\rightarrow}
\starttext
\m{L\Transition{A}R}
\stoptext
-----------------------------------------------------------------
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: Define new symbol by stitching two symbols together
2021-05-23 10:00 ` Hans Hagen
@ 2021-05-24 19:46 ` Aditya Mahajan
2021-05-24 20:14 ` Nicola
0 siblings, 1 reply; 4+ messages in thread
From: Aditya Mahajan @ 2021-05-24 19:46 UTC (permalink / raw)
To: mailing list for ConTeXt users; +Cc: Nicola
On Sun, 23 May 2021, Hans Hagen wrote:
> On 5/22/2021 8:23 PM, Nicola wrote:
> > I would like to define new symbols by stitching together existing
> > glyphs. This is what I have come up so far:
> >
> > \define[1]\Transition{-\!\![#1]\!\!\rightarrow}
> > \starttext
> > \m{L\Transition{A}R}
> > \stoptext
> >
> > This should render as -[ ]->, ideally with no space between the dash or
> > the arrow and the brackets, i.e., -[ should appear like a single glyph;
> > ditto for ]-->. With the definition above, however, the space is
> > variable, and in some circumstances the gliphs overlap.
> >
> > How can I improve the above definition?
> don't use these funny \! skips ... use some font related metric:
>
> \define[1]\Transition{-\kern-1ex[#1]\kern-1.1ex\rightarrow}
This is how we used to define arrows in the old days ...
\define[1]\Transition{\relbar\joinrel\mathrel{[}#1\mathrel{]}\joinrel\rightarrow}
\define[1]\BigTransition{\relbar\joinrel\relbar\joinrel\mathrel{[}#1\mathrel{]}\joinrel\relbar\joinrel\rightarrow}
\starttext
\m{L\Transition{A}R}
\m{L\BigTransition{A}R}
\stoptext
Aditya
___________________________________________________________________________________
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: Define new symbol by stitching two symbols together
2021-05-24 19:46 ` Aditya Mahajan
@ 2021-05-24 20:14 ` Nicola
0 siblings, 0 replies; 4+ messages in thread
From: Nicola @ 2021-05-24 20:14 UTC (permalink / raw)
To: ntg-context
On 2021-05-24, Aditya Mahajan <adityam@umich.edu> wrote:
> On Sun, 23 May 2021, Hans Hagen wrote:
>
>> On 5/22/2021 8:23 PM, Nicola wrote:
>> > I would like to define new symbols by stitching together existing
>> > glyphs. This is what I have come up so far:
>> >
>> > \define[1]\Transition{-\!\![#1]\!\!\rightarrow}
>> > \starttext
>> > \m{L\Transition{A}R}
>> > \stoptext
>> >
>> > This should render as -[ ]->, ideally with no space between the dash or
>> > the arrow and the brackets, i.e., -[ should appear like a single glyph;
>> > ditto for ]-->. With the definition above, however, the space is
>> > variable, and in some circumstances the gliphs overlap.
>> >
>> > How can I improve the above definition?
>> don't use these funny \! skips ... use some font related metric:
>>
>> \define[1]\Transition{-\kern-1ex[#1]\kern-1.1ex\rightarrow}
>
> This is how we used to define arrows in the old days ...
>
> \define[1]\Transition{\relbar\joinrel\mathrel{[}#1\mathrel{]}\joinrel\rightarrow}
> \define[1]\BigTransition{\relbar\joinrel\relbar\joinrel\mathrel{[}#1\mathrel{]}\joinrel\relbar\joinrel\rightarrow}
>
> \starttext
> \m{L\Transition{A}R}
>
> \m{L\BigTransition{A}R}
> \stoptext
Thanks Hans, Aditya,
combining your ideas (\joinrel plus \kern) seems to work best for my use
case.
Nicola
___________________________________________________________________________________
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:[~2021-05-24 20:14 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-22 18:23 Define new symbol by stitching two symbols together Nicola
2021-05-23 10:00 ` Hans Hagen
2021-05-24 19:46 ` Aditya Mahajan
2021-05-24 20:14 ` Nicola
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).