419 lines
22 KiB
HTML
419 lines
22 KiB
HTML
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
|
|
<title>The Core Configuration Options — MathJax v2.0 documentation</title>
|
|
<link rel="stylesheet" href="../_static/mj.css" type="text/css" />
|
|
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
|
|
<script type="text/javascript">
|
|
var DOCUMENTATION_OPTIONS = {
|
|
URL_ROOT: '../',
|
|
VERSION: '2.0',
|
|
COLLAPSE_INDEX: false,
|
|
FILE_SUFFIX: '.html',
|
|
HAS_SOURCE: true
|
|
};
|
|
</script>
|
|
<script type="text/javascript" src="../_static/jquery.js"></script>
|
|
<script type="text/javascript" src="../_static/underscore.js"></script>
|
|
<script type="text/javascript" src="../_static/doctools.js"></script>
|
|
<!--<script type="text/javascript" src="../../../MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>-->
|
|
<link rel="top" title="MathJax v2.0 documentation" href="../index.html" />
|
|
<link rel="up" title="Configuration Objects" href="index.html" />
|
|
<link rel="next" title="The tex2jax Preprocessor" href="tex2jax.html" />
|
|
<link rel="prev" title="Configuration Objects" href="index.html" />
|
|
</head>
|
|
<body>
|
|
|
|
<div class="related">
|
|
<h3>Navigation</h3>
|
|
<ul>
|
|
<li class="right" style="margin-right: 10px">
|
|
<a href="../genindex.html" title="General Index"
|
|
accesskey="I">index</a></li>
|
|
<li class="right" >
|
|
<a href="tex2jax.html" title="The tex2jax Preprocessor"
|
|
accesskey="N">next</a> |</li>
|
|
<li class="right" >
|
|
<a href="index.html" title="Configuration Objects"
|
|
accesskey="P">previous</a> |</li>
|
|
<li><a href="../index.html">MathJax v2.0 documentation</a> »</li>
|
|
<li><a href="index.html" accesskey="U">Configuration Objects</a> »</li>
|
|
</ul>
|
|
</div>
|
|
|
|
<div class="document">
|
|
<div class="documentwrapper">
|
|
<div class="bodywrapper">
|
|
<div class="body">
|
|
|
|
<div class="section" id="the-core-configuration-options">
|
|
<span id="configure-hub"></span><h1>The Core Configuration Options<a class="headerlink" href="#the-core-configuration-options" title="Permalink to this headline">¶</a></h1>
|
|
<p>The options below control the MathJax Hub, and so determine the code
|
|
behavior of MathJax. They are given with their default values.</p>
|
|
<dl class="describe">
|
|
<dt>
|
|
<tt class="descname">jax: ["input/TeX","output/HTML-CSS"]</tt></dt>
|
|
<dd><p>A comma-separated list of input and output jax to initialize at
|
|
startup. Their main code is loaded only when they are actually
|
|
used, so it is not inefficient to include jax that may not
|
|
actually be used on the page. These are found in the <tt class="docutils literal"><span class="pre">MathJax/jax</span></tt>
|
|
directory.</p>
|
|
</dd></dl>
|
|
|
|
<dl class="describe">
|
|
<dt>
|
|
<tt class="descname">extensions: []</tt></dt>
|
|
<dd><p>A comma-separated list of extensions to load at startup. The
|
|
default directory is <tt class="docutils literal"><span class="pre">MathJax/extensions</span></tt>. The <tt class="docutils literal"><span class="pre">tex2jax</span></tt> and
|
|
<tt class="docutils literal"><span class="pre">mml2jax</span></tt> preprocessors can be listed here, as well as a
|
|
<tt class="docutils literal"><span class="pre">FontWarnings</span></tt> extension that you can use to inform your user
|
|
that mathematics fonts are available that they can download to
|
|
improve their experience of your site.</p>
|
|
</dd></dl>
|
|
|
|
<dl class="describe">
|
|
<dt>
|
|
<tt class="descname">config: []</tt></dt>
|
|
<dd><p>A comma-separated list of configuration files to load when MathJax
|
|
starts up, e.g., to define local macros, etc., and there is a
|
|
sample config file named <tt class="docutils literal"><span class="pre">config/local/local.js</span></tt>. The default
|
|
directory is the <cite>MathJax/config</cite> directory. The <tt class="docutils literal"><span class="pre">MMLorHTML.js</span></tt>
|
|
configuration is one such configuration file, and there are a
|
|
number of other pre-defined configurations (see <a class="reference internal" href="../configuration.html#config-files"><em>Using a
|
|
configuration file</em></a> for more details).</p>
|
|
</dd></dl>
|
|
|
|
<dl class="describe">
|
|
<dt>
|
|
<tt class="descname">styleSheets: []</tt></dt>
|
|
<dd><p>A comma-separated list of CSS stylesheet files to be loaded when
|
|
MathJax starts up. The default directory is the <cite>MathJax/config</cite>
|
|
directory.</p>
|
|
</dd></dl>
|
|
|
|
<dl class="describe">
|
|
<dt>
|
|
<tt class="descname">styles: {}</tt></dt>
|
|
<dd><p>CSS styles to be defined dynamically at startup time. These are
|
|
in the form <cite>selector:rules</cite> (see <a class="reference internal" href="../CSS-styles.html#css-style-objects"><em>CSS Style Objects</em></a> for complete details).</p>
|
|
</dd></dl>
|
|
|
|
<dl class="describe">
|
|
<dt>
|
|
<tt class="descname">preJax: null and postJax: null</tt></dt>
|
|
<dd><p>Patterns to remove from before and after math script tags. If you
|
|
are not using one of the preprocessors, you need to insert
|
|
something extra into your HTML file in order to avoid a bug in
|
|
Internet Explorer. IE removes spaces from the DOM that it thinks
|
|
are redundant, and since a <tt class="docutils literal"><span class="pre"><script></span></tt> tag usually doesn’t add
|
|
content to the page, if there is a space before and after a
|
|
MathJax <tt class="docutils literal"><span class="pre"><script></span></tt> tag, IE will remove the first space. When
|
|
MathJax inserts the typeset mathematics, this means there will be
|
|
no space before it and the preceding text. In order to avoid
|
|
this, you should include some “guard characters” before or after
|
|
the math SCRIPT tag; define the patterns you want to use below.
|
|
Note that these are used as part of a regular expression, so you
|
|
will need to quote special characters. Furthermore, since they
|
|
are javascript strings, you must quote javascript special
|
|
characters as well. So to obtain a backslash, you must use <tt class="docutils literal"><span class="pre">\\</span></tt>
|
|
(doubled for javascript). For example, <tt class="docutils literal"><span class="pre">"\\["</span></tt> represents the
|
|
pattern <tt class="docutils literal"><span class="pre">\[</span></tt> in the regular expression, or <tt class="docutils literal"><span class="pre">[</span></tt> in the text of
|
|
the web page. That means that if you want an actual backslash in
|
|
your guard characters, you need to use <tt class="docutils literal"><span class="pre">"\\\\"</span></tt> in order to get
|
|
<tt class="docutils literal"><span class="pre">\\</span></tt> in the regular expression, and <tt class="docutils literal"><span class="pre">\</span></tt> in the actual text.
|
|
If both <tt class="docutils literal"><span class="pre">preJax</span></tt> and <tt class="docutils literal"><span class="pre">postJax</span></tt> are defined, both must be
|
|
present in order to be removed.</p>
|
|
<p>See also the <tt class="docutils literal"><span class="pre">preRemoveClass</span></tt> comments below.</p>
|
|
<p>Examples:</p>
|
|
<blockquote>
|
|
<div><p><tt class="docutils literal"><span class="pre">preJax:</span> <span class="pre">"\\\\\\\\\"</span></tt> makes a double backslash the <tt class="docutils literal"><span class="pre">preJax</span></tt> text</p>
|
|
<p><tt class="docutils literal"><span class="pre">preJax:</span> <span class="pre">"\\[\\[",</span> <span class="pre">postJax:</span> <span class="pre">"\\]\\]"</span></tt> makes it so jax
|
|
scripts must be enclosed in double brackets.</p>
|
|
</div></blockquote>
|
|
</dd></dl>
|
|
|
|
<dl class="describe">
|
|
<dt>
|
|
<tt class="descname">preRemoveClass: "MathJax_Preview"</tt></dt>
|
|
<dd><p>This is the CSS class name for math previews that will be removed
|
|
preceding a MathJax SCRIPT tag. If the tag just before the
|
|
MathJax <tt class="docutils literal"><span class="pre"><script></span></tt> tag is of this class, its contents are
|
|
removed when MathJax processes the <tt class="docutils literal"><span class="pre"><script></span></tt> tag. This allows
|
|
you to include a math preview in a form that will be displayed
|
|
prior to MathJax performing its typesetting. It also avoids the
|
|
Internet Explorer space-removal bug, and can be used in place of
|
|
<tt class="docutils literal"><span class="pre">preJax</span></tt> and <tt class="docutils literal"><span class="pre">postJax</span></tt> if that is more convenient.</p>
|
|
<p>For example</p>
|
|
<div class="highlight-html"><div class="highlight"><pre><span class="nt"><span</span> <span class="na">class=</span><span class="s">"MathJax_Preview"</span><span class="nt">></span>[math]<span class="nt"></span><script </span><span class="na">type=</span><span class="s">"math/tex"</span><span class="nt">></span><span class="p">...</span><span class="nt"></script></span>
|
|
</pre></div>
|
|
</div>
|
|
<p>would display “[math]” in place of the math until MathJax is able
|
|
to typeset it.</p>
|
|
<p>See also the <tt class="docutils literal"><span class="pre">preJax</span></tt> and <tt class="docutils literal"><span class="pre">postJax</span></tt> comments above.</p>
|
|
</dd></dl>
|
|
|
|
<dl class="describe">
|
|
<dt>
|
|
<tt class="descname">showProcessingMessages: true</tt></dt>
|
|
<dd><p>This value controls whether the <cite>Processing Math: nn%</cite> messages are
|
|
displayed in the lower left-hand corner. Set to <tt class="docutils literal"><span class="pre">false</span></tt> to
|
|
prevent those messages (though file loading and other messages
|
|
will still be shown).</p>
|
|
</dd></dl>
|
|
|
|
<dl class="describe">
|
|
<dt>
|
|
<tt class="descname">messageStyle: "normal"</tt></dt>
|
|
<dd><p>This value controls the verbosity of the messages in the lower
|
|
left-hand corner. Set it to <tt class="docutils literal"><span class="pre">"none"</span></tt> to eliminate all messages,
|
|
or set it to <tt class="docutils literal"><span class="pre">"simple"</span></tt> to show “Loading...” and “Processing...”
|
|
rather than showing the full file name or the percentage of the
|
|
mathematics processed.</p>
|
|
</dd></dl>
|
|
|
|
<dl class="describe">
|
|
<dt>
|
|
<tt class="descname">displayAlign: "center" and displayIndent: "0em"</tt></dt>
|
|
<dd><p>These two parameters control the alignment and shifting of
|
|
displayed equations. The first can be <tt class="docutils literal"><span class="pre">"left"</span></tt>, <tt class="docutils literal"><span class="pre">"center"</span></tt>,
|
|
or <tt class="docutils literal"><span class="pre">"right"</span></tt>, and determines the alignment of displayed
|
|
equations. When the alignment is not <tt class="docutils literal"><span class="pre">"center"</span></tt>, the second
|
|
determines an indentation from the left or right side for the
|
|
displayed equations.</p>
|
|
</dd></dl>
|
|
|
|
<dl class="describe">
|
|
<dt>
|
|
<tt class="descname">delayStartupUntil: "none"</tt></dt>
|
|
<dd><p>Normally MathJax will perform its startup commands (loading of
|
|
configuration, styles, jax, and so on) as soon as it can. If you
|
|
expect to be doing additional configuration on the page, however,
|
|
you may want to have it wait until the page’s onload handler is
|
|
called. If so, set this to <tt class="docutils literal"><span class="pre">"onload"</span></tt>. You can also set this to
|
|
<tt class="docutils literal"><span class="pre">"configured"</span></tt>, in which case, MathJax will delay its startup until
|
|
you explicitly call <tt class="xref py py-meth docutils literal"><span class="pre">MathJax.Hub.Configured()</span></tt>. See
|
|
<a class="reference internal" href="../configuration.html#delaystartupuntil"><em>Configuring MathJax after it is loaded</em></a> for more
|
|
details.</p>
|
|
</dd></dl>
|
|
|
|
<dl class="describe">
|
|
<dt>
|
|
<tt class="descname">skipStartupTypeset: false</tt></dt>
|
|
<dd><p>Normally MathJax will typeset the mathematics on the page as soon
|
|
as the page is loaded. If you want to delay that process, in
|
|
which case you will need to call <tt class="xref py py-meth docutils literal"><span class="pre">MathJax.Hub.Typeset()</span></tt>
|
|
yourself by hand, set this value to <tt class="docutils literal"><span class="pre">true</span></tt>.</p>
|
|
</dd></dl>
|
|
|
|
<dl class="describe">
|
|
<dt>
|
|
<tt class="descname">elements: []</tt></dt>
|
|
<dd><p>This is a list of DOM element ID’s that are the ones to process for
|
|
mathematics when any of the Hub typesetting calls (<tt class="docutils literal"><span class="pre">Typeset()</span></tt>, <tt class="docutils literal"><span class="pre">Process()</span></tt>,
|
|
<tt class="docutils literal"><span class="pre">Update()</span></tt>, etc.) are called with no element specified, and during
|
|
MathJax’s initial typesetting run when it starts up. This lets you
|
|
restrict the processing to particular containers rather than scanning
|
|
the entire document for mathematics. If none are supplied, the complete
|
|
document is processed.</p>
|
|
</dd></dl>
|
|
|
|
<dl class="describe">
|
|
<dt>
|
|
<tt class="descname">positionToHash: true</tt></dt>
|
|
<dd><p>Since typesetting usually changes the vertical dimensions of the
|
|
page, if the URL contains an anchor position, then after the page
|
|
is typeset, you may no longer be positioned at the correct
|
|
position on the page. MathJax can reposition to that location
|
|
after it completes its initial typesetting of the page. This
|
|
value controls whether MathJax will reposition the browser to the
|
|
<tt class="docutils literal"><span class="pre">#hash</span></tt> location from the page URL after typesetting for the page.</p>
|
|
</dd></dl>
|
|
|
|
<dl class="describe">
|
|
<dt>
|
|
<tt class="descname">showMathMenu: true</tt></dt>
|
|
<dt>
|
|
<tt class="descname">showMathMenuMSIE: true</tt></dt>
|
|
<dd><p>These control whether to attach the MathJax contextual menu to the
|
|
expressions typeset by MathJax. Since the code for handling
|
|
MathPlayer in Internet Explorer is somewhat delicate, it is
|
|
controlled separately via <tt class="docutils literal"><span class="pre">showMathMenuMSIE</span></tt>, but the latter is
|
|
now deprecated in favor of the MathJax contextual menu settings
|
|
for MathPlayer (see below).</p>
|
|
<p>If <tt class="docutils literal"><span class="pre">showMathMenu</span></tt> is <tt class="docutils literal"><span class="pre">true</span></tt>, then right-clicking (on Windows
|
|
or Linux) or control-clicking (on Mac OS X) will produce a MathJax
|
|
menu that allows you to get the source of the mathematics in
|
|
various formats, change the size of the mathematics relative to
|
|
the surrounding text, get information about MathJax, and configure
|
|
other MathJax settings.</p>
|
|
<p>Set this to <tt class="docutils literal"><span class="pre">false</span></tt> to disable the menu. When <tt class="docutils literal"><span class="pre">true</span></tt>, the
|
|
<tt class="docutils literal"><span class="pre">MathMenu</span></tt> configuration block determines the operation of the
|
|
menu. See <a class="reference internal" href="MathMenu.html#configure-mathmenu"><em>the MathMenu options</em></a> for
|
|
more details.</p>
|
|
<p>These values used to be listed in the separate output jax, but
|
|
have been moved to this more central location since they are
|
|
shared by all output jax. MathJax will still honor their values
|
|
from their original positions, if they are set there.</p>
|
|
</dd></dl>
|
|
|
|
<dl class="describe">
|
|
<dt>
|
|
<tt class="descname">menuSettings: { ... }</tt></dt>
|
|
<dd><p>This block contains settings for the mathematics contextual menu
|
|
that act as the defaults for the user’s settings in that menu.
|
|
The possible values are:</p>
|
|
<dl class="describe">
|
|
<dt>
|
|
<tt class="descname">zoom: "None"</tt></dt>
|
|
<dd><p>This indicates when typeset mathematics should be zoomed. It
|
|
can be set to <tt class="docutils literal"><span class="pre">"None"</span></tt>, <tt class="docutils literal"><span class="pre">"Hover"</span></tt>, <tt class="docutils literal"><span class="pre">"Click"</span></tt>, or
|
|
<tt class="docutils literal"><span class="pre">"Double-Click"</span></tt> to set the zoom trigger.</p>
|
|
</dd></dl>
|
|
|
|
<dl class="describe">
|
|
<dt>
|
|
<tt class="descname">CTRL: false, ALT: false, CMD: false, Shift: false</tt></dt>
|
|
<dd><p>These values indicate which keys must be pressed in order for
|
|
math zoom to be triggered. For example, if <tt class="docutils literal"><span class="pre">CTRL</span></tt> is set to
|
|
<tt class="docutils literal"><span class="pre">true</span></tt> and <tt class="docutils literal"><span class="pre">zoom</span></tt> is <tt class="docutils literal"><span class="pre">"Click"</span></tt>, then math will be zoomed
|
|
only when the user control-clicks on mathematics (i.e., clicks
|
|
while holding down the <cite>CTRL</cite> key). If more than one is
|
|
<tt class="docutils literal"><span class="pre">true</span></tt>, then all the indicated keys must be pressed for the
|
|
zoom to occur.</p>
|
|
</dd></dl>
|
|
|
|
<dl class="describe">
|
|
<dt>
|
|
<tt class="descname">zscale: "200%"</tt></dt>
|
|
<dd><p>This is the zoom scaling factor, and it can be set to any of
|
|
the values available in the <cite>Zoom Factor</cite> menu of the
|
|
<cite>Settings</cite> submenu of the contextual menu.</p>
|
|
</dd></dl>
|
|
|
|
<dl class="describe">
|
|
<dt>
|
|
<tt class="descname">context: "MathJax"</tt></dt>
|
|
<dd><p>This controls what contextual menu will be presented when a
|
|
right click (on a PC) or CTRL-click (on the Mac) occurs over a
|
|
typeset equation. When set to <tt class="docutils literal"><span class="pre">"MathJax"</span></tt>, the MathJax
|
|
contextual menu will appear; when set to <tt class="docutils literal"><span class="pre">"Browser"</span></tt>, the
|
|
browser’s contextual menu will be used. For example, in
|
|
Internet Explorer with the MathPlayer plugin, if this is set
|
|
to <tt class="docutils literal"><span class="pre">"Browser"</span></tt>, you will get the MathPlayer contextual menu
|
|
rather than the MathJax menu.</p>
|
|
</dd></dl>
|
|
|
|
<dl class="describe">
|
|
<dt>
|
|
<tt class="descname">texHints: true</tt></dt>
|
|
<dd><p>This controls whether the “Show Source” menu item includes
|
|
special class names that help MathJax to typeset the
|
|
mathematics that was produced by the TeX input jax. If these
|
|
are included, then you can take the output from “Show Source”
|
|
and put it into a page that uses MathJax’s MathML input jax
|
|
and expect to get the same results as the original TeX.
|
|
(Without this, there may be some spacing differences.)</p>
|
|
</dd></dl>
|
|
|
|
<p>There are also settings for <tt class="docutils literal"><span class="pre">format</span></tt>, <tt class="docutils literal"><span class="pre">renderer</span></tt>, <tt class="docutils literal"><span class="pre">font</span></tt>,
|
|
<tt class="docutils literal"><span class="pre">mpContext</span></tt>, and <tt class="docutils literal"><span class="pre">mpMouse</span></tt>, but these are maintained by
|
|
MathJax and should not be set by the page author.</p>
|
|
</dd></dl>
|
|
|
|
<dl class="describe">
|
|
<dt>
|
|
<tt class="descname">errorSettings: { ... }</tt></dt>
|
|
<dd><p>This block contains settings that control how MathJax responds to
|
|
unexpected errors while processing mathematical equations. Rather
|
|
than simply crash, MathJax can report an error and go on. The
|
|
options you can set include:</p>
|
|
<dl class="describe">
|
|
<dt>
|
|
<tt class="descname">message: ["[Math Processing Error]"]</tt></dt>
|
|
<dd><p>This is an HTML snippet that will be inserted at the location
|
|
of the mathematics for any formula that causes MathJax to
|
|
produce an internal error (i.e., an error in the MathJax code
|
|
itself). See the <a class="reference internal" href="../HTML-snippets.html#html-snippets"><em>description of HTML snippets</em></a> for details on how to represent HTML code in
|
|
this way.</p>
|
|
</dd></dl>
|
|
|
|
<dl class="describe">
|
|
<dt>
|
|
<tt class="descname">style: {color:"#CC0000", "font-style":"italic"}</tt></dt>
|
|
<dd><p>This is the CSS style description to use for the error
|
|
messages produced by internal MathJax errors. See the section
|
|
on <a class="reference internal" href="../CSS-styles.html#css-style-objects"><em>CSS style objects</em></a> for details on
|
|
how these are specified in JavaScript.</p>
|
|
</dd></dl>
|
|
|
|
</dd></dl>
|
|
|
|
<dl class="describe">
|
|
<dt>
|
|
<tt class="descname">v1.0-compatible: true</tt></dt>
|
|
<dd><p>This controls whether MathJax issues the warning about not having an
|
|
explicit configuration in the event that the <cite>jax</cite> array is empty
|
|
after configuration is complete. If you really intend that array to
|
|
be empty, set this flag to <tt class="docutils literal"><span class="pre">false</span></tt>. Note that setting this to false
|
|
does <strong>not</strong> cause a default configuration file to be loaded.</p>
|
|
</dd></dl>
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="sphinxsidebar">
|
|
<div class="sphinxsidebarwrapper">
|
|
<h4>Previous topic</h4>
|
|
<p class="topless"><a href="index.html"
|
|
title="previous chapter">Configuration Objects</a></p>
|
|
<h4>Next topic</h4>
|
|
<p class="topless"><a href="tex2jax.html"
|
|
title="next chapter">The tex2jax Preprocessor</a></p>
|
|
<div id="searchbox" style="display: none">
|
|
<h3>Quick search</h3>
|
|
<form class="search" action="../search.html" method="get">
|
|
<input type="text" name="q" size="18" />
|
|
<input type="submit" value="Go" />
|
|
<input type="hidden" name="check_keywords" value="yes" />
|
|
<input type="hidden" name="area" value="default" />
|
|
</form>
|
|
<p class="searchtip" style="font-size: 90%">
|
|
Enter search terms or a module, class or function name.
|
|
</p>
|
|
</div>
|
|
<script type="text/javascript">$('#searchbox').show(0);</script>
|
|
</div>
|
|
</div>
|
|
<div class="clearer"></div>
|
|
</div>
|
|
<div class="related">
|
|
<h3>Navigation</h3>
|
|
<ul>
|
|
<li class="right" style="margin-right: 10px">
|
|
<a href="../genindex.html" title="General Index"
|
|
>index</a></li>
|
|
<li class="right" >
|
|
<a href="tex2jax.html" title="The tex2jax Preprocessor"
|
|
>next</a> |</li>
|
|
<li class="right" >
|
|
<a href="index.html" title="Configuration Objects"
|
|
>previous</a> |</li>
|
|
<li><a href="../index.html">MathJax v2.0 documentation</a> »</li>
|
|
<li><a href="index.html" >Configuration Objects</a> »</li>
|
|
</ul>
|
|
</div>
|
|
<div class="footer">
|
|
© Copyright 2012 Design Science.
|
|
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7.
|
|
</div>
|
|
|
|
</body>
|
|
</html> |