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
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 -----------------------------------------------------------------
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
On 2021-05-24, Aditya Mahajan
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
participants (3)
-
Aditya Mahajan
-
Hans Hagen
-
Nicola