cdocutils.nodes document q)q}q(U nametypesq}q(Xthe mathjax processing modelqNX%how mathematics is stored in the pageqNXthe components of mathjaxqNuUsubstitution_defsq }q Uparse_messagesq ]q Ucurrent_sourceq NU decorationqNUautofootnote_startqKUnameidsq}q(hUthe-mathjax-processing-modelqhU%how-mathematics-is-stored-in-the-pageqhUthe-components-of-mathjaxquUchildrenq]qcdocutils.nodes section q)q}q(U rawsourceqUUparentqhUsourceqcdocutils.nodes reprunicode qXO/Data/Code/JavaScript/MathJax/Code/SourceForge/trunk/mathjax/docs/rst/model.rstqq}q bUtagnameq!Usectionq"U attributesq#}q$(Udupnamesq%]q&Uclassesq']q(Ubackrefsq)]q*Uidsq+]q,haUnamesq-]q.hauUlineq/KUdocumentq0hh]q1(cdocutils.nodes title q2)q3}q4(hXThe MathJax Processing Modelq5hhhhh!Utitleq6h#}q7(h%]q8h']q9h)]q:h+]q;h-]qXThe MathJax Processing Modelq?q@}qA(hh5hh3ubaubcdocutils.nodes paragraph qB)qC}qD(hXThe purpose of MathJax is to bring the ability to include mathematics easily in web pages to as wide a range of browsers as possible. Authors can specify mathematics in a variety of formats (e.g., :term:`MathML` or :term:`LaTeX`), and MathJax provides high-quality mathematical typesetting even in those browsers that do not have native MathML support. This all happens without the need for special downloads or plugins, but rendering will be enhanced if high-quality math fonts (e.g., :term:`STIX`) are available to the browser.qEhhhhh!U paragraphqFh#}qG(h%]qHh']qIh)]qJh+]qKh-]qLuh/Kh0hh]qM(h>XThe purpose of MathJax is to bring the ability to include mathematics easily in web pages to as wide a range of browsers as possible. Authors can specify mathematics in a variety of formats (e.g., qNqO}qP(hXThe purpose of MathJax is to bring the ability to include mathematics easily in web pages to as wide a range of browsers as possible. Authors can specify mathematics in a variety of formats (e.g., qQhhCubcsphinx.addnodes pending_xref qR)qS}qT(hX:term:`MathML`qUhhCh!U pending_xrefqVh#}qW(UreftypeqXXtermqYU reftargetqZXmathmlq[U refdomainq\Xstdq]h+]q^h)]q_U refexplicitq`h%]qah']qbh-]qcUrefdocqdUmodelqeuh/Kh]qfcdocutils.nodes emphasis qg)qh}qi(hhUh#}qj(h%]qkh']ql(Uxrefqmh]Xstd-termqneh)]qoh+]qph-]qquhhSh]qrh>XMathMLqsqt}qu(hUhhhubah!Uemphasisqvubaubh>X or qwqx}qy(hX or qzhhCubhR)q{}q|(hX :term:`LaTeX`q}hhCh!hVh#}q~(UreftypeqXtermqhZXlatexqU refdomainqXstdqh+]qh)]qU refexplicitqh%]qh']qh-]qhdheuh/Kh]qhg)q}q(hh}h#}q(h%]qh']q(hmhXstd-termqeh)]qh+]qh-]quhh{h]qh>XLaTeXqq}q(hUhhubah!hvubaubh>X), and MathJax provides high-quality mathematical typesetting even in those browsers that do not have native MathML support. This all happens without the need for special downloads or plugins, but rendering will be enhanced if high-quality math fonts (e.g., qq}q(hX), and MathJax provides high-quality mathematical typesetting even in those browsers that do not have native MathML support. This all happens without the need for special downloads or plugins, but rendering will be enhanced if high-quality math fonts (e.g., qhhCubhR)q}q(hX :term:`STIX`qhhCh!hVh#}q(UreftypeqXtermqhZXstixqU refdomainqXstdqh+]qh)]qU refexplicitqh%]qh']qh-]qhdheuh/Kh]qhg)q}q(hhh#}q(h%]qh']q(hmhXstd-termqeh)]qh+]qh-]quhhh]qh>XSTIXqq}q(hUhhubah!hvubaubh>X) are available to the browser.qq}q(hX) are available to the browser.qhhCubeubhB)q}q(hXMathJax is broken into several different kinds of components: page preprocessors, input processors, output processors, and the MathJax Hub that organizes and connects the others. The input and output processors are called :term:`jax`, and are described in more detail below.qhhhhh!hFh#}q(h%]qh']qh)]qh+]qh-]quh/Kh0hh]q(h>XMathJax is broken into several different kinds of components: page preprocessors, input processors, output processors, and the MathJax Hub that organizes and connects the others. The input and output processors are called qDžq}q(hXMathJax is broken into several different kinds of components: page preprocessors, input processors, output processors, and the MathJax Hub that organizes and connects the others. The input and output processors are called qhhubhR)q}q(hX :term:`jax`qhhh!hVh#}q(UreftypeqXtermqhZXjaxqU refdomainqXstdqh+]qh)]qU refexplicitq։h%]qh']qh-]qhdheuh/Kh]qhg)q}q(hhh#}q(h%]qh']q(hmhXstd-termqeh)]qh+]qh-]quhhh]qh>Xjaxq允q}q(hUhhubah!hvubaubh>X), and are described in more detail below.q腁q}q(hX), and are described in more detail below.qhhubeubhB)q}q(hXWhen MathJax runs, it looks through the page for special tags that hold mathematics; for each such tag, it locates an appropriate input jax which it uses to convert the mathematics into an internal form (called an element jax), and then calls an output jax to transform the internal format into HTML content that displays the mathematics within the page. The page author configures MathJax by indicating which input and output jax are to be used.qhhhhh!hFh#}q(h%]qh']qh)]qh+]qh-]quh/Kh0hh]qh>XWhen MathJax runs, it looks through the page for special tags that hold mathematics; for each such tag, it locates an appropriate input jax which it uses to convert the mathematics into an internal form (called an element jax), and then calls an output jax to transform the internal format into HTML content that displays the mathematics within the page. The page author configures MathJax by indicating which input and output jax are to be used.qq}q(hhhhubaubhB)q}q(hXOften, and especially with pages that are authored by hand, the mathematics is not stored (initially) within the special tags needed by MathJax, as that would require more notation than the average page author is willing to type. Instead, it is entered in a form that is more natural to the page author, for example, using the standard TeX math delimiters ``$...$`` and ``$$...$$`` to indicate what part of the document is to be typeset as mathematics. In this case, MathJax can run a preprocessor to locate the math delimiters and replace them by the special tags that it uses to mark the formulas. There are preprocessors for :ref:`TeX notation `, :ref:`MathML notation `, and the :ref:`jsMath notation ` that uses `span` and `div` tags.qhhhhh!hFh#}q(h%]qh']qh)]qh+]rh-]ruh/Kh0hh]r(h>XeOften, and especially with pages that are authored by hand, the mathematics is not stored (initially) within the special tags needed by MathJax, as that would require more notation than the average page author is willing to type. Instead, it is entered in a form that is more natural to the page author, for example, using the standard TeX math delimiters rr}r(hXeOften, and especially with pages that are authored by hand, the mathematics is not stored (initially) within the special tags needed by MathJax, as that would require more notation than the average page author is willing to type. Instead, it is entered in a form that is more natural to the page author, for example, using the standard TeX math delimiters rhhubcdocutils.nodes literal r)r}r (hX ``$...$``r h#}r (h%]r h']r h)]rh+]rh-]ruhhh]rh>X$...$rr}r(hUhjubah!Uliteralrubh>X and rr}r(hX and rhhubj)r}r(hX ``$$...$$``rh#}r(h%]rh']rh)]r h+]r!h-]r"uhhh]r#h>X$$...$$r$r%}r&(hUhjubah!jubh>X to indicate what part of the document is to be typeset as mathematics. In this case, MathJax can run a preprocessor to locate the math delimiters and replace them by the special tags that it uses to mark the formulas. There are preprocessors for r'r(}r)(hX to indicate what part of the document is to be typeset as mathematics. In this case, MathJax can run a preprocessor to locate the math delimiters and replace them by the special tags that it uses to mark the formulas. There are preprocessors for r*hhubhR)r+}r,(hX!:ref:`TeX notation `r-hhh!hVh#}r.(Ureftyper/Xrefr0hZX tex-supportr1U refdomainr2Xstdr3h+]r4h)]r5U refexplicitr6h%]r7h']r8h-]r9hdheuh/Kh]r:hg)r;}r<(hj-h#}r=(h%]r>h']r?(hmj3Xstd-refr@eh)]rAh+]rBh-]rCuhj+h]rDh>X TeX notationrErF}rG(hUhj;ubah!hvubaubh>X, rHrI}rJ(hX, rKhhubhR)rL}rM(hX':ref:`MathML notation `rNhhh!hVh#}rO(UreftyperPXrefrQhZXmathml-supportrRU refdomainrSXstdrTh+]rUh)]rVU refexplicitrWh%]rXh']rYh-]rZhdheuh/Kh]r[hg)r\}r](hjNh#}r^(h%]r_h']r`(hmjTXstd-refraeh)]rbh+]rch-]rduhjLh]reh>XMathML notationrfrg}rh(hUhj\ubah!hvubaubh>X , and the rirj}rk(hX , and the rlhhubhR)rm}rn(hX':ref:`jsMath notation `rohhh!hVh#}rp(UreftyperqXrefrrhZXjsmath-supportrsU refdomainrtXstdruh+]rvh)]rwU refexplicitrxh%]ryh']rzh-]r{hdheuh/Kh]r|hg)r}}r~(hjoh#}r(h%]rh']r(hmjuXstd-refreh)]rh+]rh-]ruhjmh]rh>XjsMath notationrr}r(hUhj}ubah!hvubaubh>X that uses rr}r(hX that uses rhhubcdocutils.nodes title_reference r)r}r(hX`span`rh#}r(h%]rh']rh)]rh+]rh-]ruhhh]rh>Xspanrr}r(hUhjubah!Utitle_referencerubh>X and rr}r(hX and rhhubj)r}r(hX`div`rh#}r(h%]rh']rh)]rh+]rh-]ruhhh]rh>Xdivrr}r(hUhjubah!jubh>X tags.rr}r(hX tags.rhhubeubhB)r}r(hXaFor pages that are constructed programatically, such as HTML pages that result from running a processor on text in some other format (e.g., pages produced from Markdown documents, or via programs like `tex4ht`), it would be best to use MathJax's special tags directly, as described below, rather than having MathJax run another preprocessor. This will speed up the final display of the mathematics, since the extra preprocessing step would not be needed, and it also avoids the conflict between the use of the less-than sign, ``<``, in mathematics and asn an HTML special character (that starts an HTML tag).rhhhhh!hFh#}r(h%]rh']rh)]rh+]rh-]ruh/K)h0hh]r(h>XFor pages that are constructed programatically, such as HTML pages that result from running a processor on text in some other format (e.g., pages produced from Markdown documents, or via programs like rr}r(hXFor pages that are constructed programatically, such as HTML pages that result from running a processor on text in some other format (e.g., pages produced from Markdown documents, or via programs like rhjubj)r}r(hX`tex4ht`rh#}r(h%]rh']rh)]rh+]rh-]ruhjh]rh>Xtex4htrr}r(hUhjubah!jubh>X>), it would be best to use MathJax's special tags directly, as described below, rather than having MathJax run another preprocessor. This will speed up the final display of the mathematics, since the extra preprocessing step would not be needed, and it also avoids the conflict between the use of the less-than sign, rr}r(hX>), it would be best to use MathJax's special tags directly, as described below, rather than having MathJax run another preprocessor. This will speed up the final display of the mathematics, since the extra preprocessing step would not be needed, and it also avoids the conflict between the use of the less-than sign, rhjubj)r}r(hX``<``rh#}r(h%]rh']rh)]rh+]rh-]ruhjh]rh>XXM, in mathematics and asn an HTML special character (that starts an HTML tag).rr}r(hXM, in mathematics and asn an HTML special character (that starts an HTML tag).rhjubeubh)r}r(hUhhhhh!h"h#}r(h%]rh']rh)]rh+]rhah-]rhauh/K6h0hh]r(h2)r}r(hX%How mathematics is stored in the pagerhjhhh!h6h#}r(h%]rh']rh)]rh+]rh-]ruh/K6h0hh]rh>X%How mathematics is stored in the pagerr}r(hjhjubaubhB)r}r(hXIn order to identify mathematics in the page, MathJax uses special ``rhjhhh!U literal_blockrh#}r(UlinenosrUlanguagerXhtmlrU xml:spacerUpreserverh+]rh)]rh%]rh']rh-]ruh/KPh0hh]rh>X/rr}r(hUhjubaubhB)r}r(hX3represents an in-line equation in TeX notation, andrhjhhh!hFh#}r(h%]rh']rh)]rh+]rh-]ruh/KQh0hh]rh>X3represents an in-line equation in TeX notation, andrr}r(hjhjubaubj)r}r(hXbrhjhhh!jh#}r(jjXhtmlrjjh+]rh)]rh%]rh']rh-]ruh/KXh0hh]rh>Xbrr}r(hUhjubaubhB)r}r(hXis a displayed TeX equation.rhjhhh!hFh#}r(h%]rh']rh)]rh+]rh-]ruh/KYh0hh]rh>Xis a displayed TeX equation.rr}r(hjhjubaubhB)r}r(hX3Alternatively, using MathML notation, you could userhjhhh!hFh#}r (h%]r h']r h)]r h+]r h-]ruh/K[h0hh]rh>X3Alternatively, using MathML notation, you could userr}r(hjhjubaubj)r}r(hXrhjhhh!jh#}r(jjXhtmlrjjh+]rh)]rh%]rh']rh-]ruh/Kmh0hh]rh>Xrr}r (hUhjubaubhB)r!}r"(hXfor in-line math, orr#hjhhh!hFh#}r$(h%]r%h']r&h)]r'h+]r(h-]r)uh/Knh0hh]r*h>Xfor in-line math, orr+r,}r-(hj#hj!ubaubj)r.}r/(hXr0hjhhh!jh#}r1(jjXhtmlr2jjh+]r3h)]r4h%]r5h']r6h-]r7uh/Kh0hh]r8h>Xr9r:}r;(hUhj.ubaubhB)r<}r=(hXfor displayed equations in MathML notation. As other input jax are created, they will use other types to identify the mathematics they can process.r>hjhhh!hFh#}r?(h%]r@h']rAh)]rBh+]rCh-]rDuh/Kh0hh]rEh>Xfor displayed equations in MathML notation. As other input jax are created, they will use other types to identify the mathematics they can process.rFrG}rH(hj>hj<ubaubhB)rI}rJ(hXyPage authors can use one of MathJax's preprocessors to convert from math delimiters that are more natural for the author to type (e.g., TeX math delimiters like ``$$...$$``) to MathJax's ``