input/tex/extensions/textmacros.rst
.. _tex-textmacros:
########## textmacros ##########
The textmacros extension adds the ability to process some text-mode
macros within \text{} and other macros that produce text-mode
material. See the :ref:tex-differences section for how text-mode is
handled without this extension.
This extension is already loaded in all the components that include
the TeX input jax, other than input/tex-base. To load the
textmacros extension explicitly (when using input/tex-base for
example), add '[tex]/textmacros' to the :data:load array of the
:data:loader block of your MathJax configuration, and add
'textmacros' to the :data:packages array of the :data:tex
block.
.. code-block:: javascript
window.MathJax = { loader: {load: ['[tex]/textmacros']}, tex: {packages: {'[+]': ['textmacros']}} };
Alternatively, use \require{textmacros} in a TeX expression to load it
dynamically from within the math on the page, if the :ref:tex-require
extension is loaded.
Since the textmacros extension is included in the combined
components that contain the TeX input jax, it may already be in the
package list. In that case, if you want to disable it, you can remove
it:
.. code-block:: javascript
window.MathJax = { tex: {packages: {'[-]': ['textmacros']}} };
The macros available in text mode with this extension are listed
below. In addition, any macro that is defined via \def or
\newcommand or in the :data:macros section of the :data:tex
configuration block will also be processed if they only contain macros
from the list below. Some extensions (e.g., the :ref:tex-bboldx and
:ref:tex-textcomp packages) add more macros to this list when they
are loaded.
.. raw:: html
<style> .wy-table-responsive table {width: 100%} .rst-content .wy-table-responsive table code.literal {background: inherit} </style>.. list-table::
~'.. list-table::
$\(\).. list-table::
\$\_\%\{\}\ (backslash-space)\&\#\\.. list-table::
\'\’\‘\^\"\~\=\.\u\v\underline.. list-table::
\emph\rm\mit\oldstyle\cal\it\bf\sf\tt\frak\Bbb\textnormal\textup\textrm\textit\textbf\textsf\texttt.. list-table::
\tiny\Tiny\scriptsize\small\normalsize\large\Large\LARGE\huge\Huge.. list-table::
\dagger\ddagger\S\AA\ldots\vdots.. list-table::
\,\:\>\;\!\enspace\quad\qquad\thinspace\negthinspace\hskip\hspace\kern\mkern\mskip\mspace\rule\Rule\Space.. list-table::
\color\textcolor\colorbox\fcolorbox.. list-table::
\href\style\class\data\cssId.. list-table::
\char\U\unicode\mmlToken.. list-table::
\ref\eqref.. list-table::
\llap\rlap\phantom\hphantom\vphantom\smashYou can configure the textmacros extension to use additional
packages, just as you can specify additional math TeX packages.
Normally, these should be packages designed for text mode, but it is
possible to load some of the regular TeX packages as text macros. For
example
.. code:: javascript
MathJax = { loader: {load: ['[tex]/textmacros', '[tex]/bbox']}, tex: { packages: {'[+]': ['textmacros', 'bbox']}, textmacros: { packages: {'[+]': ['bbox']} } } }
would make the :ref:tex-bbox extension available in text mode, so
you could use \bbox inside \text{}, for example. Not all
math-mode extensions are appropriate for textmode, but some can be
usefully employed in text mode.
|-----|