1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
|
<html>
<head><title>\newcommand</title></head>
<body>
<h1>\newcommand</h1>
<P>
</P>
<PRE>
\newcommand{cmd}[args]{definition}
\newcommand{cmd}[args][default]{definition}
\renewcommand{cmd}[args]{definition}
\renewcommand{cmd}[args][default]{definition}
</PRE>
<P>
These commands define (or redefine) a command.
</P>
<DL COMPACT>
<DT><CODE>cmd</CODE>
<DD>
A command name beginning with a <CODE>\</CODE>. For <CODE>\newcommand</CODE> it
must not be already defined and must not begin with <CODE>\end</CODE>; for
<CODE>\renewcommand</CODE> it must already be defined.
<DT><CODE>args</CODE>
<DD>
An integer from 1 to 9 denoting the number of arguments of the command
being defined. The default is for the command to have no arguments.
<DT><CODE>def</CODE>
<DD>
If this optional parameter is present, it means that the command's first
argument is optional. The default value of the optional argument is
<CODE>def</CODE>.
<DT><CODE>definition</CODE>
<DD>
The text to be substituted for every occurrence of <CODE>cmd</CODE>; a
parameter of the form <CODE>#n</CODE> in <CODE>cmd</CODE> is replaced by the text of
the nth argument when this substitution takes place.
</DL>
<p>--><a href="index.html">LaTeX index</a>
</body>
</html>
|