Skip to content

Commit

Permalink
Merge branch 'v3.0-latest'
Browse files Browse the repository at this point in the history
  • Loading branch information
dpvc committed Sep 15, 2019
2 parents 966d3a9 + 9cf1a9d commit 4a5ba96
Show file tree
Hide file tree
Showing 4 changed files with 95 additions and 123 deletions.
89 changes: 89 additions & 0 deletions options/document.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@ The Configuration Block
MathJax = {
options: {
skipHtmlTags: [ // HTML tags that won't be searched for math
'script', 'noscript', 'style', 'textarea', 'pre',
'code', 'annotation', 'annotation-xml'
],
includeHtmlTags: { // HTML tags that can appear within math
br: '\n', wbr: '', '#comment': ''
},
ignoreHtmlClass: 'tex2jax_ignore', // class that marks tags not to search
processHtmlClass: 'tex2jax_process', // class that marks tags that should be searched
compileError: function (doc, math, err) {doc.compileError(math, err)},
typesetError: function (doc, math, err) {doc.typesetError(math, err)},
renderActions: {...}
Expand All @@ -30,6 +39,86 @@ The Configuration Block
Option Descriptions
===================

.. raw:: html

<style>
.rst-content dl.describe > dt:first-child {
margin-bottom: 0;
}
.rst-content dl.describe > dt + dt {
margin-top: 0;
border-top: none;
padding-left: 6em;
}
.rst-content dl.describe > dt + dd {
margin-top: 6px;
}
</style>


.. _skipHtmlTags:
.. describe:: skipHtmlTags: ['script', 'noscript', 'style', 'textarea',
'pre', 'code', 'annotation', 'annotation-xml']

This array lists the names of the tags whose contents should not
be processed by MathJaX (other than to look for ignore/process
classes as listed below). You can add to (or remove from) this
list to prevent MathJax from processing mathematics in specific
contexts. E.g.,

.. code-block:: javascript
skipHtmlTags: {'[-]': ['code', 'pre'], '[+]': ['li']}
would remove ``'code'`` and ``'pre'`` tags from the list, while
adding ``'li'`` tags to the list.

.. _includeHtmlTags:
.. describe:: includeHtmlTags: {br: '\n', wbr: '', '#comment': ''}

This object specifies what tags can appear within a math
expression, and what text to replace them by within the math. The
default is to allow ``<br>``, which becomes a newline, and ``<wbr>``
and HTML comments, which are removed entirely.

.. _ignoreHtmlClass:
.. describe:: ignoreHtmlClass: 'mathjax_ignore'

This is the class name used to mark elements whose contents should
not be processed by MathJax (other than to look for the
``processHtmlClass`` pattern below). Note that this is a regular
expression, and so you need to be sure to quote any `regexp`
special characters. The pattern is inserted into one that
requires your pattern to match a complete word, so setting
``ignoreHtmlClass: 'class2'`` would cause it to match an element with
``class='class1 class2 class3'`` but not ``class='myclass2'``.
Note that you can assign several classes by separating them by the
vertical line character (``|``). For instance, with
``ignoreHtmlClass: 'class1|class2'`` any element assigned a class of
either ``class1`` or ``class2`` will be skipped. This could also
be specified by ``ignoreHtmlClass: 'class[12]'``, which matches
``class`` followed by either a ``1`` or a ``2``.

.. _processHtmlClass:
.. describe:: processHtmlClass: 'mathjax_process'

This is the class name used to mark elements whose contents
*should* be processed by MathJax. This is used to restart
processing within tags that have been marked as ignored via the
``ignoreHtmlClass`` or to cause a tag that appears in the ``skipHtmlTags``
list to be processed rather than skipped. Note that this is a
regular expression, and so you need to be sure to quote any
`regexp` special characters. The pattern is inserted into one
that requires your pattern to match a complete word, so setting
``processHtmlClass: 'class2'`` would cause it to match an element with
``class='class1 class2 class3'`` but not ``class='myclass2'``.
Note that you can assign several classes by separating them by the
vertical line character (``|``). For instance, with
``processHtmlClass: 'class1|class2'`` any element assigned a class of
either ``class1`` or ``class2`` will have its contents processed.
This could also be specified by ``processHtmlClass: 'class[12]'``,
which matches ``class`` followed by either a ``1`` or a ``2``.

.. _document-compileError:
.. describe:: compileError: function (doc, math, err) {doc.compileError(math, err)}

Expand Down
9 changes: 0 additions & 9 deletions options/input/asciimath.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,6 @@ The Configuration Block
fixphi: true, // true for TeX mapping, false for unicode mapping
displaystyle: true, // true for displaystyle typesetting, false for in-line
decimalsign: '.' // character to use for decimal separator
skipHtmlTags: [ // HTML tags that won't be searched for math
'script', 'noscript', 'style', 'textarea', 'pre',
'code', 'annotation', 'annotation-xml'
],
includeHtmlTags: { // HTML tags that can appear within math
br: '\n', wbr: '', '#comment': ''
},
ignoreHtmlClass: 'mathjax_ignore', // class that marks tags not to search
processHtmlClass: 'mathjax_process' // class that marks tags that should be searched
}
};
Expand Down
111 changes: 6 additions & 105 deletions options/input/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,110 +18,11 @@ Input Processor Options
Options Common to All Input Processors
======================================

The following options are common to all the input processors listed
above. They are given here with their default values, using the
``tex`` block as an example.

.. code-block:: javascript
MathJax = {
tex: {
skipHtmlTags: [ // HTML tags that won't be searched for math
'script', 'noscript', 'style', 'textarea', 'pre',
'code', 'annotation', 'annotation-xml'
],
includeHtmlTags: { // HTML tags that can appear within math
br: '\n', wbr: '', '#comment': ''
},
ignoreHtmlClass: 'mathjax_ignore', // class that marks tags not to search
processHtmlClass: 'mathjax_process' // class that marks tags that should be searched
}
};
-----


Option Descriptions
===================

.. raw:: html

<style>
.rst-content dl.describe > dt:first-child {
margin-bottom: 0;
}
.rst-content dl.describe > dt + dt {
margin-top: 0;
border-top: none;
padding-left: 6em;
}
.rst-content dl.describe > dt + dd {
margin-top: 6px;
}
</style>


.. _skipHtmlTags:
.. describe:: skipHtmlTags: ['script', 'noscript', 'style', 'textarea',
'pre', 'code', 'annotation', 'annotation-xml']

This array lists the names of the tags whose contents should not
be processed by MathJaX (other than to look for ignore/process
classes as listed below). You can add to (or remove from) this
list to prevent MathJax from processing mathematics in specific
contexts. E.g.,

.. code-block:: javascript
skipHtmlTags: {'[-]': ['code', 'pre'], '[+]': ['li']}
would remove ``'code'`` and ``'pre'`` tags from the list, while
adding ``'li'`` tags to the list.

.. _includeHtmlTags:
.. describe:: includeHtmlTags: {br: '\n', wbr: '', '#comment': ''}

This object specifies what tags can appear within a math
expression, and what text to replace them by within the math. The
default is to allow ``<br>``, which becomes a newline, and ``<wbr>``
and HTML comments, which are removed entirely.

.. _ignoreHtmlClass:
.. describe:: ignoreHtmlClass: 'mathjax_ignore'

This is the class name used to mark elements whose contents should
not be processed by MathJax (other than to look for the
``processHtmlClass`` pattern below). Note that this is a regular
expression, and so you need to be sure to quote any `regexp`
special characters. The pattern is inserted into one that
requires your pattern to match a complete word, so setting
``ignoreHtmlClass: 'class2'`` would cause it to match an element with
``class='class1 class2 class3'`` but not ``class='myclass2'``.
Note that you can assign several classes by separating them by the
vertical line character (``|``). For instance, with
``ignoreHtmlClass: 'class1|class2'`` any element assigned a class of
either ``class1`` or ``class2`` will be skipped. This could also
be specified by ``ignoreHtmlClass: 'class[12]'``, which matches
``class`` followed by either a ``1`` or a ``2``.

.. _processHtmlClass:
.. describe:: processHtmlClass: 'mathjax_process'

This is the class name used to mark elements whose contents
*should* be processed by MathJax. This is used to restart
processing within tags that have been marked as ignored via the
``ignoreHtmlClass`` or to cause a tag that appears in the ``skipHtmlTags``
list to be processed rather than skipped. Note that this is a
regular expression, and so you need to be sure to quote any
`regexp` special characters. The pattern is inserted into one
that requires your pattern to match a complete word, so setting
``processHtmlClass: 'class2'`` would cause it to match an element with
``class='class1 class2 class3'`` but not ``class='myclass2'``.
Note that you can assign several classes by separating them by the
vertical line character (``|``). For instance, with
``processHtmlClass: 'class1|class2'`` any element assigned a class of
either ``class1`` or ``class2`` will have its contents processed.
This could also be specified by ``processHtmlClass: 'class[12]'``,
which matches ``class`` followed by either a ``1`` or a ``2``.
There are no options that are common to all input jax, but a number of
the :ref:`document-options` affect what portions of the document will
be processed by the input jax that scan the page for delimiters (i.e.,
TeX and AsciiMath). In particular, the options that correspond to the
version-2 options ``skipTags``, ``includeTags``, and similar options
for the various v2 pre-processors are now document-level options.

|-----|
9 changes: 0 additions & 9 deletions options/input/tex.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,6 @@ The Configuration Block
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
skipHtmlTags: [ // HTML tags that won't be searched for math
'script', 'noscript', 'style', 'textarea', 'pre',
'code', 'annotation', 'annotation-xml'
],
includeHtmlTags: { // HTML tags that can appear within math
br: '\n', wbr: '', '#comment': ''
},
ignoreHtmlClass: 'tex2jax_ignore', // class that marks tags not to search
processHtmlClass: 'tex2jax_process', // class that marks tags that should be searched
digits: /^(?:[0-9]+(?:\{,\}[0-9]{3})*(?:\.[0-9]*)?|\.[0-9]+)/,
// pattern for recognizing numbers
tags: 'none', // or 'ams' or 'all'
Expand Down

0 comments on commit 4a5ba96

Please sign in to comment.