Re: [NTG-context] Define new symbol by stitching two symbols together
On 2021-05-24, Aditya Mahajan 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 ___
Re: [NTG-context] Define new symbol by stitching two symbols together
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 ___
Re: [NTG-context] Define new symbol by stitching two symbols together
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 ___
[NTG-context] Define new symbol by stitching two symbols together
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 ___