newcommand
The newcommand extension provides the \def
, \newcommand
,
\renewcommand
, \let
, \newenvironment
, and
\renewenvironment
macros for creating new macros and environments
in TeX. For example,
\(
\def\RR{{\bf R}}
\def\bold#1{{\bf #1}}
\)
defines a macro \RR
that produces a bold “R”, while
\bold{math}
typesets its argument using a bold font. See
Defining TeX macros for more information.
This extension is already loaded in all the components that
include the TeX input jax, other than input/tex-base
. To load the
newcommand extension explicitly (when using input/tex-base
for
example), add '[tex]/newcommand'
to the load
array of the
loader
block of your MathJax configuration, and add
'newcommand'
to the packages
array of the tex
block.
window.MathJax = {
loader: {load: ['[tex]/newcommand']},
tex: {packages: {'[+]': ['newcommand']}}
};
Alternatively, use \require{newcommand}
in a TeX expression to load it
dynamically from within the math on the page, if the require
package is loaded.