It's certainly possible to assign a character other than \
(backslash) to function as the start a control word (macro) in TeX. But, what would you gain? Even if all macros started with a ~
(tilde) character instead of a \
, it wouldn't affect the length of the strings used to denote various commands, would it?
By the way, \to
is a synonym for \rightarrow
. Is \to
short enough (and readable enough) for you? :-)
Sort-of Lengthy Addendum To make the specific character combination ->
into a "command" that typesets the equivalent of \to
in math mode, you'd have to make the first character, -
, "active" in TeX jargon and then define a macro that reads ahead to the next character; if that character is a >
, you'd tell TeX to typeset \rightarrow
, and if it's not, you'd instruct TeX to place the -
character and the following character back into the input token stream.
Now, back to the question of how to make the "instruction" ->
execute the instruction \rightarrow
. Study the code in the MWE below; the \catcode
command makes the -
active, and the following line provides the definition of the command. Note that we can't just place -
back into the token stream, as TeX would find itself in an ever and deeper loop trying to resolve what to do with the command -
. Instead, I use the command \char
command to place a dash back into the token stream.
\documentclass{article}
\catcode`\-=\active
\def-#1{\ifx>#1 \ensuremath{\rightarrow} \else \char`-#1 \fi}
\begin{document}
-> \quad -+ \quad -, \quad $-a$ \quad 5--9 \quad $x->0$
\end{document}
(Well, I'm sure I've left out some eventuality that'll make this code break down in some circumstances; I'll let our fellow TeX-SX hounds point out the mistakes...)
ε → 0
looks even nicer ;-)unicode-math
.