7
$\begingroup$

Of course I can simply type the unicode ↪, but is there a operator with no built in meaning that renders like this?

The documentation guide/ArrowsAndArrowLikeForms presumably lists all arrows. If it doesn't exist, can I define Output and typesettings rules for the unicode character?

$\endgroup$
1
  • 3
    $\begingroup$ I am not sure I understand your question. This character does not have any built-in meaning and can be used as a symbol with no apparent problems. What exactly are you trying to achieve? $\endgroup$
    – Domen
    Jan 15, 2022 at 23:23

1 Answer 1

12
$\begingroup$

You can use an empty TemplateBox to create a new operator. For example:

CurrentValue[EvaluationNotebook[],{InputAutoReplacements,"ha"}] = TemplateBox[
    {},
    "HookRightArrow",
    DisplayFunction -> Function@"↪",
    InterpretationFunction :> Function[Sequence["~", "HookRightArrow", "~"]]
];

Then, typing x space h a space y produces:

x
Sequence["~", "HookRightArrow", "~"] y

and when evaluated yields:

HookRightArrow[x, y]

$\endgroup$
1
  • $\begingroup$ Very neat. I was familiar with defining InputAutoReplacements, but having it resolve to the symbol is very nice. $\endgroup$
    – Adam
    Jan 16, 2022 at 1:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.