|
Prev | Next | LatexMacro |
| Definition |
\newcommand{ \Name }{
Text_0
}
|
\newcommand{ \Name }[ M ]{
Text_0
#J(1)
Text_1 \; \ldots \; Text_{N-1}
#J(N)
Text_N
}
| |
| Usage |
\Name
|
\Name{
A_1
}
\; \ldots \;
{
A_M
}
| |
\newcommand in the
root section
have global scope; i.e., are defined for all sections.
This avoids having to entirely
reprocess all the macros for each section
(which could be time consuming for large numbers of macros).
It is suggested that you put all these macros in one file
using an
inline
latex command.
(You cannot use a
displayed
latex command
when you are just defining macros and there is no output to be displayed.)
Name
specifies the name of the macro.
K = 0 , \ldots , N
,
Text_K
is a sequence of characters.
The character # does not appear in
Text_K
except if directly preceded by a back slash; i.e., \#.
In addition,
Text_K
does not contain
any } characters unless preceded by a matching { character.
M
is between one and nine inclusive.
It specifies the number of arguments connected to each use of
\Name.
If
M
is not present in the macro definition,
it is implicitly zero in the discussion below.
N
.
K = 1 , \ldots , N
, the decimal digit
J(K)
is between one and
M
.
It specifies which argument is placed directly before
Text_K
in the macro expansion.
\Name
has the replacement value
Text_0
corresponding to the definition of Name.
In general, the macro usage
\Name{
A_1
}
\; \ldots \;
{
A_M
}
has the replacement value
Text_0 \; A_{J(1)} \; Text_1 \; \cdots \; Text_{N-1} \; A_{J(N)} \; Text_N
where
M
,
N
, and
Text_K
for
K = 1 , \ldots , N
,
corresponds to the definition of Name.
$latex \[
\newcommand{\Dx}{ \frac{d \hspace{1ex} }{d x} }
\Dx
\] $$
results in the output
\[
\newcommand{\Dx}{ \frac{d \hspace{1ex} }{d x} }
\Dx
\]
$latex \[
\newcommand{\D}[2]{ \frac{d #1}{d #2} }
\D{y}{x}
\] $$
results in the output
\[
\newcommand{\D}[2]{ \frac{d #1}{d #2} }
\D{y}{x}
\]
$latex \[
\newcommand{\Ropf}{
\mathml{ <mi mathvariant='normal'> &\#x0211D; </mi> }
}
x \in \Ropf^n
\] $$
which results in the output
\[
\newcommand{\Ropf}{
\mathml{ <mi mathvariant='normal'> &\#x0211D; </mi> }
}
x \in \Ropf^n
\]
Text_K
in an macro definition,
and the value of
A_J
in a macro usage,
cannot use other macros.