.. _tex-options: ########################### TeX Input Processor Options ########################### The options below control the operation of the :ref:`TeX input processor ` that is run when you include ``'input/tex'`` or ``'input/tex-base'`` in the :data:`load` array of the :data:`loader` block of your MathJax configuration, or if you load a combined component that includes the TeX input jax. They are listed with their default values. To set any of these options, include a :data:`tex` section in your :data:`MathJax` global object. ----- The Configuration Block ======================= .. code-block:: javascript MathJax = { tex: { packages: ['base'], // extensions to use inlineMath: [ // start/end delimiter pairs for in-line math ['\\(', '\\)'] ], displayMath: [ // start/end delimiter pairs for display math ['$$', '$$'], ['\\[', '\\]'] ], processEscapes: true, // use \$ to produce a literal dollar sign processEnvironments: true, // process \begin{xxx}...\end{xxx} outside math mode processRefs: true, // process \ref{...} outside of math mode numberPattern: // pattern for recognizing numbers /^(?:[0-9]+(?:\{,\}[0-9]{3})*(?:\.[0-9]*)?|\.[0-9]+)/, initialDigit: /[0-9.,]/, // pattern for initial digit or decimal point for a number identifierPattern: /^[a-zA-Z]+/, // pattern for multiLetterIdentifiers in \mathrm, etc. initialLetter: /[a-zA-Z]/, // pattern for initial letter in identifiers tags: 'none', // or 'ams' or 'all' tagSide: 'right', // side for \tag macros tagIndent: '0.8em', // amount to indent tags tagAlign: 'baseline', // The rowalign value to use for tag cells useLabelIds: true, // use label name rather than tag for ids ignoreDuplicateLabels: false, // prevent error messages for duplicate label ids? mathStyle: 'TeX', // one of TeX, ISO, French, or upright maxBuffer: 5 * 1024, // maximum size for the internal TeX string (5K) maxTemplateSubtitutions: 10000, // maximum number of array template substitutions baseURL: // URL for use with links to tags (when there is a tag in effect) (document.getElementsByTagName('base').length === 0) ? '' : String(document.location).replace(/#.*$/, ''), formatError: // function called when TeX syntax errors occur (jax, err) => jax.formatError(err), preFilters: [], // A list of pre-filters to add to the TeX input jax postFilters: [], // A list of post-filters to add to the TeX input jax } }; Note that some extensions make additional options available. See the :ref:`tex-extension-options` section below for details. .. note:: The default for :data:`processEscapes` has changed from ``false`` in version 2 to ``true`` in version 3 and above. .. note:: Prior to version 3.2, the :data:`multlineWidth` option used to be in the main :data:`tex` block, but it is now in the :data:`ams` sub-block of the :data:`tex` block. Version 3.2 includes code to move the configuration from its old location to its new one, but that backward-compatibility code has been removed in version 4. .. note:: The :data:`digits` option has been renamed :data:`numberPattern` in version 4. Additional options are described in the :ref:`input-common-options` section. ----- Option Descriptions =================== .. _tex-packages: .. describe:: packages: ['base'] This array lists the names of the packages that should be initialized by the TeX input processor. The :ref:`input/tex ` and :ref:`input/tex-base ` components automatically add to this list the packages that they load. If you explicitly load additional tex extensions, you should add them to this list. For example: .. code-block:: javascript MathJax = { loader: {load: ['[tex]/enclose']}, tex: { packages: {'[+]': ['enclose']} } }; This loads the :ref:`tex-enclose` extension and activates it by including it in the package list. You can remove packages from the default list using ``'[-]'`` rather than ``[+]``, as in the following example: .. code-block:: javascript MathJax = { tex: { packages: {'[-]': ['noundefined']} } }; This would disable the :ref:`tex-noundefined` extension, so that unknown macro names would cause error messages rather than be displayed in red. If you need to both remove some default packages and add new ones, you can do so by including both within the braces: .. code-block:: javascript MathJax = { loader: {load: ['[tex]/enclose']}, tex: { packages: {'[-]': ['noundefined', 'autoload'], '[+]': ['enclose']} } }; This disables the :ref:`tex-noundefined` and :ref:`tex-autoload` extensions, and adds in the :ref:`tex-enclose` extension. .. _tex-inlineMath: .. describe:: inlineMath: [['\\(','\\)']] This is an array of pairs of strings that are to be used as in-line math delimiters. The first in each pair is the initial delimiter and the second is the terminal delimiter. You can have as many pairs as you want. For example, .. code-block:: javascript inlineMath: {'[+]': [['$','$']]} would add dollar sign delimiters to the default list, causing MathJax to look for ``$...$`` and ``\(...\)`` as delimiters for in-line mathematics. Note that the single dollar signs are not enabled by default because they are used too frequently in normal text, so if you want to use them for math delimiters, you must specify them explicitly. .. warning:: The delimiters can't look like HTML tags (i.e., can't include the less-than sign), as these would be turned into tags by the browser before MathJax has the chance to run. You can only include text, not tags, as your math delimiters. It is possible, however, to use a custom render action to look for such tags. The :ref:`v2-api-changes` section includes an example of how to do this for the v2-style ``