I find that I much prefer \varphi to \phi and generally would rather use the \varphi than the \phi. But it's three more characters to type \varphi instead of \phi, which is most troublesome. So I would like to swap the two commands. I tried a couple of things on my own, but one resulted in an infinite loop in compilation and the other led to \varphi taking over all of the \phi commands I made. What would be the correct way to do this?
Tell me more
×
TeX - LaTeX Stack Exchange is a question and answer site for
users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.
|
|
||||
| show 1 more comment |
|
Try the following:
|
|||||||||||||
|
|
The usual way to exchange two values is to use a temporary command name to store one of them while swapping, but if, for no particular reason, you want to avoid the extra command name then:
|
|||||||||
|
|
For non-complex macros, using an interim macro to swap definitions is sufficient. However, if the macros (say,
|
|||||
|

\let\phi\varphi– Gonzalo Medina Apr 1 '12 at 18:26\let\oldphi\phi \let\phi\varphi \let\varphi\oldphi– Gonzalo Medina Apr 1 '12 at 18:42\let\phi\varphi, as the two symbols very rarely are used together in the same document (a polite way to say: "never use both in the same document"). – egreg Apr 1 '12 at 20:49\phiand\varphi. – celtschk Apr 2 '12 at 9:01