Skip to content

Commit

Permalink
More updates to the TeX documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
dpvc committed Feb 22, 2012
1 parent 90f9948 commit da3a15a
Show file tree
Hide file tree
Showing 4 changed files with 151 additions and 8 deletions.
54 changes: 52 additions & 2 deletions docs/html/_sources/tex.txt
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,9 @@ this may be better than loading the extension explicitly, since it
avoids loading the extra file on pages where these macros are *not*
used. The `sample autoloading macros
<http://cdn.mathjax.org/mathjax/latest/test/sample-autoload.html>`_
example page shows this in action.
example page shows this in action. The `autoload-all` extension below
defines such macros for *all* the extensions so that if you include
it, MathJax will have access to all the macros it knows about.

The main extensions are described below.

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

TeX: {
extensions: ["action.js"]
extensions: ["enclose.js"]
}

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


Autoload-all
------------

The `autoload-all` extension predefines all the macros from the
extensions above so that they autoload the extensions when first
used. A number of macros already do this, e.g., ``\unicode``, but
this extension defines the others to do the same. That way MathJax
will have access to all the macros that it knows about.

To use this extension in your own configurations, add it to the
`extensions` array in the TeX block.

.. code-block:: javascript

TeX: {
extensions: ["autoload-all.js"]
}

This extension is **not** included in any of the combined configurations,
and will not be loaded automatically, so you must include it
explicitly in your configuration if you wish to use these commands.

Note that `autoload-all` redefines ``\color`` to be the one from the
`color` extension (the LaTeX-compatible one rather than the
non-standard MathJax version). This is because ``\colorbox`` and
``\fcolorbox`` autoload the `color` extension, which will cause
``\color`` to be redefined, and so for consistency, ``\color`` is
redefined immediately.

If you wish to retain the original definition of ``\color``, then use
the following

.. code-block:: html

<script type="text/x-mathjax-config">
MathJax.Hub.Config({
TeX: { extensions: ["autoload-all.js"] }
});
MathJax.Hub.Register.StartupHook("TeX autoload-all Ready", function () {
var MACROS = MathJax.InputJax.TeX.Definitions.macros;
MACROS.color = "Color";
delete MACROS.colorbox;
delete MACROS.fcolorbox;
});
</script>


.. _tex-commands:

Supported LaTeX commands
Expand Down Expand Up @@ -1292,6 +1341,7 @@ L

.. code-block:: latex

\label [AMSmath]
\Lambda
\lambda
\land
Expand Down
2 changes: 1 addition & 1 deletion docs/html/searchindex.js

Large diffs are not rendered by default.

49 changes: 46 additions & 3 deletions docs/html/tex.html
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,9 @@ <h2>TeX and LaTeX in HTML documents<a class="headerlink" href="#tex-and-latex-in
this may be better than loading the extension explicitly, since it
avoids loading the extra file on pages where these macros are <em>not</em>
used. The <a class="reference external" href="http://cdn.mathjax.org/mathjax/latest/test/sample-autoload.html">sample autoloading macros</a>
example page shows this in action.</p>
example page shows this in action. The <cite>autoload-all</cite> extension below
defines such macros for <em>all</em> the extensions so that if you include
it, MathJax will have access to all the macros it knows about.</p>
<p>The main extensions are described below.</p>
<div class="section" id="action">
<h3>Action<a class="headerlink" href="#action" title="Permalink to this headline"></a></h3>
Expand Down Expand Up @@ -551,7 +553,7 @@ <h3>Enclose<a class="headerlink" href="#enclose" title="Permalink to this headli
<p>To use this extension in your own configurations, add it to the
<cite>extensions</cite> array in the TeX block.</p>
<div class="highlight-javascript"><div class="highlight"><pre><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;action.js&quot;</span><span class="p">]</span>
<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>
<span class="p">}</span>
</pre></div>
</div>
Expand Down Expand Up @@ -804,6 +806,45 @@ <h3>Unicode support<a class="headerlink" href="#unicode-support" title="Permalin
</pre></div>
</div>
</div>
<div class="section" id="autoload-all">
<h3>Autoload-all<a class="headerlink" href="#autoload-all" title="Permalink to this headline"></a></h3>
<p>The <cite>autoload-all</cite> extension predefines all the macros from the
extensions above so that they autoload the extensions when first
used. A number of macros already do this, e.g., <tt class="docutils literal"><span class="pre">\unicode</span></tt>, but
this extension defines the others to do the same. That way MathJax
will have access to all the macros that it knows about.</p>
<p>To use this extension in your own configurations, add it to the
<cite>extensions</cite> array in the TeX block.</p>
<div class="highlight-javascript"><div class="highlight"><pre><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>
</pre></div>
</div>
<p>This extension is <strong>not</strong> included in any of the combined configurations,
and will not be loaded automatically, so you must include it
explicitly in your configuration if you wish to use these commands.</p>
<p>Note that <cite>autoload-all</cite> redefines <tt class="docutils literal"><span class="pre">\color</span></tt> to be the one from the
<cite>color</cite> extension (the LaTeX-compatible one rather than the
non-standard MathJax version). This is because <tt class="docutils literal"><span class="pre">\colorbox</span></tt> and
<tt class="docutils literal"><span class="pre">\fcolorbox</span></tt> autoload the <cite>color</cite> extension, which will cause
<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
redefined immediately.</p>
<p>If you wish to retain the original definition of <tt class="docutils literal"><span class="pre">\color</span></tt>, then use
the following</p>
<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>
<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>
<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>
<span class="p">});</span>
<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>
<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>
<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>
<span class="k">delete</span> <span class="nx">MACROS</span><span class="p">.</span><span class="nx">colorbox</span><span class="p">;</span>
<span class="k">delete</span> <span class="nx">MACROS</span><span class="p">.</span><span class="nx">fcolorbox</span><span class="p">;</span>
<span class="p">});</span>
<span class="nt">&lt;/script&gt;</span>
</pre></div>
</div>
</div>
</div>
<div class="section" id="supported-latex-commands">
<span id="tex-commands"></span><h2>Supported LaTeX commands<a class="headerlink" href="#supported-latex-commands" title="Permalink to this headline"></a></h2>
Expand Down Expand Up @@ -1191,7 +1232,8 @@ <h3>K<a class="headerlink" href="#k" title="Permalink to this headline">¶</a></
</div>
<div class="section" id="l">
<h3>L<a class="headerlink" href="#l" title="Permalink to this headline"></a></h3>
<div class="highlight-latex"><div class="highlight"><pre><span class="k">\Lambda</span>
<div class="highlight-latex"><div class="highlight"><pre><span class="k">\label</span> [AMSmath]
<span class="k">\Lambda</span>
<span class="k">\lambda</span>
<span class="k">\land</span>
<span class="k">\langle</span>
Expand Down Expand Up @@ -1797,6 +1839,7 @@ <h3><a href="index.html">Table Of Contents</a></h3>
<li><a class="reference internal" href="#noerrors">noErrors</a></li>
<li><a class="reference internal" href="#noundefined">noUndefined</a></li>
<li><a class="reference internal" href="#unicode-support">Unicode support</a></li>
<li><a class="reference internal" href="#autoload-all">Autoload-all</a></li>
</ul>
</li>
<li><a class="reference internal" href="#supported-latex-commands">Supported LaTeX commands</a><ul>
Expand Down
54 changes: 52 additions & 2 deletions docs/source/tex.rst
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,9 @@ this may be better than loading the extension explicitly, since it
avoids loading the extra file on pages where these macros are *not*
used. The `sample autoloading macros
<http://cdn.mathjax.org/mathjax/latest/test/sample-autoload.html>`_
example page shows this in action.
example page shows this in action. The `autoload-all` extension below
defines such macros for *all* the extensions so that if you include
it, MathJax will have access to all the macros it knows about.

The main extensions are described below.

Expand Down Expand Up @@ -594,7 +596,7 @@ To use this extension in your own configurations, add it to the
.. code-block:: javascript
TeX: {
extensions: ["action.js"]
extensions: ["enclose.js"]
}
This extension is **not** included in any of the combined configurations,
Expand Down Expand Up @@ -885,6 +887,53 @@ array. You can configure the extension as follows:
}
Autoload-all
------------

The `autoload-all` extension predefines all the macros from the
extensions above so that they autoload the extensions when first
used. A number of macros already do this, e.g., ``\unicode``, but
this extension defines the others to do the same. That way MathJax
will have access to all the macros that it knows about.

To use this extension in your own configurations, add it to the
`extensions` array in the TeX block.

.. code-block:: javascript
TeX: {
extensions: ["autoload-all.js"]
}
This extension is **not** included in any of the combined configurations,
and will not be loaded automatically, so you must include it
explicitly in your configuration if you wish to use these commands.

Note that `autoload-all` redefines ``\color`` to be the one from the
`color` extension (the LaTeX-compatible one rather than the
non-standard MathJax version). This is because ``\colorbox`` and
``\fcolorbox`` autoload the `color` extension, which will cause
``\color`` to be redefined, and so for consistency, ``\color`` is
redefined immediately.

If you wish to retain the original definition of ``\color``, then use
the following

.. code-block:: html

<script type="text/x-mathjax-config">
MathJax.Hub.Config({
TeX: { extensions: ["autoload-all.js"] }
});
MathJax.Hub.Register.StartupHook("TeX autoload-all Ready", function () {
var MACROS = MathJax.InputJax.TeX.Definitions.macros;
MACROS.color = "Color";
delete MACROS.colorbox;
delete MACROS.fcolorbox;
});
</script>


.. _tex-commands:

Supported LaTeX commands
Expand Down Expand Up @@ -1292,6 +1341,7 @@ L

.. code-block:: latex

\label [AMSmath]
\Lambda
\lambda
\land
Expand Down

0 comments on commit da3a15a

Please sign in to comment.