Which commands are there that one can use to define new commands in (La)TeX?
There are: \let, \def, \[re]newcommand[*], \DeclareRobustCommand[*], and ...?
(And I've seen things like \DeclareMathOperator.)
|
The LaTeX "official" interface provides
All these commands define one or more commands (some only for internal usage) and provide tests for avoiding clobbering of existing commands. There's also The kernel has many other command-defining macros:
Of these, only the first one is commonly used in LaTeX programming (it shouldn't be used indiscriminately as a replacement of Some additional packages provide new functions:
are commonly found, but there are scores of other command-defining functions in the hundreds of packages around. Another commonly used utility for defining commands is the primitive
provided by the The
(look at the documentation for a description). Eventually, all of these command-defining functions boil down to the primitive commands
but a description of these would require writing a chapter of a book; refer to the TeXbook or to TeX by Topic |
|||||||
|
\defwhich defines a new command.\letjust assigns a new name. All the others are “only” wrappers around\def, of which there can be arbitrarily many. – canaaerus Feb 11 at 7:36\newcounter. It sets up a new counter but also defines a command called \thecounter which prints the counter. So for a complete answer one would have to list a lot of macros. – bloodworks Feb 11 at 7:49\thecounterwithout any space ... that's weird. If a comprehensive list is long, so be it :-) – Lover of Structure Feb 11 at 7:57\chardefor\toksdefcount?). – Joseph Wright♦ Feb 11 at 8:14