4
$\begingroup$

The Basic Math Assistant palette does not show a keyboard shortcut for RightTeeArrow. Is there some hidden key combination that results in the output? (Just hoping to be able to avoid having to reach for the mouse and move over.)

$\endgroup$

2 Answers 2

8
$\begingroup$

If you want to do purely typesetting, you could use the similar symbol for Function:

EscfnEsc

$\mapsto$

The caveat is that this symbol has a pre-defined meaning, as you can see by entering

TraditionalForm[Function[x,f[x]]]

$x \mapsto f(x)$

If you enter the symbol only in equation cells that aren't meant to be evaluated, it doesn't matter that this pre-defined interpretation exists.

Edit: making shortcuts, the user-friendly way

If you want to be able to quickly make your own shortcuts for symbols or functions, it's also worth keeping in mind that there exists a package for that precise purpose: the Notation package.

Although I personally also use the method in Mr. Wizard's answer (see e.g. here) to make shortcuts that are easy for others to copy (like on this site), still I would recommend looking into the Notation package for your own personal use (if you don't want to memorize the manual steps).

Just type this:

Needs["Notation`"]

EscaddiaEsc

AddInputAlias["$\square$ " -> $\square$]

This is the template that appears after typing the built-in shortcut. Now enter the desired abbreviation rta (or whatever you like) in the first square, and the character $\mapsto$ (\[RightTeeArrow]) in the second square.

And you're done.

$\endgroup$
8
$\begingroup$

It is easy enough to add your own InputAliases. For example evaluating:

CurrentValue[EvaluationNotebook[], {InputAliases, "rta"}] = "↦";

Then entering EscrtaEsc will create a \[RightTeeArrow] character.

To make the change global and persistent you can add this to the existing list using the Option Inspector with the Global Preferences level selected. (Advanced users can also do it programmatically but this is easier and less prone to error.)


In reply to a comment below there may be other character-related functionality you are unaware of.

Input Forms

Yes indeed you can enter characters using their full name (FullForm representation), as well as several numeric forms as documented in Input Syntax.

The decimal character code is 8614:

ToCharacterCode["\[RightTeeArrow]"]
{8614}

This in hexadecimal is 21a6 therefore you can also enter the character as \:21a6.

Operator Behavior

Since is an Operator it also has established parsing behavior and translation rules to and from the attached Symbol name: RightTeeArrrow. Examples:

enter image description here
enter image description here

This allows you to easily define rules for the operator (following said parsing behavior):

RightTeeArrow[a_, b_] := a + b
RightTeeArrow[a_, b_, c_] := a*b*c
RightTeeArrow[x__] := {x}

Now:

enter image description here

Extensible Characters

\[RightTeeArrow] is an extensible character. If you create an overscript using Ctrl+7 as described in the Control Keys section of the Input Syntax tutorial and enter it above an expression it stretches to fit:

enter image description here

$\endgroup$
4
  • $\begingroup$ Excellent advice. Moreover, I didn't know that you could use the "long form" \[RightTeeArrow] for these kinds of things. $\endgroup$ Commented May 4, 2014 at 18:56
  • $\begingroup$ @Shredderroy Please see my updated answer. $\endgroup$
    – Mr.Wizard
    Commented May 4, 2014 at 22:56
  • 1
    $\begingroup$ I recommend using CurrentValue[EvaluationNotebook[], {InputAliases, "rta"}] = "\[RightTeeArrow]" instead, since this will not delete existing input aliases. $\endgroup$
    – Carl Woll
    Commented Jun 14, 2019 at 5:01
  • $\begingroup$ @Carl Excellent suggestion, as usual. I'll amend the post. $\endgroup$
    – Mr.Wizard
    Commented Jun 14, 2019 at 7:28

Your Answer

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

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