I tend to use \newcommand to define macros for symbols I use often, e.g. \newcommand{\hankel}{H^{(1)}_0}. One inconvenience of this approach is the fact that command names cannot include numbers. What I ideally want is to map something like \H0 to H^{(1)}_0. I imagine this could be done with some macro expansion/snippet package, or one might use \newcommand to define a command that takes a parameter, etc. Before I start experimenting, though -- is there a canonical way of dealing with this problem?
|
|
||||
| show 1 more comment |
|
Defining commands with parameters would be the way I would deal with this.
defines a command with one parameter. You can then do |
|||
|
|
|
This faq answer discusses this issue, criticises 4 possible ways of using such a macro and ultimately comes to the conclusion don't do that. |
|||
|
|
|
A bad hack (Jan's answer above is much better)
between the usual
and define the various
Note that when we call
will be seen as |
||||
|
|
\H...you're going to need. Is it as in Jan's answer? Then that one's perfect for you. If not, can you add some explanation to your question? – Hendrik Vogt Jan 26 '11 at 12:22\newcommandparameters will work well. – Leo Alekseyev Jan 27 '11 at 18:26