Skip to content

Commit da3a15a

Browse files
committed
More updates to the TeX documentation
1 parent 90f9948 commit da3a15a

File tree

4 files changed

+151
-8
lines changed

4 files changed

+151
-8
lines changed

docs/html/_sources/tex.txt

Lines changed: 52 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,9 @@ this may be better than loading the extension explicitly, since it
347347
avoids loading the extra file on pages where these macros are *not*
348348
used. The `sample autoloading macros
349349
<http://cdn.mathjax.org/mathjax/latest/test/sample-autoload.html>`_
350-
example page shows this in action.
350+
example page shows this in action. The `autoload-all` extension below
351+
defines such macros for *all* the extensions so that if you include
352+
it, MathJax will have access to all the macros it knows about.
351353

352354
The main extensions are described below.
353355

@@ -594,7 +596,7 @@ To use this extension in your own configurations, add it to the
594596
.. code-block:: javascript
595597

596598
TeX: {
597-
extensions: ["action.js"]
599+
extensions: ["enclose.js"]
598600
}
599601

600602
This extension is **not** included in any of the combined configurations,
@@ -885,6 +887,53 @@ array. You can configure the extension as follows:
885887
}
886888

887889

890+
Autoload-all
891+
------------
892+
893+
The `autoload-all` extension predefines all the macros from the
894+
extensions above so that they autoload the extensions when first
895+
used. A number of macros already do this, e.g., ``\unicode``, but
896+
this extension defines the others to do the same. That way MathJax
897+
will have access to all the macros that it knows about.
898+
899+
To use this extension in your own configurations, add it to the
900+
`extensions` array in the TeX block.
901+
902+
.. code-block:: javascript
903+
904+
TeX: {
905+
extensions: ["autoload-all.js"]
906+
}
907+
908+
This extension is **not** included in any of the combined configurations,
909+
and will not be loaded automatically, so you must include it
910+
explicitly in your configuration if you wish to use these commands.
911+
912+
Note that `autoload-all` redefines ``\color`` to be the one from the
913+
`color` extension (the LaTeX-compatible one rather than the
914+
non-standard MathJax version). This is because ``\colorbox`` and
915+
``\fcolorbox`` autoload the `color` extension, which will cause
916+
``\color`` to be redefined, and so for consistency, ``\color`` is
917+
redefined immediately.
918+
919+
If you wish to retain the original definition of ``\color``, then use
920+
the following
921+
922+
.. code-block:: html
923+
924+
<script type="text/x-mathjax-config">
925+
MathJax.Hub.Config({
926+
TeX: { extensions: ["autoload-all.js"] }
927+
});
928+
MathJax.Hub.Register.StartupHook("TeX autoload-all Ready", function () {
929+
var MACROS = MathJax.InputJax.TeX.Definitions.macros;
930+
MACROS.color = "Color";
931+
delete MACROS.colorbox;
932+
delete MACROS.fcolorbox;
933+
});
934+
</script>
935+
936+
888937
.. _tex-commands:
889938

890939
Supported LaTeX commands
@@ -1292,6 +1341,7 @@ L
12921341

12931342
.. code-block:: latex
12941343

1344+
\label [AMSmath]
12951345
\Lambda
12961346
\lambda
12971347
\land

docs/html/searchindex.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/html/tex.html

Lines changed: 46 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,9 @@ <h2>TeX and LaTeX in HTML documents<a class="headerlink" href="#tex-and-latex-in
333333
this may be better than loading the extension explicitly, since it
334334
avoids loading the extra file on pages where these macros are <em>not</em>
335335
used. The <a class="reference external" href="http://cdn.mathjax.org/mathjax/latest/test/sample-autoload.html">sample autoloading macros</a>
336-
example page shows this in action.</p>
336+
example page shows this in action. The <cite>autoload-all</cite> extension below
337+
defines such macros for <em>all</em> the extensions so that if you include
338+
it, MathJax will have access to all the macros it knows about.</p>
337339
<p>The main extensions are described below.</p>
338340
<div class="section" id="action">
339341
<h3>Action<a class="headerlink" href="#action" title="Permalink to this headline"></a></h3>
@@ -551,7 +553,7 @@ <h3>Enclose<a class="headerlink" href="#enclose" title="Permalink to this headli
551553
<p>To use this extension in your own configurations, add it to the
552554
<cite>extensions</cite> array in the TeX block.</p>
553555
<div class="highlight-javascript"><div class="highlight"><pre><span class="nx">TeX</span><span class="o">:</span> <span class="p">{</span>
554-
<span class="nx">extensions</span><span class="o">:</span> <span class="p">[</span><span class="s2">&quot;action.js&quot;</span><span class="p">]</span>
556+
<span class="nx">extensions</span><span class="o">:</span> <span class="p">[</span><span class="s2">&quot;enclose.js&quot;</span><span class="p">]</span>
555557
<span class="p">}</span>
556558
</pre></div>
557559
</div>
@@ -804,6 +806,45 @@ <h3>Unicode support<a class="headerlink" href="#unicode-support" title="Permalin
804806
</pre></div>
805807
</div>
806808
</div>
809+
<div class="section" id="autoload-all">
810+
<h3>Autoload-all<a class="headerlink" href="#autoload-all" title="Permalink to this headline"></a></h3>
811+
<p>The <cite>autoload-all</cite> extension predefines all the macros from the
812+
extensions above so that they autoload the extensions when first
813+
used. A number of macros already do this, e.g., <tt class="docutils literal"><span class="pre">\unicode</span></tt>, but
814+
this extension defines the others to do the same. That way MathJax
815+
will have access to all the macros that it knows about.</p>
816+
<p>To use this extension in your own configurations, add it to the
817+
<cite>extensions</cite> array in the TeX block.</p>
818+
<div class="highlight-javascript"><div class="highlight"><pre><span class="nx">TeX</span><span class="o">:</span> <span class="p">{</span>
819+
<span class="nx">extensions</span><span class="o">:</span> <span class="p">[</span><span class="s2">&quot;autoload-all.js&quot;</span><span class="p">]</span>
820+
<span class="p">}</span>
821+
</pre></div>
822+
</div>
823+
<p>This extension is <strong>not</strong> included in any of the combined configurations,
824+
and will not be loaded automatically, so you must include it
825+
explicitly in your configuration if you wish to use these commands.</p>
826+
<p>Note that <cite>autoload-all</cite> redefines <tt class="docutils literal"><span class="pre">\color</span></tt> to be the one from the
827+
<cite>color</cite> extension (the LaTeX-compatible one rather than the
828+
non-standard MathJax version). This is because <tt class="docutils literal"><span class="pre">\colorbox</span></tt> and
829+
<tt class="docutils literal"><span class="pre">\fcolorbox</span></tt> autoload the <cite>color</cite> extension, which will cause
830+
<tt class="docutils literal"><span class="pre">\color</span></tt> to be redefined, and so for consistency, <tt class="docutils literal"><span class="pre">\color</span></tt> is
831+
redefined immediately.</p>
832+
<p>If you wish to retain the original definition of <tt class="docutils literal"><span class="pre">\color</span></tt>, then use
833+
the following</p>
834+
<div class="highlight-html"><div class="highlight"><pre><span class="nt">&lt;script </span><span class="na">type=</span><span class="s">&quot;text/x-mathjax-config&quot;</span><span class="nt">&gt;</span>
835+
<span class="nx">MathJax</span><span class="p">.</span><span class="nx">Hub</span><span class="p">.</span><span class="nx">Config</span><span class="p">({</span>
836+
<span class="nx">TeX</span><span class="o">:</span> <span class="p">{</span> <span class="nx">extensions</span><span class="o">:</span> <span class="p">[</span><span class="s2">&quot;autoload-all.js&quot;</span><span class="p">]</span> <span class="p">}</span>
837+
<span class="p">});</span>
838+
<span class="nx">MathJax</span><span class="p">.</span><span class="nx">Hub</span><span class="p">.</span><span class="nx">Register</span><span class="p">.</span><span class="nx">StartupHook</span><span class="p">(</span><span class="s2">&quot;TeX autoload-all Ready&quot;</span><span class="p">,</span> <span class="kd">function</span> <span class="p">()</span> <span class="p">{</span>
839+
<span class="kd">var</span> <span class="nx">MACROS</span> <span class="o">=</span> <span class="nx">MathJax</span><span class="p">.</span><span class="nx">InputJax</span><span class="p">.</span><span class="nx">TeX</span><span class="p">.</span><span class="nx">Definitions</span><span class="p">.</span><span class="nx">macros</span><span class="p">;</span>
840+
<span class="nx">MACROS</span><span class="p">.</span><span class="nx">color</span> <span class="o">=</span> <span class="s2">&quot;Color&quot;</span><span class="p">;</span>
841+
<span class="k">delete</span> <span class="nx">MACROS</span><span class="p">.</span><span class="nx">colorbox</span><span class="p">;</span>
842+
<span class="k">delete</span> <span class="nx">MACROS</span><span class="p">.</span><span class="nx">fcolorbox</span><span class="p">;</span>
843+
<span class="p">});</span>
844+
<span class="nt">&lt;/script&gt;</span>
845+
</pre></div>
846+
</div>
847+
</div>
807848
</div>
808849
<div class="section" id="supported-latex-commands">
809850
<span id="tex-commands"></span><h2>Supported LaTeX commands<a class="headerlink" href="#supported-latex-commands" title="Permalink to this headline"></a></h2>
@@ -1191,7 +1232,8 @@ <h3>K<a class="headerlink" href="#k" title="Permalink to this headline">¶</a></
11911232
</div>
11921233
<div class="section" id="l">
11931234
<h3>L<a class="headerlink" href="#l" title="Permalink to this headline"></a></h3>
1194-
<div class="highlight-latex"><div class="highlight"><pre><span class="k">\Lambda</span>
1235+
<div class="highlight-latex"><div class="highlight"><pre><span class="k">\label</span> [AMSmath]
1236+
<span class="k">\Lambda</span>
11951237
<span class="k">\lambda</span>
11961238
<span class="k">\land</span>
11971239
<span class="k">\langle</span>
@@ -1797,6 +1839,7 @@ <h3><a href="index.html">Table Of Contents</a></h3>
17971839
<li><a class="reference internal" href="#noerrors">noErrors</a></li>
17981840
<li><a class="reference internal" href="#noundefined">noUndefined</a></li>
17991841
<li><a class="reference internal" href="#unicode-support">Unicode support</a></li>
1842+
<li><a class="reference internal" href="#autoload-all">Autoload-all</a></li>
18001843
</ul>
18011844
</li>
18021845
<li><a class="reference internal" href="#supported-latex-commands">Supported LaTeX commands</a><ul>

docs/source/tex.rst

Lines changed: 52 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,9 @@ this may be better than loading the extension explicitly, since it
347347
avoids loading the extra file on pages where these macros are *not*
348348
used. The `sample autoloading macros
349349
<http://cdn.mathjax.org/mathjax/latest/test/sample-autoload.html>`_
350-
example page shows this in action.
350+
example page shows this in action. The `autoload-all` extension below
351+
defines such macros for *all* the extensions so that if you include
352+
it, MathJax will have access to all the macros it knows about.
351353

352354
The main extensions are described below.
353355

@@ -594,7 +596,7 @@ To use this extension in your own configurations, add it to the
594596
.. code-block:: javascript
595597
596598
TeX: {
597-
extensions: ["action.js"]
599+
extensions: ["enclose.js"]
598600
}
599601
600602
This extension is **not** included in any of the combined configurations,
@@ -885,6 +887,53 @@ array. You can configure the extension as follows:
885887
}
886888
887889
890+
Autoload-all
891+
------------
892+
893+
The `autoload-all` extension predefines all the macros from the
894+
extensions above so that they autoload the extensions when first
895+
used. A number of macros already do this, e.g., ``\unicode``, but
896+
this extension defines the others to do the same. That way MathJax
897+
will have access to all the macros that it knows about.
898+
899+
To use this extension in your own configurations, add it to the
900+
`extensions` array in the TeX block.
901+
902+
.. code-block:: javascript
903+
904+
TeX: {
905+
extensions: ["autoload-all.js"]
906+
}
907+
908+
This extension is **not** included in any of the combined configurations,
909+
and will not be loaded automatically, so you must include it
910+
explicitly in your configuration if you wish to use these commands.
911+
912+
Note that `autoload-all` redefines ``\color`` to be the one from the
913+
`color` extension (the LaTeX-compatible one rather than the
914+
non-standard MathJax version). This is because ``\colorbox`` and
915+
``\fcolorbox`` autoload the `color` extension, which will cause
916+
``\color`` to be redefined, and so for consistency, ``\color`` is
917+
redefined immediately.
918+
919+
If you wish to retain the original definition of ``\color``, then use
920+
the following
921+
922+
.. code-block:: html
923+
924+
<script type="text/x-mathjax-config">
925+
MathJax.Hub.Config({
926+
TeX: { extensions: ["autoload-all.js"] }
927+
});
928+
MathJax.Hub.Register.StartupHook("TeX autoload-all Ready", function () {
929+
var MACROS = MathJax.InputJax.TeX.Definitions.macros;
930+
MACROS.color = "Color";
931+
delete MACROS.colorbox;
932+
delete MACROS.fcolorbox;
933+
});
934+
</script>
935+
936+
888937
.. _tex-commands:
889938

890939
Supported LaTeX commands
@@ -1292,6 +1341,7 @@ L
12921341

12931342
.. code-block:: latex
12941343

1344+
\label [AMSmath]
12951345
\Lambda
12961346
\lambda
12971347
\land

0 commit comments

Comments
 (0)