An easy one: I would like to define a shortcut so that I can write \eta without having to enclose it in $\eta$.
However, the naive approach will not work:
\documentclass{article}
\newcommand{\pt}{\ensuremath{p_T}}
% \renewcommand{\eta}{\ensuremath{\eta}} % hangs if I do it like this
\begin{document}
I have $\pt = x$, $\eta = y$.
Just like \pt, I can also refer to %\eta.
--- no I can't.
\end{document}
It seems this approach results in an endless loop. What is the best way around this?

eta– Feb 27 '15 at 10:59\ptis not really recommendable, as it is misleading and could be confused with the TeX dimensionpt– Feb 27 '15 at 11:03\pt. However, it did a good job for me so far... (I never use / need the TeX dimension but I need to refer to the transverse momentum a lot.) – fuenfundachtzig Feb 27 '15 at 11:04$\pt$gives a much clearer markup. Most editors will also highlight it. Also you will have to rememberblah blah \pt{} blah blahso that it does not eat a space. So those saved$will come and bite you in the end. – daleif Feb 27 '15 at 12:00xspacefor things like\pt(I didn't include it in the minimal example, however). So it would beblah \pt blah. I appreciate all the well-intentioned comments, but you may trust me: It does work very well for me :) (\ptis also highlighted by the way.) – fuenfundachtzig Feb 27 '15 at 12:26xparse, there are situations where\xparsedoes it wrong.... (don't remember them from the top of may head) – daleif Feb 27 '15 at 14:31xparseorxspace? – sebhofer Feb 27 '15 at 15:21\xspace, my bad – daleif Feb 27 '15 at 15:28\ensuremathfor math macro for some hints about the problem. If you try\pt+\etayou'll get spacing completely wrong, unless you add$around the expression. And\pt-\etain text mode would be really outrageous. – egreg Feb 27 '15 at 16:20\xspacegets the spacing wrong. Still, I found it to be a tremendous help, and those cases in which it fails cannot be that numerous because I cannot come up with one from the top of my head. – fuenfundachtzig Feb 27 '15 at 17:54