mathjax-docs-2.3+20140108/0000755000000000000000000000000012263271212013327 5ustar rootrootmathjax-docs-2.3+20140108/whats-new-2.3.rst0000644000000000000000000000647312263271212016310 0ustar rootroot.. _whats-new-2.3: ************************** What's New in MathJax v2.3 ************************** MathJax v2.3 includes a number of new features, as well a more than 30 important bug fixes. Features: ========= * *New webfonts:* MathJax v2.3 adds new webfonts for ``STIX``, ``Asana Math``, ``Neo Euler``, ``Gyre Pagella``, ``Gyre Termes``, and ``Latin Modern``. * *Localization improvements:* MathJax has been accepted into TranslateWiki.net. Thanks to the TWN community we could add 12 complete and over 20 partial translations. * *MathML improvements:* MathJax’s "Show Math as" menu will now expose the MathML annotation features. There are also two new preview options for the MathML input mode: ``mathml`` (now the default), which uses the original MathML as a preview, and ``altimage``, which uses the ```` element's ``altimg`` (if any) for the preview. * *Miscellaneous improvements:* A new extension ``MatchWebFonts`` improves the interaction with the surrounding content when that uses a webfont. A new configuration method allows configurations to be specified using a regular JavaScript variable ``window.MathJax``. * MathJax is now available as a Bower package thanks to community contributions. TeX input: ========== * Prevent the TeX pre-processor from rendering TeX in MathML annotation-xml elements. (`Issue #484 `_) * Fix sizing issue in ``cases`` environment (`Issue #485 `_) Fonts: ====== * Fix block-letter capital I (U+2111) appearing as J in MathJax font (`Issue #555 `_) MathML: ======= * Improved workarounds for MathML output on WebKit (`Issue #482 `_) * Handle empty ``multiscript``, ``mlabeledtr``, and other nodes in Native MathML output (`Issue #486 `_) * Replace non-standard ``MJX-arrow`` class by new ``menclose`` notation (`Issue #481 `_) * Fix incorrect widths in Firefox MathML output (`Issue #558 `_) * Fix display math not being centered in XHTML (`Issue #650 `_) * Fix problem when LaTeX code appears in ``annotation`` node (`Issue #484 `_) HTML-CSS/SVG output =================== * Fix MathJax not rendering in Chrome when sessionStorage is disabled (`Issue #584 `_) * Fix ``\mathchoice`` error with linebreaking in SVG output (`Issue #604 `_) * Fix poor linebreaking of "flat" MathML with unmatched parentheses (`Issue #523 `_) Interface: ========== * Fix Double-Click zoom trigger (`Issue #590 `_) Miscellaneous: ============== * Localization: improved fallbacks for IETF tags (`Issue #492 `_) * Localization: support RTL in messages (`Issue #627 `_) * Improve PNG compression (`Issue #44 `_) �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mathjax-docs-2.3+20140108/_themes/������������������������������������������������������������������0000755�0000000�0000000�00000000000�12276627713�014772� 5����������������������������������������������������������������������������������������������������ustar �root����������������������������root�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mathjax-docs-2.3+20140108/_themes/mjtheme/����������������������������������������������������������0000755�0000000�0000000�00000000000�12263271212�016404� 5����������������������������������������������������������������������������������������������������ustar �root����������������������������root�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mathjax-docs-2.3+20140108/_themes/mjtheme/theme.conf������������������������������������������������0000644�0000000�0000000�00000001236�12263271212�020357� 0����������������������������������������������������������������������������������������������������ustar �root����������������������������root�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[theme] inherit = basic stylesheet = mj.css pygments_style = sphinx [options] rightsidebar = false stickysidebar = false footerbgcolor = #11303d footertextcolor = #ffffff sidebarbgcolor = #d4e9f7 sidebartextcolor = #3a3a3a sidebarlinkcolor = #3a8942 relbarbgcolor = #191a19 relbartextcolor = #ffffff relbarlinkcolor = #ffffff bgcolor = #ffffff textcolor = #222222 headbgcolor = #f2f2f2 headtextcolor = #20435c headlinkcolor = #c60f0f headbordercolor = #cccccc linkcolor = #355f7c codebgcolor = #f1f8ff codetextcolor = #333333 codebordercolor = #6799b3 bodyfont = sans-serif headfont = 'Trebuchet MS', sans-serif ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mathjax-docs-2.3+20140108/_themes/mjtheme/layout.html�����������������������������������������������0000644�0000000�0000000�00000031545�12263271212�020617� 0����������������������������������������������������������������������������������������������������ustar �root����������������������������root�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{# basic/layout.html ~~~~~~~~~~~~~~~~~ Master layout template for Sphinx themes. :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. #} {%- block doctype -%} {%- endblock %} {%- set reldelim1 = reldelim1 is not defined and ' »' or reldelim1 %} {%- set reldelim2 = reldelim2 is not defined and ' |' or reldelim2 %} {%- set render_sidebar = (not embedded) and (not theme_nosidebar|tobool) and (sidebars != []) %} {%- set url_root = pathto('', 1) %} {%- if url_root == '#' %}{% set url_root = '' %}{% endif %} {%- macro relbar() %} {%- endmacro %} {%- macro sidebar() %} {%- if render_sidebar %}
{%- block sidebarlogo %} {%- if logo %} {%- endif %} {%- endblock %} {%- if sidebars != None %} {#- new style sidebar: explicitly include/exclude templates #} {%- for sidebartemplate in sidebars %} {%- include sidebartemplate %} {%- endfor %} {%- else %} {#- old style sidebars: using blocks -- should be deprecated #} {%- block sidebartoc %} {%- include "localtoc.html" %} {%- endblock %} {%- block sidebarrel %} {%- include "relations.html" %} {%- endblock %} {%- block sidebarsourcelink %} {%- include "sourcelink.html" %} {%- endblock %} {%- if customsidebar %} {%- include customsidebar %} {%- endif %} {%- block sidebarsearch %} {%- include "searchbox.html" %} {%- endblock %} {%- endif %}
{%- endif %} {%- endmacro %} {{ metatags }} {%- if not embedded and docstitle %} {%- set titlesuffix = " — "|safe + docstitle|e %} {%- else %} {%- set titlesuffix = "" %} {%- endif %} {%- block htmltitle %} {{ title|striptags|e }}{{ titlesuffix }} {%- endblock %} {%- for cssfile in css_files %} {%- endfor %} {%- if not embedded %} {%- for scriptfile in script_files %} {%- endfor %} {%- if use_opensearch %} {%- endif %} {%- if favicon %} {%- endif %} {%- endif %} {%- block linktags %} {%- if hasdoc('about') %} {%- endif %} {%- if hasdoc('genindex') %} {%- endif %} {%- if hasdoc('search') %} {%- endif %} {%- if hasdoc('copyright') %} {%- endif %} {%- if parents %} {%- endif %} {%- if next %} {%- endif %} {%- if prev %} {%- endif %} {%- endblock %} {%- block extrahead %} {% endblock %} {% if for_site %}
{% endif %} {%- block header %}{% endblock %} {%- block relbar1 %}{{ relbar() }}{% endblock %} {%- block content %} {%- block sidebar1 %} {# possible location for sidebar #} {% endblock %}
{%- block document %}
{%- if render_sidebar %}
{%- endif %}
{% block body %} {% endblock %}
{%- if render_sidebar %}
{%- endif %}
{%- endblock %} {%- block sidebar2 %}{{ sidebar() }}{% endblock %}
{%- endblock %} {%- block relbar2 %}{{ relbar() }}{% endblock %} {%- block footer %} {%- endblock %} {% if for_site %}
{% endif %} mathjax-docs-2.3+20140108/_themes/mjtheme/static/0000755000000000000000000000000012263271212017673 5ustar rootrootmathjax-docs-2.3+20140108/_themes/mjtheme/static/mj.css_t0000644000000000000000000002604612263271212021346 0ustar rootroot/** * Sphinx stylesheet -- default theme * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ @import url("basic.css"); {% if for_site %} /****************************************** * CSS configuration from www.mathjax.org ******************************************/ /* * Culled from twentyten style.css */ * #access .menu-header, #branding, #wrapper { margin: 0 auto; width: 940px; } #wrapper { margin-top: 20px; background: #fff; padding: 0 20px; } #site-info { float: left; width: 700px; font-weight: bold; font-size: 14px; } body { background: #D2D3D3 ! important; } #header { padding: 30px 0 0 0; } #site-title { float: left; margin: 0 0 18px 0; width: 700px; font-size: 30px; line-height: 36px; } #site-title a { color: #000; font-weight: bold; text-decoration: none; } #site-description { clear: right; float: right; font-style: italic; margin: 14px 0 18px 0; width: 220px; } #branding img { clear: both; border-top: 4px solid #000; display: block; border-bottom: 1px solid #000; } #access { background: #000; margin: 0 auto; width: 940px; display:block; float:left; } #access .menu-header { font-size: 13px; margin-left: 12px; } #access .menu-header ul { list-style: none; margin: 0; } #access .menu-header li { float:left; position: relative; } #access a { display:block; text-decoration:none; color:#aaa; padding:0 10px; line-height:38px; } #access ul ul { display:none; position:absolute; top:38px; left:0; float:left; box-shadow: 0px 3px 3px rgba(0,0,0,0.2); -moz-box-shadow: 0px 3px 3px rgba(0,0,0,0.2); -webkit-box-shadow: 0px 3px 3px rgba(0,0,0,0.2); width: 180px; z-index: 99999; } #access ul ul li { min-width: 180px; } #access ul ul ul { left:100%; top:0; } #access ul ul a { background:#333; height:auto; line-height:1em; padding:10px; width: 160px; } #access li:hover > a, #access ul ul :hover > a { color:#fff; background:#333; } #access ul li:hover > ul { display:block; } #access ul li.current_page_item > a, #access ul li.current-menu-ancestor > a, #access ul li.current-menu-item > a, #access ul li.current-menu-parent > a { color: #fff; } * html #access ul li.current_page_item a, * html #access ul li.current-menu-ancestor a, * html #access ul li.current-menu-item a, * html #access ul li.current-menu-parent a, * html #access ul li a:hover { color:#fff; } .navigation { font-size: 12px; line-height: 18px; overflow: hidden; color: #888; } .navigation a:link, .navigation a:visited { color: #888; text-decoration: none; } .navigation a:active, .navigation a:hover { color: #FF4B33; } .widget_search #s { /* This keeps the search inputs in line */ width: 60%; } .widget_search label { display:none; } .widget-container { margin: 0 0 18px 0; } #site-info { font-weight: bold; } #site-info a { color: #000; text-decoration: none; } #access, .navigation { -webkit-text-size-adjust: 120%; } #site-description { -webkit-text-size-adjust: none; } @media print { body { background:none !important; } #wrapper { float: none !important; clear: both !important; display: block !important; position: relative !important; } #header { border-bottom: 2pt solid #000; padding-bottom: 18pt; } #site-title, #site-description { float: none; margin: 0; padding:0; line-height: 1.4em; } #access, #branding img, #respond, .navigation { display: none !important; } #header { width: 100%; margin: 0; } #site-info { float: none; width: auto; } } /* * from mathjax style.css */ .clear { clear: both; } /* HEADER */ #header { padding: 20px 0 0; } #site-title { margin: 0; width: 300px; } #branding img { border: 0; } #site-description { margin: 36px 0 0; font-size: 18px; float: left; width: auto; font-family: "Helvetica Neue", Arial, Helvetica, "Nimbus Sans L", sans-serif; font-style: normal; font-weight: bold; letter-spacing: -1px; color: #a5a5a5; } #header-box-right { margin: 10px 0 0; float: right; } .icon-list { display: block; margin: 0 0 0 93px; list-style: none; } .icon-list li { float: left; display: inline; margin: 0 8px 5px 0; } .icon-list img { border: 0; } .widget_search { clear: both; margin: 0; } .widget_search #s { width: 150px; height: 16px; float: left; } input[type="text"], textarea { border: 2px solid #b5bfb8; background-color: #eaeaea; -moz-border-radius: 4px; -webkit-border-radius: 4px; } input[type="text"]:focus, textarea:focus{ outline-width: 0; border-color: #169538; } .search-button { float: left; display: inline; margin: 2px 0 0 5px; } /* NAVIGATION */ #access { margin: 20px 0 10px; } #access li { min-width: 20px; } #access a { color: #dddddd; font-weight: bold; } #access a:hover, #access ul li.current_page_item > a, #access ul li.current-menu-ancestor > a, #access ul li.current-menu-item > a, #access ul li.current-menu-parent > a { color: #ffffff; font-weight: bold; } #access li:hover > a, #access ul ul :hover > a { color:#fff; background:#444; } #access ul ul a { background:#444; } #menu-item-1167 { margin-right: 12px; float: right !important; background: #E18B16 !important; } #menu-item-1167:hover > a { background: #ef9d32 !important; } #menu-item-1167 a, #menu-item-1167 a:visited { color: #ffffff !important; } /* * Adjustementst to www.mathjax.org settings to work with * to match the global settings from www.mathjax.org */ #access { margin-bottom: 1px; } fieldset { border: 0; padding: 0; margin: 0; } #header { font-family: "Helvetica Neue", Arial, Helvetica, "Nimbus Sans L", sans-serif; line-height:18px; } #header-box-right { line-height: 18px; font-size: 12px; border: 0; padding: 0; } #header-box-right ul, #header-box-right form { margin: 0; padding: 0; border: 0; } #header-box-right .icon-list { margin-left: 93px } #header input { font-family: Georgia, "Bitstream Charter", serif; } #header input[type="text"] { padding: 2px; background-color: #eaeaea; border: 2px solid #b5bfb8; box-shadow: inset 1px 1px 1px rgba(0,0,0,0.1); -moz-box-shadow: inset 1px 1px 1px rgba(0,0,0,0.1); -webkit-box-shadow: inset 1px 1px 1px rgba(0,0,0,0.1); -moz-border-radius: 4px; -webkit-border-radius: 4px; } #header input[type="text"]:focus { outline-width: 0; border-color: #169538; } .menu-header ul, .menu-header li { margin: 0; padding: 0; border: 0; } /*************************************** * End of site-specific configuration ***************************************/ {% endif %} /* -- page layout ----------------------------------------------------------- */ body { font-family: {{ theme_bodyfont }}; font-size: 100%; background-color: {{ theme_footerbgcolor }}; color: #000; margin: 0; padding: 0; } div.document { background-color: {{ theme_sidebarbgcolor }}; } div.documentwrapper { float: left; width: 100%; } div.bodywrapper { margin: 0 0 0 230px; } div.body { background-color: {{ theme_bgcolor }}; color: {{ theme_textcolor }}; padding: 0 20px 30px 20px; } {%- if theme_rightsidebar|tobool %} div.bodywrapper { margin: 0 230px 0 0; } {%- endif %} div.footer { color: {{ theme_footertextcolor }}; width: 100%; padding: 9px 0 9px 0; text-align: center; font-size: 75%; } div.footer a { color: {{ theme_footertextcolor }}; text-decoration: underline; } div.related { background-color: {{ theme_relbarbgcolor }}; line-height: 30px; color: {{ theme_relbartextcolor }}; } div.related a { color: {{ theme_relbarlinkcolor }}; } div.sphinxsidebar { {%- if theme_stickysidebar|tobool %} top: 30px; margin: 0; position: fixed; overflow: auto; height: 100%; {%- endif %} {%- if theme_rightsidebar|tobool %} float: right; {%- if theme_stickysidebar|tobool %} right: 0; {%- endif %} {%- endif %} } {%- if theme_stickysidebar|tobool %} /* this is nice, but it it leads to hidden headings when jumping to an anchor */ /* div.related { position: fixed; } div.documentwrapper { margin-top: 30px; } */ {%- endif %} div.sphinxsidebar h3 { font-family: {{ theme_headfont }}; color: {{ theme_sidebartextcolor }}; font-size: 1.4em; font-weight: normal; margin: 0; padding: 0; } div.sphinxsidebar h3 a { color: {{ theme_sidebartextcolor }}; } div.sphinxsidebar h4 { font-family: {{ theme_headfont }}; color: {{ theme_sidebartextcolor }}; font-size: 1.3em; font-weight: normal; margin: 5px 0 0 0; padding: 0; } div.sphinxsidebar p { color: {{ theme_sidebartextcolor }}; } div.sphinxsidebar p.topless { margin: 5px 10px 10px 10px; } div.sphinxsidebar ul { margin: 10px; padding: 0; color: {{ theme_sidebartextcolor }}; } div.sphinxsidebar ul li { margin-top: .2em; } div.sphinxsidebar a { color: {{ theme_sidebarlinkcolor }}; } div.sphinxsidebar input { border: 1px solid {{ theme_sidebarlinkcolor }}; font-family: sans-serif; font-size: 1em; } /* -- body styles ----------------------------------------------------------- */ a { color: {{ theme_linkcolor }}; text-decoration: none; } a:hover { text-decoration: underline; } div.body p, div.body dd, div.body li { text-align: justify; line-height: 130%; } div.body h1, div.body h2, div.body h3, div.body h4, div.body h5, div.body h6 { font-family: {{ theme_headfont }}; background-color: {{ theme_headbgcolor }}; font-weight: normal; color: {{ theme_headtextcolor }}; border-top: 2px solid {{ theme_headbordercolor }}; border-bottom: 1px solid {{ theme_headbordercolor }}; margin: 30px -20px 20px -20px; padding: 3px 0 3px 10px; } div.body h1 { margin-top: 0; font-size: 200%; } div.body h2 { font-size: 160%; } div.body h3 { font-size: 140%; padding-left: 20px; } div.body h4 { font-size: 120%; padding-left: 20px; } div.body h5 { font-size: 110%; padding-left: 20px; } div.body h6 { font-size: 100%; padding-left: 20px; } a.headerlink { color: {{ theme_headlinkcolor }}; font-size: 0.8em; padding: 0 4px 0 4px; text-decoration: none; } a.headerlink:hover { background-color: {{ theme_headlinkcolor }}; color: white; } div.body p, div.body dd, div.body li { text-align: justify; line-height: 130%; } div.admonition p.admonition-title + p { display: inline; } div.note { background-color: #eee; border: 1px solid #ccc; } div.seealso { background-color: #ffc; border: 1px solid #ff6; } div.topic { background-color: #eee; } div.warning { background-color: #ffe4e4; border: 1px solid #f66; } p.admonition-title { display: inline; } p.admonition-title:after { content: ":"; } pre { padding: 5px; background-color: {{ theme_codebgcolor }}; color: {{ theme_codetextcolor }}; line-height: 130%; border: 2px solid {{ theme_codebordercolor }}; border-left: none; border-right: none; } tt { background-color: #ecf0f3; padding: 0 1px 0 1px; /* font-size: 0.95em;*/ } .warning tt { background: #efc2c2; } .note tt { background: #d6d6d6; } mathjax-docs-2.3+20140108/HTML-snippets.rst0000644000000000000000000000545712263271212016503 0ustar rootroot.. _html-snippets: ************************ Describing HTML snippets ************************ A number of MathJax configuration options allow you to specify an HTML snippet using a JavaScript object. This lets you include HTML in your configuration files even though they are not HTML files themselves. The format is fairly simple, but flexible enough to let you represent complicated HTML trees. An HTML snippet is an array consisting of a series of elements that format the HTML tree. Those elements are one of two things: either a string, which represents text to be included in the snippet, or an array, which represents an HTML tag to be included. In the latter case, the array consists of three items: a string that is the tag name (e.g., "img"), an optional object that gives attributes for the tag (as described below), and an optional HTML snippet array that gives the contents of the tag. When attributes are provided, they are given as `name:value` pairs, with the `name` giving the attribute name, and `value` giving its value. For example .. code-block:: javascript [["img",{src:"/images/mypic.jpg"}]] represents an HTML snippet that includes one element: an ```` tag with ``src`` set to ``/images/mypic.jpg``. That is, this is equivalent to .. code-block:: html Note that the snippet has two sets of square brackets. The outermost one is for the array that holds the snippet, and the innermost set is because the first (and only) element in the snippet is a tag, not text. Note that the code ``["img",{src:"/images/mypic.jpg"}]`` is invalid as an HTML snippet. It would represent a snippet that starts with "img" as text in the snippet (not a tag), but the second item is neither a string nor an array, and so is illegal. This is a common mistake that should be avoided. A more complex example is the following: .. code-block:: javascript [ "Please read the ", ["a",{href:"instructions.html"},["instructions"]], " carefully before proceeding" ] which is equivalent to .. code-block:: html please read the instructions carefully before proceeding. A final example shows how to set style attributes on an object: .. code-block:: javascript [["span", { id:"mySpan", style: {color:"red", "font-weight":"bold"} }, [" This is bold text shown in red "] ]] which is equivalent to .. code-block:: html This is bold text shown in red Since HTML snippets contain text that is displayed to users, it may be important to localize those strings to be in the language selected by the user. See the :ref:`Localization Strings ` documentation for details of how to accomplish that. mathjax-docs-2.3+20140108/whats-new-1.1.rst0000644000000000000000000001217612263271212016302 0ustar rootroot.. _whats-new-1.1: ************************** What's New in MathJax v1.1 ************************** MathJax version 1.1 includes a number of important improvements and enhancements over version 1.0. We have worked hard to fix bugs, improve support for browsers and mobile devices, process TeX and MathML better, and increase MathJax's performance. In addition to these changes, MathJax.org now offers MathJax as a network service. Instead of having to install MathJax on your own server, you can link to our content delivery network (CDN) to get fast access to up-to-date and past versions of MathJax. See :ref:`Loading MathJax from the CDN ` for more details. The following sections outline the changes in v1.1: Optimization ============ * Combined configuration files that load all the needed files in one piece rather than loading them individually. This simplifies configuration and speeds up typesetting of the mathematics on the page. * Improved responsiveness to mouse events during typesetting. * Parallel downloading of files needed by MathJax, for faster startup times. * Shorter timeout for web fonts, so if they can't be downloaded, you don't have to wait so long. * Rollover to image fonts if a web font fails to load (so you don't have to wait for *every* font to fail. * The MathJax files are now packed only with `yuicompressor` rather than a custom compressor. The CDN serves gzipped versions, which end up being smaller than the gzipped custom-packed files. * Improved rendering speed in IE by removing ``position:relative`` from the style for mathematics. * Improved rendering speed for most browsers by isolating the mathematics from the page during typesetting (avoids full page reflows). Enhancements ============ * Allow the input and output jax configuration blocks to specify extensions to be loaded when the jax is loaded (this avoids needing to load them up front, so they don't have to be loaded on pages that don't include mathematics, for example). * Better handling of background color from style attributes. * Ability to pass configuration parameters via script URL. * Support HTML5 compliant configuration syntax. * Switch the Git repository from storing the fonts in `fonts.zip` to storing the `fonts/` directory directly. * Improved About box. * Added a minimum scaling factor (so math won't get too small). TeX Support ============ * Added support for ``\href``, ``\style``, ``\class``, ``\cssId``. * Avoid recursive macro definitions and other resource consumption possibilities. * Fix for ``\underline`` bug. * Fix for bug with ``\fbox``. * Fix height problem with ``\raise`` and ``\lower``. * Fix problem with ``\over`` used inside array entries. * Fix problem with nesting of math delimiters inside text-mode material. * Fix single digit super- and subscripts followed by punctuation. * Make sure `movablelimits` is off for ``\underline`` and related macros. * Fix problem with dimensions given with ``pc`` units. MathML Support ============== * Fix ``<`` and ``&`` being translated too early. * Handle self-closing tags in HTML files better. * Combine adjacent relational operators in ```` tags. * Fix entity name problems. * Better support for MathML namespaces. * Properly handle comments within MathML in IE. * Properly consider ```` and ```` as space-like. * Improved support for ```` with embellished operators. Other Bug Fixes =============== * Fixed CSS bleed through with zoom and other situations. * Fixed problems with ``showMathMenuMSIE`` when set to ``false``. * Replaced illegal prefix characters in cookie name. * Improved placement of surd for square roots and n-th roots. * Fixed layer obscuring math from MathPlayer for screen readers. * Newlines in CDATA comments are now handled properly. * Resolved conflict between `jsMath2jax` and `tex2jax` both processing the same equation. * Fixed problem with ``class="tex2jax_ignore"`` affecting the processing of sibling elements. Browser Support =============== **Android** * Added detection and configuration for Android browser. * Allow use of OTF web fonts in Android 2.2. **Blackberry** * MathJax now works with OS version 6. **Chrome** * Use OTF web fonts rather than SVG fonts for version 4 and above. **Firefox** * Added Firefox 4 detection and configuration. * Fix for extra line-break bug when displayed equations are in preformatted text. * Updated fonts so that FF 3.6.13 and above can read them. **Internet Explorer** * Changes for compatibility with IE9. * Fix for IE8 incorrectly parsing MathML. * Fix for IE8 namespace problem. * Fix for null ``parentNode`` problem. * Fix for ``outerHTML`` not quoting values of attributes. **iPhone/iPad** * Added support for OTF web fonts in iOS4.2. **Nokia** * MathJax now works with Symbian\ :sup:`3`\ . **Opera** * Prevent Opera from using STIX fonts unless explicitly requested via the font menu (since Opera can't display many of the characters). * Fixed bad em-size detection in 10.61. * Fixed a problem with the About dialog in Opera 11. **Safari** * Use OTF web fonts for Safari/PC. **WebKit** * Better version detection. mathjax-docs-2.3+20140108/synchronize.rst0000644000000000000000000000641512263271212016442 0ustar rootroot.. _synchronization: ************************************ Synchronizing your code with MathJax ************************************ MathJax performs much of its activity asynchronously, meaning that the calls that you make to initiate these actions will return before the actions are completed, and your code will continue to run even though the actions have not been finished (and may not even be started yet). Actions such as loading files, loading web-based fonts, and creating stylesheets all happen asynchronously within the browser, and since JavaScript has no method of halting a program while waiting for an action to complete, synchronizing your code with these types of actions is made much more difficult. MathJax uses three mechanisms to overcome this language shortcoming: callbacks, queues, and signals. **Callbacks** are functions that are called when an action is completed, so that your code can continue where it left off when the action was initiated. Rather than have a single routine that initiates an action, waits for it to complete, and then goes on, you break the function into two parts: a first part that sets up and initiates the action, and a second that runs after the action is finished. Callbacks are similar to event handlers that you attach to DOM elements, and are called when a certain action occurs. See the :ref:`Callback Object ` reference page for details of how to specify a callback. **Queues** are MathJax's means of synchronizing actions that must be performed sequentially, even when they involve asynchronous events like loading files or dynamically creating stylesheets. The actions that you put in the queue are `Callback` objects that will be performed in sequence, with MathJax handling the linking of one action to the next. MathJax maintains a master queue that you can use to synchronize with MathJax, but you can also create your own private queues for actions that need to be synchronized with each other, but not to MathJax as a whole. See the :ref:`Queue Object ` reference page for more details. **Signals** are another means of synchronizing your own code with MathJax. Many of the important actions that MathJax takes (like typesetting new math on the page, or loading an external component) are "announced" by posting a message to a special object called a `Signal`. Your code can register an interest in receiving one or more of these signals by providing a callback to be called when the signal is posted. When the signal arrives, MathJax will call your code. This works somewhat like an event handler, except that many different types of events can go through the same signal, and the signals have a "memory", meaning that if you register an interest in a particular type of signal and that signal has already occurred, you will be told about the past occurrences as well as any future ones. See the :ref:`Signal Object ` reference page for more details. See also the `test/sample-signals.html `_ file in the MathJax ``test`` directory for a working example of using signals. Each of these is explained in more detail in the links below: .. toctree:: :maxdepth: 1 Using Callbacks Using Queues Using Signals mathjax-docs-2.3+20140108/tex.rst0000644000000000000000000015754412263271212014701 0ustar rootroot.. _TeX-support: ***************************** MathJax TeX and LaTeX Support ***************************** The support for :term:`TeX` and :term:`LaTeX` in MathJax consists of two parts: the `tex2jax` preprocessor, and the `TeX` input processor. The first of these looks for mathematics within your web page (indicated by math delimiters like ``$$...$$``) and marks the mathematics for later processing by MathJax. The TeX input processor is what converts the TeX notation into MathJax's internal format, where one of MathJax's output processors then displays it in the web page. The `tex2jax` preprocessor can be configured to look for whatever markers you want to use for your math delimiters. See the :ref:`tex2jax configuration options ` section for details on how to customize the action of `tex2jax`. The TeX input processor handles conversion of your mathematical notation into MathJax's internal format (which is essentially MathML), and so acts as a TeX to MathML converter. The TeX input processor has few configuration options (see the :ref:`TeX options ` section for details), but it can also be customized through the use of extensions that define additional functionality (see the :ref:`TeX and LaTeX extensions ` below). Note that the TeX input processor implements **only** the math-mode macros of TeX and LaTeX, not the text-mode macros. MathJax expects that you will use standard HTML tags to handle formatting the text of your page; it only handles the mathematics. So, for example, MathJax does not implement ``\emph`` or ``\begin{enumerate}...\end{enumerate}`` or other text-mode macros or environments. You must use HTML to handle such formatting tasks. If you need a LaTeX-to-HTML converter, you should consider `other options `_. TeX and LaTeX math delimiters ============================= By default, the `tex2jax` preprocessor defines the LaTeX math delimiters, which are ``\(...\)`` for in-line math, and ``\[...\]`` for displayed equations. It also defines the TeX delimiters ``$$...$$`` for displayed equations, but it does **not** define ``$...$`` as in-line math delimiters. That is because dollar signs appear too often in non-mathematical settings, which could cause some text to be treated as mathematics unexpectedly. For example, with single-dollar delimiters, "... the cost is $2.50 for the first one, and $2.00 for each additional one ..." would cause the phrase "2.50 for the first one, and" to be treated as mathematics since it falls between dollar signs. For this reason, if you want to use single-dollars for in-line math mode, you must enable that explicitly in your configuration: .. code-block:: javascript MathJax.Hub.Config({ tex2jax: { inlineMath: [['$','$'], ['\\(','\\)']], processEscapes: true } }); Note that if you do this, you may want to also set ``processEscapes`` to ``true``, as in the example above, so that you can use ``\$`` to prevent a dollar sign from being treated as a math delimiter within the text of your web page. (Note that within TeX mathematics, ``\$`` always has this meaning; ``processEscapes`` only affects the treatment of the *opening* math delimiter.) See the ``config/default.js`` file, or the :ref:`tex2jax configuration options ` page, for additional configuration parameters that you can specify for the `tex2jax` preprocessor, which is the component of MathJax that identifies TeX notation within the page. TeX and LaTeX in HTML documents =============================== Keep in mind that your mathematics is part of an HTML document, so you need to be aware of the special characters used by HTML as part of its markup. There cannot be HTML tags within the math delimiters (other than ``
``) as TeX-formatted math does not include HTML tags. Also, since the mathematics is initially given as text on the page, you need to be careful that your mathematics doesn't look like HTML tags to the browser (which parses the page before MathJax gets to see it). In particular, that means that you have to be careful about things like less-than and greater-than signs (``<`` and ``>``), and ampersands (``&``), which have special meaning to the browsers. For example, .. code-block:: latex ... when $x`` in the document (typically the end of the next actual tag in the HTML file), and you may notice that you are missing part of the text of the document. In the example above, the "``we have ...``" will not be displayed because the browser thinks it is part of the tag starting at ```` using TeX-like syntax: .. code-block:: latex ... when $x \lt y$ we have ... Keep in mind that the browser interprets your text before MathJax does. Another source of difficulty is when MathJax is used in content management systems that have their own document processing commands that are interpreted before the HTML page is created. For example, many blogs and wikis use formats like :term:`Markdown` to allow you to create the content of you pages. In Markdown, the underscore is used to indicate italics, and this usage will conflict with MathJax's use of the underscore to indicate a subscript. Since Markdown is applied to the page first, it will convert your subscripts markers into italics (inserting ```` tags into your mathematics, which will cause MathJax to ignore the math). Such systems need to be told not to modify the mathematics that appears between math delimiters. That usually involves modifying the content-management system itself, which is beyond the means of most page authors. If you are lucky, someone else will already have done this for you, and you can find a MathJax plugin for your system on the `MathJax-In-Use page `_ page. If there is no plugin for your system, or if it doesn't handle the subtleties of issolating the mathematics from the other markup that it supports, then you may have to "trick" it into leaving your mathematics untouched. Most content-management systems provide some means of indicating text that should not be modified ("verbatim" text), often for giving code snippets for computer languages. You may be use that to enclose your mathematics so that the system leaves it unchanged and MathJax can process it. For example, in Markdown, the back-tick (`````) is used to mark verbatim text, so .. code-block:: latex ... we have `\(x_1 = 132\)` and `\(x_2 = 370\)` and so ... may be able to protect the underscores from being processed by Markdown. Some content-management systems use the backslash (``\``) as a special character for "escaping" other characters, but TeX uses this character to indicate a macro name. In such systems, you may have to double the backslashes in order to obtain a single backslash in your HTML page. For example, you may have to do .. code-block:: latex \\begin{array}{cc} a & b \\\\ c & c \\end{array} to get an array with the four entries *a*, *b*, *c*, and *d*. Note in particular that if you want ``\\`` you will have to double *both* backslashes, giving ``\\\\``. Finally, if you have enabled single dollar-signs as math delimiters, and you want to include a literal dollar sign in your web page (one that doesn't represent a math delimiter), you will need to prevent MathJax from using it as a math delimiter. If you also enable the ``processEscapes`` configuration parameter, then you can use ``\$`` in the text of your page to get a dollar sign (without the backslash) in the end. Alternatively, you use something like ``$`` to isolate the dollar sign so that MathJax will not use it as a delimiter. .. _tex-macros: Defining TeX macros =================== You can use the ``\def``, ``\newcommand``, ``\renewcommand``, ``\newenvironment``, ``\renewenvironment``, and ``\let`` commands to create your own macros and environments. Unlike actual TeX, however, in order for MathJax to process these, they must be enclosed in math delimiters (since MathJax only processes macros in math-mode). For example .. code-block:: latex \( \def\RR{\bf R} \def\bold#1{\bf #1} \) would define ``\RR`` to produce a bold-faced "R", and ``\bold{...}`` to put its argument into bold face. Both definitions would be available throughout the rest of the page. You can include macro definitions in the `Macros` section of the `TeX` blocks of your configuration, but they must be represented as JavaScript objects. For example, the two macros above can be pre-defined in the configuraiton by .. code-block:: javascript MathJax.Hub.Config({ TeX: { Macros: { RR: "{\\bf R}", bold: ["{\\bf #1}",1] } } }); Here you give the macro as a `name:value` pair, where the `name` is the name of the control sequence (without the backslash) that you are defining, and `value` is either the replacement string for the macro (when there are no arguments) or an array consisting of the replacement string followed by the number of arguments for the macro. Note that the replacement string is given as a JavaScript string literal, and the backslash has special meaning in JavaScript strings. So to get an actual backslash in the string you must double it, as in the examples above. If you have many such definitions that you want to use on more than one page, you could put them into a configuration file that you can load along with the main configuration file. For example, you could create a file in ``MathJax/config/local`` called ``local.js`` that contains your macro definitions: .. code-block:: javascript MathJax.Hub.Config({ TeX: { Macros: { RR: "{\\bf R}", bold: ["{\\bf #1}",1] } } }); MathJax.Ajax.loadComplete("[MathJax]/config/local/local.js"); and then load it along with your main configuration file on the script that loads ``MathJax.js``: .. code-block:: html If you are using the CDN, you can make a local configuration file on your own server, and load MathJax itself from the CDN and your configuration file from your server. See :ref:`Using a Local Configuration File with the CDN ` for details. .. _tex-eq-numbers: Automatic Equation Numbering ============================ New in MathJax v2.0 is the ability to have equations be numbered automatically. This functionality is turned off by default, so that pages don't change when you update from v1.1 to v2.0, but it is easy to configure MathJax to produce automatic equation numbers by adding: .. code-block:: html to your page just before the `` will load the `autobold` TeX extension in addition to those already included in the ``TeX-AMS_HTML`` configuration file. You can also load these extensions from within a math expresion using the non-standard ``\require{extension}`` macro. For example .. code-block:: latex \(\require{color}\) would load the `color` extension into the page. This way you you can load extensions into pages that didn't load them in their configurations (and prevents you from having to load all the extensions into all pages even if they aren't used). It is also possible to create a macro that will autoload an extension when it is first used (under the assumption that the extension will redefine it to perform its true function). For example .. code-block:: html would declare the ``\cancel``, ``\bcancel``, ``\xcancel``, and ``\cancelto`` macros to load the `cancel` extension (where they are actually defined). Whichever is used first will cause the extension to be loaded, redefining all four to their proper values. Note that 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 `_ 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. Action ------ The `action` extension gives you access to the MathML ```` element. It defines three new non-standard macros: .. describe:: \\mathtip{math}{tip} Use ``tip`` (in math mode) as tooltip for ``math``. .. describe:: \\texttip{math}{tip} Use ``tip`` (in text mode) as tooltip for ``math``. .. describe:: \\toggle{math1}{math2}...\\endtoggle Show ``math1``, and when clicked, show ``math2``, and so on. When the last one is clicked, go back to math1. To use this extension in your own configurations, add it to the `extensions` array in the TeX block. .. code-block:: javascript TeX: { extensions: ["action.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. AMSmath and AMSsymbols ---------------------- The `AMSmath` extension implements AMS math environments and macros, and the `AMSsymbols` extension implements macros for accessing the AMS symbol fonts. These are already included in the combined configuration files that load the TeX input processor. To use these extensions in your own configurations, add them to the `extensions` array in the TeX block. .. code-block:: javascript TeX: { extensions: ["AMSmath.js", "AMSsymbols.js", ...] } See the list of control sequences at the end of this document for details about what commands are implemented in these extensions. If you are not using one of the combined configuration files, the `AMSmath` extension will be loaded automatically when you first use one of the math environments it defines, but you will have to load it explicitly if you want to use the other macros that it defines. The `AMSsymbols` extension is not loaded automatically, so you must include it explicitly if you want to use the macros it defines. Both extensions are included in all the combined configuration files that load the TeX input processor. AMScd ----- The `AMScd` extensions implements the `CD` environment for commutative diagrams. See the `AMScd guide `_ for more information on how to use the `CD` environment. To use this extension in your own configurations, add it to the `extensions` array in the TeX block. .. code-block:: javascript TeX: { extensions: ["AMScd.js"] } Alternatively, if the extension hasn't been loaded in the configuration, you can use ``\require{AMScd}`` to load it from within a TeX expression. Note that you only need to include this once on the page, not every time the `CD` environment is used. 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. Autobold -------- The `autobold` extension adds ``\boldsymbol{...}`` around mathematics that appears in a section of an HTML page that is in bold. .. code-block:: javascript TeX: { extensions: ["autobold.js"] } This extension is **not** loaded by the combined configuration files. BBox ---- The `bbox` extension defines a new macro for adding background colors, borders, and padding to your math expressions. .. describe:: \\bbox[options]{math} puts a bounding box around ``math`` using the provided ``options``. The options can be one of the following: 1. A color name used for the background color. 2. A dimension (e.g., ``2px``) to be used as a padding around the mathematics (on all sides). 3. Style attributes to be applied to the mathematics (e.g., ``border:1px solid red``). 4. A combination of these separated by commas. Here are some examples: .. code-block:: latex \bbox[red]{x+y} % a red box behind x+y \bbox[2pt]{x+1} % an invisible box around x+y with 2pt of extra space \bbox[red,2pt]{x+1} % a red box around x+y with 2pt of extra space \bbox[5px,border:2px solid red] % a 2px red border around the math 5px away This extension is **not** included in any of the combined configurations, but it will be loaded automatically, so you do not need to include it in your `extensions` array. Begingroup ---------- The `begingroup` extension implements commands that provide a mechanism for localizing macro defintions so that they are not permanent. This is useful if you have a blog site, for example, and want to isolate changes that your readers make in their comments so that they don't affect later comments. It defines two new non-standard macros, ``\begingroup`` and ``\endgroup``, that are used to start and stop a local namespace for macros. Any macros that are defined between the ``\begingroup`` and ``\endgroup`` will be removed after the ``\endgroup`` is executed. For example, if you put ``\(\begingroup\)`` at the top of each reader's comments and ``\(\endgroup\)`` at the end, then any macros they define within their response will be removed after it is processed. In addition to these two macros, the `begingroup` extension defines the standard ``\global`` and ``\gdef`` control sequences from TeX. (The ``\let``, ``\def``, ``\newcommand``, and ``\newenvironment`` control sequences are already defined in the core TeX input jax.) To use this extension in your own configurations, add it to the `extensions` array in the TeX block. .. code-block:: javascript TeX: { extensions: ["begingroup.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. Cancel ------ The `cancel` extension defines the following macros: .. describe:: \\cancel{math} Strikeout ``math`` from lower left to upper right. .. describe:: \\bcancel{math} Strikeout ``math`` from upper left to lower right. .. describe:: \\xcancel{math} Strikeout ``math`` with an "X". .. describe:: \\cancelto{value}{math} Strikeout ``math`` with an arrow going to ``value``. To use this extension in your own configurations, add it to the `extensions` array in the TeX block. .. code-block:: javascript TeX: { extensions: ["cancel.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. Color ----- The ``\color`` command in the core TeX input jax is not standard in that it takes the mathematics to be colored as one of its parameters, whereas the LaTeX ``\color`` command is a switch that changes the color of everything that follows it. The `color` extension changes the ``\color`` command to be compatible with the LaTeX implementation, and also defines ``\colorbox``, ``\fcolorbox``, and ``\definecolor``, as in the LaTeX color package. It defines the standard set of colors (Apricot, Aquamarine, Bittersweet, and so on), and provides the RGB and grey-scale color spaces in addition to named colors. To use this extension in your own configurations, add it to the `extensions` array in the TeX block. .. code-block:: javascript TeX: { extensions: ["color.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, and have ``\color`` be compatible with LaTeX usage. Enclose ------- The `enclose` extension gives you access to the MathML ```` element for adding boxes, ovals, strikethroughs, and other marks over your mathematics. It defines the following non-standard macro: .. describe:: \\enclose{notation}[attributes]{math} Where ``notation`` is a comma-separated list of MathML ```` notations (e.g., ``circle``, ``left``, ``updiagonalstrike``, ``longdiv``, etc.), ``attributes`` are MathML attribute values allowed on the ```` element (e.g., ``mathcolor="red"``, ``mathbackground="yellow"``), and ``math`` is the mathematics to be enclosed. For example .. code-block:: latex \enclose{circle}[mathcolor="red"]{x} \enclose{circle}[mathcolor="red"]{\color{black}{x}} \enclose{circle,box}{x} \enclose{circle}{\enclose{box}{x}} To use this extension in your own configurations, add it to the `extensions` array in the TeX block. .. code-block:: javascript TeX: { extensions: ["enclose.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. Extpfeil -------- The `extpfeil` extension adds more macros for producing extensible arrows, including ``\xtwoheadrightarrow``, ``\xtwoheadleftarrow``, ``\xmapsto``, ``\xlongequal``, ``\xtofrom``, and a non-standard ``\Newextarrow`` for creating your own extensible arrows. The latter has the form .. describe:: \\Newextarrow{\\cs}{lspace,rspace}{unicode-char} where ``\cs`` is the new control sequence name to be defined, ``lspace`` and ``rspace`` are integers representing the amount of space (in suitably small units) to use at the left and right of text that is placed above or below the arrow, and ``unicode-char`` is a number representing a unicode character position in either decimal or hexadecimal notation. For example .. code-block:: latex \Newextarrow{\xrightharpoonup}{5,10}{0x21C0} defines an extensible right harpoon with barb up. Note that MathJax knows how to stretch only a limited number of characters, so you may not actually get a stretchy character this way. To use this extension in your own configurations, add it to the `extensions` array in the TeX block. .. code-block:: javascript TeX: { extensions: ["extpfeil.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. HTML ---- The `HTML` extension gives you access to some HTML features like styles, classes, element ID's and clickable links. It defines the following non-standard macros: .. describe:: \\href{url}{math} Makes ``math`` be a link to the page given by ``url``. .. describe:: \\class{name}{math} Attaches the CSS class ``name`` to the output associated with ``math`` when it is included in the HTML page. This allows your CSS to style the element. .. describe:: \\cssId{id}{math} Attaches an id attribute with value ``id`` to the output associated with ``math`` when it is included in the HTML page. This allows your CSS to style the element, or your javascript to locate it on the page. .. describe:: \\style{css}{math} Adds the give ``css`` declarations to the element associated with ``math``. For example: .. code-block:: latex x \href{why-equal.html}{=} y^2 + 1 (x+1)^2 = \class{hidden}{(x+1)(x+1)} (x+1)^2 = \cssId{step1}{\style{visibility:hidden}{(x+1)(x+1)}} This extension is **not** included in any of the combined configurations, but it will be loaded automatically when any of these macros is used, so you do not need to include it explicitly in your configuration. mhchem ------ The `mhchem` extensions implements the ``\ce``, ``\cf``, and ``\cee`` chemical equation macros of the LaTeX `mhchem` package. See the `mhchem CPAN page `_ for more information and a link to the documentation for `mhchem`. For example .. code-block:: latex \ce{C6H5-CHO} \ce{$A$ ->[\ce{+H2O}] $B$} \ce{SO4^2- + Ba^2+ -> BaSO4 v} To use this extension in your own configurations, add it to the `extensions` array in the TeX block. .. code-block:: javascript TeX: { extensions: ["mhchem.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. noErrors -------- The `noErrors` extension prevents TeX error messages from being displayed and shows the original TeX code instead. You can configure whether the dollar signs are shown or not for in-line math, and whether to put all the TeX on one line or use multiple lines (if the original text contained line breaks). This extension is loaded by all the combined configuration files that include the TeX input processor. To enable the `noErrors` extension in your own configuration, or to modify its parameters, add something like the following to your :meth:`MathJax.Hub.Config()` call: .. code-block:: javascript TeX: { extensions: ["noErrors.js"], noErrors: { inlineDelimiters: ["",""], // or ["$","$"] or ["\\(","\\)"] multiLine: true, // false for TeX on all one line style: { "font-size": "90%", "text-align": "left", "color": "black", "padding": "1px 3px", "border": "1px solid" // add any additional CSS styles that you want // (be sure there is no extra comma at the end of the last item) } } } Display-style math is always shown in multi-line format, and without delimiters, as it will already be set off in its own centered paragraph, like standard display mathematics. The default settings place the invalid TeX in a multi-line box with a black border. If you want it to look as though the TeX is just part of the paragraph, use .. code-block:: javascript TeX: { noErrors: { inlineDelimiters: ["$","$"], // or ["",""] or ["\\(","\\)"] multiLine: false, style: { "font-size": "normal", "border": "" } } } You may also wish to set the font family or other CSS values here. If you are using a combined configuration file that loads the TeX input processor, it will also load the `noErrors` extension automatically. If you want to disable the `noErrors` extension so that you receive the normal TeX error messages, use the following configuration: .. code-block:: javascript TeX: { noErrors: { disabled: true } } Any math that includes errors will be replaced by an error message indicating what went wrong. noUndefined ----------- The `noUndefined` extension causes undefined control sequences to be shown as their macro names rather than generating error messages. So ``$X_{\xxx}$`` would display as an "X" with a subscript consisting of the text ``\xxx`` in red. This extension is loaded by all the combined configuration files that include the TeX input processor. To enable the `noUndefined` extension in your own configuration, or to modify its parameters, add something like the following to your :meth:`MathJax.Hub.Config()` call: .. code-block:: javascript TeX: { extensions: ["noUndefined.js"], noUndefined: { attributes: { mathcolor: "red", mathbackground: "#FFEEEE", mathsize: "90%" } } } The ``attributes`` setting specifies attributes to apply to the ``mtext`` element that encodes the name of the undefined macro. The default values set ``mathcolor`` to ``"red"``, but do not set any other attributes. This example sets the background to a light pink, and reduces the font size slightly. If you are using a combined configuration file that loads the TeX input processor, it will also load the `noUndefined` extension automatically. If you want to disable the `noUndefined` extension so that you receive the normal TeX error messages for undefined macros, use the following configuration: .. code-block:: javascript TeX: { noUndefined: { disabled: true } } Any math that includes an undefined control sequence name will be replaced by an error message indicating what name was undefined. Unicode support --------------- The `unicode` extension implements a ``\unicode{}`` extension to TeX that allows arbitrary unicode code points to be entered in your mathematics. You can specify the height and depth of the character (the width is determined by the browser), and the default font from which to take the character. Examples: .. code-block:: latex \unicode{65} % the character 'A' \unicode{x41} % the character 'A' \unicode[.55,0.05]{x22D6} % less-than with dot, with height .55em and depth 0.05em \unicode[.55,0.05][Geramond]{x22D6} % same taken from Geramond font \unicode[Garamond]{x22D6} % same, but with default height, depth of .8em,.2em Once a size and font are provided for a given unicode point, they need not be specified again in subsequent ``\unicode{}`` calls for that character. The result of ``\unicode{...}`` will have TeX class `ORD` (i.e., it will act like a variable). Use ``\mathbin{...}``, ``\mathrel{...}``, etc., to specify a different class. Note that a font list can be given in the ``\unicode{}`` macro, but Internet Explorer has a buggy implementation of the ``font-family`` CSS attribute where it only looks in the first font in the list that is actually installed on the system, and if the required glyph is not in that font, it does not look at later fonts, but goes directly to the default font as set in the `Internet-Options/Font` panel. For this reason, the default font list for the ``\unicode{}`` macro is ``STIXGeneral, 'Arial Unicode MS'``, so if the user has :term:`STIX` fonts, the symbol will be taken from that (almost all the symbols are in `STIXGeneral`), otherwise MathJax tries `Arial Unicode MS`. The `unicode` extension is loaded automatically when you first use the ``\unicode{}`` macro, so you do not need to add it to the `extensions` array. You can configure the extension as follows: .. code-block:: javascript TeX: { unicode: { fonts: "STIXGeneral, 'Arial Unicode MS'" } } 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 .. _tex-commands: Supported LaTeX commands ======================== This is a long list of the TeX macros supported by MathJax. If the macro is defined in an extension, the name of the extension follows the macro name. If the extension is in brackets, the extension will be loaded automatically when the macro or environment is first used. More complete details about how to use these macros, with examples and explanations, is available at Carol Fisher's `TeX Commands Available in MathJax `_ page. Symbols ------- .. code-block:: latex # % & ^ _ { } ~ ' \ (backslash-space) \! \# \$ \% \& \, \: \; \> \\ \_ \{ \| \} A - .. code-block:: latex \above \abovewithdelims \acute \aleph \alpha \amalg \And \angle \approx \approxeq AMSsymbols \arccos \arcsin \arctan \arg \array \Arrowvert \arrowvert \ast \asymp \atop \atopwithdelims B - .. code-block:: latex \backepsilon AMSsymbols \backprime AMSsymbols \backsim AMSsymbols \backsimeq AMSsymbols \backslash \backslash \bar \barwedge AMSsymbols \Bbb \Bbbk AMSsymbols \bbox [bbox] \bcancel cancel \because AMSsymbols \begin \begingroup begingroup non-standard \beta \beth AMSsymbols \between AMSsymbols \bf \Big \big \bigcap \bigcirc \bigcup \Bigg \bigg \Biggl \biggl \Biggm \biggm \Biggr \biggr \Bigl \bigl \Bigm \bigm \bigodot \bigoplus \bigotimes \Bigr \bigr \bigsqcup \bigstar AMSsymbols \bigtriangledown \bigtriangleup \biguplus \bigvee \bigwedge \binom AMSmath \blacklozenge AMSsymbols \blacksquare AMSsymbols \blacktriangle AMSsymbols \blacktriangledown AMSsymbols \blacktriangleleft AMSsymbols \blacktriangleright AMSsymbols \bmod \boldsymbol [boldsymbol] \bot \bowtie \Box AMSsymbols \boxdot AMSsymbols \boxed AMSmath \boxminus AMSsymbols \boxplus AMSsymbols \boxtimes AMSsymbols \brace \bracevert \brack \breve \buildrel \bullet \Bumpeq AMSsymbols \bumpeq AMSsymbols C - .. code-block:: latex \cal \cancel cancel \cancelto cancel \cap \Cap AMSsymbols \cases \cdot \cdotp \cdots \ce mhchem \cee mhchem \centerdot AMSsymbols \cf mhchem \cfrac AMSmath \check \checkmark AMSsymbols \chi \choose \circ \circeq AMSsymbols \circlearrowleft AMSsymbols \circlearrowright AMSsymbols \circledast AMSsymbols \circledcirc AMSsymbols \circleddash AMSsymbols \circledR AMSsymbols \circledS AMSsymbols \class [HTML] non-standard \clubsuit \colon \color color \colorbox color \complement AMSsymbols \cong \coprod \cos \cosh \cot \coth \cr \csc \cssId [HTML] non-standard \cup \Cup AMSsymbols \curlyeqprec AMSsymbols \curlyeqsucc AMSsymbols \curlyvee AMSsymbols \curlywedge AMSsymbols \curvearrowleft AMSsymbols \curvearrowright AMSsymbols D - .. code-block:: latex \dagger \daleth AMSsymbols \dashleftarrow AMSsymbols \dashrightarrow AMSsymbols \dashv \dbinom AMSmath \ddagger \ddddot AMSmath \dddot AMSmath \ddot \ddots \DeclareMathOperator AMSmath \definecolor color \def [newcommand] \deg \Delta \delta \det \dfrac AMSmath \diagdown AMSsymbols \diagup AMSsymbols \diamond \Diamond AMSsymbols \diamondsuit \digamma AMSsymbols \dim \displaylines \displaystyle \div \divideontimes AMSsymbols \dot \doteq \Doteq AMSsymbols \doteqdot AMSsymbols \dotplus AMSsymbols \dots \dotsb \dotsc \dotsi \dotsm \dotso \doublebarwedge AMSsymbols \doublecap AMSsymbols \doublecup AMSsymbols \Downarrow \downarrow \downdownarrows AMSsymbols \downharpoonleft AMSsymbols \downharpoonright AMSsymbols E - .. code-block:: latex \ell \emptyset \enclose enclose non-standard \end \endgroup begingroup non-standard \enspace \epsilon \eqalign \eqalignno \eqcirc AMSsymbols \eqref [AMSmath] \eqsim AMSsymbols \eqslantgtr AMSsymbols \eqslantless AMSsymbols \equiv \eta \eth AMSsymbols \exists \exp F - .. code-block:: latex \fallingdotseq AMSsymbols \fbox \fcolorbox color \Finv AMSsymbols \flat \forall \frac \frac AMSmath \frak \frown G - .. code-block:: latex \Game AMSsymbols \Gamma \gamma \gcd \gdef begingroup \ge \genfrac AMSmath \geq \geqq AMSsymbols \geqslant AMSsymbols \gets \gg \ggg AMSsymbols \gggtr AMSsymbols \gimel AMSsymbols \global begingroup \gnapprox AMSsymbols \gneq AMSsymbols \gneqq AMSsymbols \gnsim AMSsymbols \grave \gt \gt \gtrapprox AMSsymbols \gtrdot AMSsymbols \gtreqless AMSsymbols \gtreqqless AMSsymbols \gtrless AMSsymbols \gtrsim AMSsymbols \gvertneqq AMSsymbols H - .. code-block:: latex \hat \hbar \hbox \hdashline \heartsuit \hline \hom \hookleftarrow \hookrightarrow \hphantom \href [HTML] \hskip \hslash AMSsymbols \hspace \Huge \huge \idotsint AMSmath I - .. code-block:: latex \iff \iiiint AMSmath \iiint \iint \Im \imath \impliedby AMSsymbols \implies AMSsymbols \in \inf \infty \injlim AMSmath \int \intercal AMSsymbols \intop \iota \it J - .. code-block:: latex \jmath \Join AMSsymbols K - .. code-block:: latex \kappa \ker \kern L - .. code-block:: latex \label [AMSmath] \Lambda \lambda \land \langle \LARGE \Large \large \LaTeX \lbrace \lbrack \lceil \ldotp \ldots \le \leadsto AMSsymbols \left \Leftarrow \leftarrow \leftarrowtail AMSsymbols \leftharpoondown \leftharpoonup \leftleftarrows AMSsymbols \Leftrightarrow \leftrightarrow \leftrightarrows AMSsymbols \leftrightharpoons AMSsymbols \leftrightsquigarrow AMSsymbols \leftroot \leftthreetimes AMSsymbols \leq \leqalignno \leqq AMSsymbols \leqslant AMSsymbols \lessapprox AMSsymbols \lessdot AMSsymbols \lesseqgtr AMSsymbols \lesseqqgtr AMSsymbols \lessgtr AMSsymbols \lesssim AMSsymbols \let [newcommand] \lfloor \lg \lgroup \lhd AMSsymbols \lim \liminf \limits \limsup \ll \llap \llcorner AMSsymbols \Lleftarrow AMSsymbols \lll AMSsymbols \llless AMSsymbols \lmoustache \ln \lnapprox AMSsymbols \lneq AMSsymbols \lneqq AMSsymbols \lnot \lnsim AMSsymbols \log \Longleftarrow \longleftarrow \Longleftrightarrow \longleftrightarrow \longmapsto \Longrightarrow \longrightarrow \looparrowleft AMSsymbols \looparrowright AMSsymbols \lor \lower \lozenge AMSsymbols \lrcorner AMSsymbols \Lsh AMSsymbols \lt \lt \ltimes AMSsymbols \lVert AMSmath \lvert AMSmath \lvertneqq AMSsymbols M - .. code-block:: latex \maltese AMSsymbols \mapsto \mathbb \mathbf \mathbin \mathcal \mathchoice [mathchoice] \mathclose \mathfrak \mathinner \mathit \mathop \mathopen \mathord \mathpunct \mathrel \mathring AMSmath \mathrm \mathscr \mathsf \mathstrut \mathtip action non-standard \mathtt \matrix \max \mbox \measuredangle AMSsymbols \mho AMSsymbols \mid \middle \min \mit \mkern \mmlToken non-standard \mod \models \moveleft \moveright \mp \mskip \mspace \mu \multimap AMSsymbols N - .. code-block:: latex \nabla \natural \ncong AMSsymbols \ne \nearrow \neg \negmedspace AMSmath \negthickspace AMSmath \negthinspace \neq \newcommand [newcommand] \newenvironment [newcommand] \Newextarrow extpfeil \newline \nexists AMSsymbols \ngeq AMSsymbols \ngeqq AMSsymbols \ngeqslant AMSsymbols \ngtr AMSsymbols \ni \nLeftarrow AMSsymbols \nleftarrow AMSsymbols \nLeftrightarrow AMSsymbols \nleftrightarrow AMSsymbols \nleq AMSsymbols \nleqq AMSsymbols \nleqslant AMSsymbols \nless AMSsymbols \nmid AMSsymbols \nobreakspace AMSmath \nolimits \normalsize \not \notag [AMSmath] \notin \nparallel AMSsymbols \nprec AMSsymbols \npreceq AMSsymbols \nRightarrow AMSsymbols \nrightarrow AMSsymbols \nshortmid AMSsymbols \nshortparallel AMSsymbols \nsim AMSsymbols \nsubseteq AMSsymbols \nsubseteqq AMSsymbols \nsucc AMSsymbols \nsucceq AMSsymbols \nsupseteq AMSsymbols \nsupseteqq AMSsymbols \ntriangleleft AMSsymbols \ntrianglelefteq AMSsymbols \ntriangleright AMSsymbols \ntrianglerighteq AMSsymbols \nu \nVDash AMSsymbols \nVdash AMSsymbols \nvDash AMSsymbols \nvdash AMSsymbols \nwarrow O - .. code-block:: latex \odot \oint \oldstyle \Omega \omega \omicron \ominus \operatorname AMSmath \oplus \oslash \otimes \over \overbrace \overleftarrow \overleftrightarrow \overline \overrightarrow \overset \overwithdelims \owns P - .. code-block:: latex \parallel \partial \perp \phantom \Phi \phi \Pi \pi \pitchfork AMSsymbols \pm \pmatrix \pmb \pmod \pod \Pr \prec \precapprox AMSsymbols \preccurlyeq AMSsymbols \preceq \precnapprox AMSsymbols \precneqq AMSsymbols \precnsim AMSsymbols \precsim AMSsymbols \prime \prod \projlim AMSmath \propto \Psi \psi Q - .. code-block:: latex \qquad \quad R - .. code-block:: latex \raise \rangle \rbrace \rbrack \rceil \Re \ref [AMSmath] \renewcommand [newcommand] \renewenvironment [newcommand] \require non-standard \restriction AMSsymbols \rfloor \rgroup \rhd AMSsymbols \rho \right \Rightarrow \rightarrow \rightarrowtail AMSsymbols \rightharpoondown \rightharpoonup \rightleftarrows AMSsymbols \rightleftharpoons \rightleftharpoons AMSsymbols \rightrightarrows AMSsymbols \rightsquigarrow AMSsymbols \rightthreetimes AMSsymbols \risingdotseq AMSsymbols \rlap \rm \rmoustache \root \Rrightarrow AMSsymbols \Rsh AMSsymbols \rtimes AMSsymbols \Rule non-standard \rVert AMSmath \rvert AMSmath S - .. code-block:: latex \S \scr \scriptscriptstyle \scriptsize \scriptstyle \searrow \sec \setminus \sf \sharp \shortmid AMSsymbols \shortparallel AMSsymbols \shoveleft AMSmath \shoveright AMSmath \sideset AMSmath \Sigma \sigma \sim \simeq \sin \sinh \skew \small \smallfrown AMSsymbols \smallint \smallsetminus AMSsymbols \smallsmile AMSsymbols \smash \smile \Space \space \spadesuit \sphericalangle AMSsymbols \sqcap \sqcup \sqrt \sqsubset AMSsymbols \sqsubseteq \sqsupset AMSsymbols \sqsupseteq \square AMSsymbols \stackrel \star \strut \style [HTML] non-stanard \subset \Subset AMSsymbols \subseteq \subseteqq AMSsymbols \subsetneq AMSsymbols \subsetneqq AMSsymbols \substack AMSmath \succ \succapprox AMSsymbols \succcurlyeq AMSsymbols \succeq \succnapprox AMSsymbols \succneqq AMSsymbols \succnsim AMSsymbols \succsim AMSsymbols \sum \sup \supset \Supset AMSsymbols \supseteq \supseteqq AMSsymbols \supsetneq AMSsymbols \supsetneqq AMSsymbols \surd \swarrow T - .. code-block:: latex \tag [AMSmath] \tan \tanh \tau \tbinom AMSmath \TeX \text \textbf \textit \textrm \textstyle \texttip action non-standard \tfrac AMSmath \therefore AMSsymbols \Theta \theta \thickapprox AMSsymbols \thicksim AMSsymbols \thinspace \tilde \times \tiny \Tiny non-standard \to \toggle action non-standard \top \triangle \triangledown AMSsymbols \triangleleft \trianglelefteq AMSsymbols \triangleq AMSsymbols \triangleright \trianglerighteq AMSsymbols \tt \twoheadleftarrow AMSsymbols \twoheadrightarrow AMSsymbols U - .. code-block:: latex \ulcorner AMSsymbols \underbrace \underleftarrow \underleftrightarrow \underline \underrightarrow \underset \unicode [unicode] non-standard \unlhd AMSsymbols \unrhd AMSsymbols \Uparrow \uparrow \Updownarrow \updownarrow \upharpoonleft AMSsymbols \upharpoonright AMSsymbols \uplus \uproot \Upsilon \upsilon \upuparrows AMSsymbols \urcorner AMSsymbols V - .. code-block:: latex \varDelta AMSsymbols \varepsilon \varGamma AMSsymbols \varinjlim AMSmath \varkappa AMSsymbols \varLambda AMSsymbols \varliminf AMSmath \varlimsup AMSmath \varnothing AMSsymbols \varOmega AMSsymbols \varphi \varPhi AMSsymbols \varpi \varPi AMSsymbols \varprojlim AMSmath \varpropto AMSsymbols \varPsi AMSsymbols \varrho \varsigma \varSigma AMSsymbols \varsubsetneq AMSsymbols \varsubsetneqq AMSsymbols \varsupsetneq AMSsymbols \varsupsetneqq AMSsymbols \vartheta \varTheta AMSsymbols \vartriangle AMSsymbols \vartriangleleft AMSsymbols \vartriangleright AMSsymbols \varUpsilon AMSsymbols \varXi AMSsymbols \vcenter \vdash \Vdash AMSsymbols \vDash AMSsymbols \vdots \vec \vee \veebar AMSsymbols \verb [verb] \Vert \vert \vphantom \Vvdash AMSsymbols W - .. code-block:: latex \wedge \widehat \widetilde \wp \wr X - .. code-block:: latex \Xi \xi \xcancel cancel \xleftarrow AMSmath \xlongequal extpfeil \xmapsto extpfeil \xrightarrow AMSmath \xtofrom extpfeil \xtwoheadleftarrow extpfeil \xtwoheadrightarrow extpfeil Y - .. code-block:: latex \yen AMSsymbols Z - .. code-block:: latex \zeta Environments ------------ LaTeX environments of the form ``\begin{XXX} ... \end{XXX}`` are provided where ``XXX`` is one of the following: .. code-block:: latex align [AMSmath] align* [AMSmath] alignat [AMSmath] alignat* [AMSmath] aligned [AMSmath] alignedat [AMSmath] array Bmatrix bmatrix cases CD AMSmath eqnarray eqnarray* equation equation* gather [AMSmath] gather* [AMSmath] gathered [AMSmath] matrix multline [AMSmath] multline* [AMSmath] pmatrix smallmatrix AMSmath split [AMSmath] subarray AMSmath Vmatrix vmatrix mathjax-docs-2.3+20140108/whats-new-2.1.rst0000644000000000000000000001763712263271212016312 0ustar rootroot.. _whats-new-2.1: ************************** What's New in MathJax v2.1 ************************** MathJax v2.1 is primarily a bug-fix release. Numerous display bugs, line-breaking problems, and interface issues have been resolved. The following lists indicate the majority of the bugs that have been fixed for this release. Interface ========= * Make NativeMML output properly handle iOS double-tap-and-hold, and issue warning message when switching to NativeMML output. * Use ``scrollIntoView`` to handle ``positionToHash`` rather than setting the document location to prevent pages from refreshing after MathJax finishes processing the math. * Handle positioning to a hash URL when the link is to an element within SVG output. * Make ``href``'s work in SVG mode in all browsers. * Fix problem with opening the "Show Math As" window in WebKit (affected Chrome 18, and Safari 5.1.7). * Use MathJax message area rather than window status line for ``maction`` with ``actiontype='statusline'`` to avoid security restrictions in some browsers. * Fix issue where zoom box for math that has been wrapped to the beginning of a line would be positioned at the end of the previous line. * Fix a problem where IE would try to typset the page before it was completely available, causing it to not typeset all the math on the page (or in some cases *any* of the math). * Allow decimal scale values in the dialog for setting the scale. * Fix SVG output so that setting the scale will rescale the existing mathematics. * Add close button to About box and don't make clicking box close it (only clicking button). * Make About box show 'woff or otf' when otf fonts are used (since both are requested). * Have output jax properly skip math when the input jax has had an internal failure and so didn't produce any element jax. * Produce ``MathJax.Hub`` signal when ``[Math Processing Error]`` is generated. Line-breaking ============= * Fix problem with SVG output disappearing during line breaks when equation numbers are also present. * Fix problem with potential infinite loop when an ```` is an embellished operator that causes a linebreak to occur. * Allow line breaks within the base of ```` to work so that the super and subscripts stay with the last line of the base. * Fix ```` so that when it contains a line break the delimiters and separators are not lost. * Allow line breaks at delimiters and separators in elements. * Fix issue with line breaking where some lines were going over the maximum width. * Fix problem with line breaking inside ```` elements. * Fix problem with line breaking where the incorrect width was being used to determine breakpoint penalties, so some long lines were not being broken. HTML-CSS/SVG display ==================== * Fix several Chrome alignment and sizing issues, including problems with horizontal lines at the tops of roots, fraction bars being too long, etc. * Resolve a problem with how much space is reserved for math equations when a minimum font size is set in the browser. * Force final math span to be remeasured so that we are sure the container is the right size. * Fix alignment problem in ````. * Fix processing error when rowalign has a bad value. * Fix a vertical placement problem with stretched elements in mtables in HTML-CSS, and improve performace for placeing the extension characters. * Handle spacing for U+2061 (function apply) better. * Better handling of primes and other pseudo scripts in HTML-CSS and SVG output. * Fixed a problem with ```` in SVG mode that caused processing error messages. * Fix misplaced ``\vec`` arrows in Opera and IE. * Make ```` with more than one letter have ``texClass`` OP rather than ORD in certain cases so it will space as a function. * Make HTML snippet handler accept a string as contents, even if not enclosed in braces. * Fix spacing for functions that have powers (e.g., ``\sin^2 x``). * Fix problem with SVG handling of ``\liminf`` and ``\limsup`` where the second half of the function name was dropped. * Fixed a problem where HTML-CSS and SVG output could leave partial equations in the DOM when the equation processing was interrupted to load a file. * Fix problems with ````, ````, and ```` which weren't handling styles. * Make column widths and row heights take minsize into account in ````. * Fix typo in ``handle-floats.js`` that caused it to not compile. * Fix problem in HTML-CSS output with ```` when super- or subscript has explicit style. TeX emulation ============= * Allow negative dimensions for ``\\[]`` but clip to 0 since this isn't really allowed in MathML. * Fixed problem where \\ with whitespace followed by [ would incorrectly be interpretted as \\[dimen]. * Make ``jsMath2jax`` run before other preprocessors so that ``tex2jax`` won't grab environments from inside the jsMath spans and divs before jsMath2jax sees them. * Fix issue with ``\vec`` not producing the correct character for ``\vec{\mathbf{B}}`` and similar constructs. * Combine multiple primes into single unicode characters. * Updated the unicode characters used for some accents and a few other characters to more appropriate choices. See issues #116, #119, and #216 in the MathJax issue tracker on GitHub. * Remove unwanted 'em' from ``eqnarray columnwidth`` values. * Make eqnarray do equation numbering when numbering is enabled. * Make vertical stretchy characters stand on the baseline, and improve spacing of some stretchy chars. * Make ``mtextFontInherit`` use the style and weight indicated in the math, so that ``\textbf`` and ``\textit`` will work properly. * Add ``\textcolor`` macro to the color extension. * Added RGB color model to the color extension. * Automatically load the AMSmath extension when needed by the ``mhchem`` extension. * Add ``<<=>`` arrow to ``mhchecm`` extension * Fix alignment of prescripts in ``mhchem`` to properly right-justify the scripts. * Expose the CE object in the ``mhchem`` extension. * Make ``autoload-all`` skip extensions that are already loaded, and not redefine user-defined macros. * Fix most extensions to not overwrite user defined macros when the extension is loaded. * Ignore ``\label{}`` with no label. * Make ``\injlim`` and friends produce single ```` elements for thier names rather than one for each letter. * Handle primes followed by superscript as real TeX does in TeX input jax. * Handle a few more negations (e.g., of arrows) to produce the proper Unicode points for these. * Don't produce a processing error when ``\limits`` is used without a preceding operator. MathML Handling =============== * Prevent align attribute on ```` from applying to ``//`` elements. * Ignore ``_moz-math-*`` attributes in MathML input so they don't appear in MathML output. * Prevent duplicate ``xmlns`` attributes in "Show Math As -> MathML". * Fixed a problem in MathML output where dimensions given to ```` with leading +'s could lose the plus and become absolute rather than relative. * Fix ``setTeXclass`` for ``TeXatom`` so that it handles the spacing for relations correctly. * Add more CSS to isolate ``NativeMML`` output from page. * Handle setup of MathPlayer better for IE10, and avoid some IE10 bugs in setting the document namespace for MathML. Fonts ====== * Fix a problem where bold-script didn't work properly in STIX fonts. * Work around Chrome bug with MathJax web fonts that affects some combining characters. * Remove dependencies of TeX->MathML conversion on the choice of fonts (TeX versus STIX). * For stretchy characters that don't have a single-character version in the MathJax fonts, make sure they are properly sized when not stretched or stretched to a small size. * Fix an error with ``U+u005E`` (^) which caused it to show as a plus when used as a stretchy accent. * Fix a problem with greek letters in STIX font producing the wrong letter (an offset was off by one). * Handle more characters in sans-serif-italic and bold-italic STIX fonts.mathjax-docs-2.3+20140108/localization-strings.rst0000644000000000000000000003000712263271212020240 0ustar rootroot.. _localization-strings: ******************** Localization Strings ******************** In MathJax v2.2 and later, the user interface can be localized to use languages other than English. This includes all information strings, menu items, warning messages, and so on. To make this possible, each string is given an ID that is used to obtain the localized version of the string. So the "File not found" message might have the ID ``NotFound``. The localization data for each language associates the ID ``NotFound`` with the proper translation of the English phrase "File not found". Some of MathJax's functions, like :meth:`MathJax.Message.Set()`, can accept localized strings as their parameters. To use a localized string in this case, use an array consisting of the ID followed by the English string (followed by any substitution arguments for the string, see below). For example, .. code-block:: javascript MathJax.Message.Set(["NotFound","File not found"]); would cause the "File not found" message to be displayed (in the currently selected language) in the MathJax message area at the bottom of left of the browser window. Note that :meth:`MathJax.Message.Set()` can still accept unlocalized strings, as it has traditionally: .. code-block:: javascript MathJax.Message.Set("File not found"); Here the message will always be in English, regardless of the selected language. The reason that the English string is also given (in addition to the ID), is because MathJax needs to have a fallback string to use in case the localization data doesn't translate that ID, or if the localization data has failed to load. Providing the English string in addition to the ID guarantees that a fallback is available. MathJax's localization system is documented more fully in the :ref:`Localization API ` documentation. Parameter Substitution ---------------------- Localized messages may need to include information, like file names, that are not known until the message is needed. In this case, the message string acts as a template and MathJax will insert the needed values into it at the appropriate places. To use such substitutions, you include the values in the localization string array following the English phrase, and use the special sequences ``%1``, ``%2``, etc., to refer to the parameters at the locations where they should appear in the message. For example, .. code-block:: javascript MathJax.Message.Set(["NotFound","File %1 not found",filename]); would cause the name stored in the variable ``filename`` to be inserted into the localized string at the location of the ``%1``. Note that the localized string could use the parameters in a different order from how they appear in English, so MathJax can handle languages where the word order is different. Although it would be rare to need more than 9 substitution parameters, you can use ``%10``, ``%11``, etc., to get the 10-th, 11-th, and so on. If you need a parameter to be followed directly by a number, use ``%{1}0`` (rather than ``%10``) to get the first parameter followed directly by a zero. A ``%`` followed by anything other than a number or a ``{`` generates just the character following the percent sign, so ``%%`` would produce a single ``%``, and ``%:`` would produce just ``:``. Plural forms ------------ Some languages handle plural forms differently from how English does. In English, there are two forms: the one used for a single item, and the one used for everything else. For example, you would say "You have one new message" for a single message, but "You have three new messages" of there were three messages (or two, or zero, or anything other than one). To handle plurals, you use a special "plural" directive within your message string. The format is .. code-block:: javascript %{plural:%n|text1|text2} where ``%n`` is the reference to the parameter (which should be a number) that controls which text to use. For English, there would be two texts, one (``text1``) for when the number is 1, and one (``text2``) for when it is anything else. Other languages may have more forms (e.g., Welsh has six different plural forms, a different one for 0 (zero), 1 (one), 2 (two), 3 (few), 6 (many), and anything else, so Welsh translation plural forms would have six different texts). The details of how to map the numeric value to the text strings is handled by the translation data for the selected language. As an example, you might use .. code-block:: javascript MathJax.Message.Set(["NewMessages","You have %1 new %{plural:%1|message|messages}",n]); where ``n`` is a variable holding the number of new messages. Alternatively, .. code-block:: javascript MathJax.Message.Set(["NewMessages","You have %{plural:%1|a new message|%1 new messages}",n]); shows how you can do substitution within the plural texts themselves. Note that the translation string may contain such constructs even if the original English one doesn't. For example .. code-block:: javascript MathJax.Message.Set(["alone","We are %1 in this family but alone in this World.",n]); could be translated into French by .. code-block:: javascript "Nous sommes %1 dans cette famille mais %{plural:%1|seul|seuls} en ce monde." Note that if one of the options for the plural forms requires a literal close brace, it can be quoted with a percent. For instance, .. code-block:: javascript %{plural:%1|One {only%}|Two {or more%}} would produce ``One {only}`` when the first argument is 1, and ``Two {or more}`` otherwise. If a message needs to include a literal string that looks like one of these selectors, the original ``%`` can be quoted. So ``%%{plural:%%1|A|B}`` would be the literal string ``%{plural:%1|A|B}``. Number forms ------------ Decimal numbers are represented differently in different languages. For example, 3.14159 is an English representation of an approximation to the mathematical constant pi, while in European countries, it would be written 3,14159. MathJax will convert a number to the proper format before inserting it into a localized string. For example .. code-block:: javascript MathJax.Message.Set(["pi","The value of pi is approximately %1",3.14159]); would show the value as ``3.14159`` in English, but ``3,14159`` if French is the selected language. ID's and Domains ---------------- Because MathJax consists of a number of separate components and can be extended by third party code, it is possible for two different components to want to use the same ID value for a string, leading to an ID name collision. To help avoid this, MathJax allows identifier *domains* that are used to isolate collections of identifiers for one component from those for another component. For example, each input jax has its own domain, as do many of the MathJax extensions. This means you only have to worry about collisions within your own domain, and so can more easily manage the uniqueness if the ID's in use. To use a domain with your ID, replace the ID with an array consisting of the domain and the ID. For example, the TeX input jax uses the domain ``TeX``, so .. code-block:: javascript MathJax.Message.Set([["TeX","MissingBrace"],"Missing Close Brace"]); would set the message to the translation associated with the ID ``MissingBrace`` in the ``TeX`` domain. Some functions that take localization strings automatically prepend the domain to the ID (if one isn't already given). For example, the :meth:`Error()` function of the TeX input jax uses the ``TeX`` domain if one isn't supplied, so .. code-block:: javascript TEX.Error(["MissingBrace","Missing Close Brace"]); will generate the ``MissingBrace`` error from the ``TeX`` domain without having to specify the ``TeX`` domain explicitly. HTML Snippets ------------- MathJax provides a means of specifiying HTML code in javascript called :ref:`HTML snippets `. These frequently include text that needs to be localized, so you can include localization strings (like those described above) within an HTML snippet in any location where you would normally have a regular text string. For example, the snippet .. code-block:: javascript [ "Follow this link: ", ["a",{href:"http://www.mathjax.org"},[ ["img",{src:"external.gif"}] ]] ] includes the text "Follow this link:" which should be localized. You can change it to a localization string to cause it to be translated to the selected langauge: .. code-block:: javascript [ ["FollowLink","Follow this link"],": ", ["a",{href:"http://www.mathjax.org"},[ ["img",{src:"external.gif"}] ]] ] (Here we use the ID ``FollowLink`` to obtain the translation). Note that you can include substitution parameters as usual: .. code-block:: javascript [ ["ClickMessages","Click for %1 new %{plural:%1|messsage|messages}",n],": ", ["a",{href:"messages.html"},[ ["img",{src:"external.gif"}] ]] ] It is even possible to substitute HTML snippets into a localized string (when it is within an HTML snippet): .. code-block:: javascript [ ["MathJaxLink","This is documented at the %1 website",[ ["a",{href:"http://docs.mathjax.org"},["MathJax]] ]] ] Note, however, that a better approach to this exampe is given in the next section. Since an HTML snippet might contain several strings that need to be localized, you may want to be able to specify the domain to use for *all* the strings within the snippet. Within a snippet, you can use an entry of the form ``[domain,snippet]`` to force the snippet to be processed with default domain ``domain``. E.g. .. code-block:: javascript [ ["TeX",[ ["ul",{},[ ["li",{},[["MissingBrace","Missing close brace"]]], ["li",{},[["ExtraBrace","Extra close brace"]]], ]] ]], ["MathML",[ ["ul",{},[ ["li",{},[["UnknownNode","Unknown node type: %1",type]]], ["li",{},[["BadAttribute","Illegal attribute: %1",attr]]], ]] ] ] would create two undordered lists, one with translations from the ``TeX`` domain, and one from the ``MathML`` domain. To summarize the format of an HTML snippet, it is an array with each entry being one of the following: * A text string, which becomes text in the resulting HTML; this is untranslated. * An array of the form ``["tag"]``, ``["tag",{properties}]``, or ``["tag",{properties},HTML-snippet]``, which becomes the given HTML tag, with the given properties, containing the given HTML-snippet as its children. * An array of the form ``[id,message]`` or ``[id,message,parameters]``, which is first translated, then parameter substitution performed, and the result added to the HTML (either as text or as HTML tags if the message included Markdown syntax). Note that the ``id`` can be either an id or an array ``[domain,id]``, and that the parameters could be HTML snippets themselves. * An array of the form ``[domain,HTML-snippet]``, which becomes the HTML-snippet with its localizations done from the given domain. Markdown Notation ----------------- HTML snippets allow you to create styled markup, like bold or italics, but this requires breaking the text up into smaller strings that fall in between HTML tags. That makes it hard to translate, since the strings are not full phrases. To make the creation of strings with bold, italics, and hyperlinks easier to localize, MathJax allows the strings within HTML snippets to be written in a limited Markdown syntax (*very* limited). You can use ``*bold*``, ``**italics**``, ``***bold-italics***``, ``[link-text](url)``, and ```code``` to obtain bold, italics, bold-italics, hyperlinks, and code blocks. For instance, the link example above could be more easily handled via .. code-block:: javascript [ ["MathJaxLink","This is documented at the [MathJax](%1) website", "http://docs.mathjax.org"] ] while .. code-block:: javascript [ ["Renderer","*Renderer*: lets you select the output renderer"] ] will produce the equivalent of ``Renderer: lets you select the output render`` in the appropriate language. mathjax-docs-2.3+20140108/LICENSE.txt0000644000000000000000000002613612263271212015162 0ustar rootroot Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. mathjax-docs-2.3+20140108/mathml.rst0000644000000000000000000001325712263271212015353 0ustar rootroot.. _MathML-support: ********************** MathJax MathML Support ********************** The support for :term:`MathML` in MathJax consists of three parts: the `mml2jax` preprocessor, the `MathML` input processor, and the `NativeMML` output processor. The first of these looks for ```` tags within your document and marks them for later processing by MathJax. The second converts the MathML to the internal format used by MathJax, and the third turns the internal format into MathML within the page so that it can be displayed by the browser's native MathML support. Because of MathJax's modular design, you do not need to use all three of these components. For example, you could use the `tex2jax` preprocessor and the TeX input processor, but the NativeMML output processor, so that your mathematics is entered in TeX format, but displayed as MathML. Or you could use the `mml2jax` preprocessor and MathML input processor with the HTML-CSS output processor to make MathML available in browsers that don't have native MathML support. It is also possible to have MathJax select the output processor for you so that MathML is used in those browsers that support it well enough, while HTML-CSS is used for those that don't. See the :ref:`common configurations ` section for details and examples. Of course it is also possible to use all three components together. It may seem strange to go through an internal format just to return to MathML in the end, but this is actually what makes it possible to view MathML within an HTML page (rather than an XHTML page), without the complications of handling special MIME-types for the document, or any of the other setup issues that make using native MathML difficult. MathJax handles the setup and properly marks the mathematics so that the browser will render it as MathML. In addition, MathJax provides its contextual menu for the MathML, which lets the user zoom the mathematics for easier reading, get and copy the source markup, and so on, so there is added value to using MathJax even with a pure MathML workflow. MathML in HTML pages ==================== For MathML that is handled via the preprocessor, you should not use named MathML entities, but rather use numeric entities like ``√`` or unicode characters embedded in the page itself. The reason is that entities are replaced by the browser before MathJax runs, and some browsers report errors for unknown entities. For browsers that are not MathML-aware, that will cause errors to be displayed for the MathML entities. While that might not occur in the browser you are using to compose your pages, it can happen with other browsers, so you should avoid the named entities whenever possible. If you must use named entities, you may need to declare them in the `DOCTYPE` declaration by hand. When you use MathML in an HTML document rather than an XHTML one (MathJax will work with both), you should not use the "self-closing" form for tags with no content, but should use separate open and close tags. That is, use .. code-block:: html rather than ````. This is because HTML (prior to HTML5) does not have self-closing tags, and some browsers will get the nesting of tags wrong if you attempt to use them. For example, with ````, since there is no closing tag, the rest of the mathematics will become the content of the ```` tag; but since ```` should have no content, the rest of the mathematics will not be displayed. This is a common error that should be avoided. Modern browsers that support HTML5 should be able to handle self-closing tags, but older browsers have problems with them, so if you want your mathematics to be visible to the widest audience, do not use the self-closing form in HTML documents. Content MathML ============== New in version 2.2 is experimental support for Content MathML. This uses an XSL style sheet developed by David Carlisle to convert Content MathML to Presentation MathML, which is then processed by MathJax. To use Content MathML in your documents, simply include ``"content-mathml.js"`` in the ``extensions`` array of your MathML configuration block. For example .. code-block:: html Note that this script tag must come *before* the script that loads ``MathJax.js`` itself. Supported MathML commands ========================= MathJax supports the `MathML3.0 `_ presentation mathematics tags, with some limitations. The MathML support is still under active development, so some tags are not yet implemented, and some features are not fully developed, but are coming. The deficiencies include: - No support for the elementary math tags: ``mstack``, ``mlongdiv``, ``msgroup``, ``msrow``, ``mscarries``, and ``mscarry``. - No support for alignment groups in tables. - No support for right-to-left rendering. - Not all attributes are supported for tables. E.g., ``columnspan`` and ``rowspan`` are not implemented yet. See the `results of the MathML3.0 test suite `_ for details. Semantics and Annotations ===================== Starting with MathJax version 2.3, some popular annotation formats like TeX, Maple, or Content MathML that are often included in the MathML source via the ``semantics`` element are accessible from the ``"Show Math As"`` menu. See the `MathML Annotation Framework `_ and the :ref:`configure-MathMenu` documentation for details. �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mathjax-docs-2.3+20140108/installation.rst����������������������������������������������������������0000644�0000000�0000000�00000033173�12263271212�016571� 0����������������������������������������������������������������������������������������������������ustar �root����������������������������root�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.. _installation: ****************************** Installing and Testing MathJax ****************************** The easiest way to use MathJax is to link directly to the MathJax distributed network service (see :ref:`Using the MathJax CDN `). In that case, there is no need to install MathJax yourself, and you can begin using MathJax right away; skip this document on installation and go directly to :ref:`Configuring MathJax `. MathJax can be loaded from a public web server or privately from your hard drive or other local media. To use MathJax in either way, you will need to obtain a copy of MathJax. There are three ways to do this: via ``git``, ``svn``, or via a pre-packaged archive. We recommend ``git`` or ``svn``, as it is easier to keep your installation up to date with these tools. .. _getting-mathjax-git: Obtaining MathJax via Git ========================= The easiest way to get MathJax and keep it up to date is to use the `Git `_ version control system to access our `GitHub repository `_. Use the command .. code-block:: sh git clone git://github.com/mathjax/MathJax.git MathJax to obtain and set up a copy of MathJax. (Note that there is no longer a ``fonts.zip`` file, as there was in v1.0, and that the ``fonts`` directory is now part of the repository itself.) Whenever you want to update MathJax, you can now use .. code-block:: sh cd MathJax git remote show origin to check if there are updates to MathJax (this will print several lines of data, but the last line should tell you if your copy is up to date or out of date). If MathJax needs updating, use .. code-block:: sh cd MathJax git pull origin to update your copy of MathJax to the current release version. If you keep MathJax updated in this way, you will be sure that you have the latest bug fixes and new features as they become available. This gets you the current development copy of MathJax, which is the version that contains all the latest changes to MathJax. Although we try to make sure this version is a stable and usable version of MathJax, it is under active development, and at times it may be less stable than the "release" version. If you prefer to use the most stable version (that may not include all the latest patches and features), you will want to get one of the tagged releases. Use .. code-block:: sh cd MathJax git tag -l to see all tagged versions, and use .. code-block:: sh cd MathJax git checkout to checkout the indicated version of MathJax, where ```` is the name of the tagged version you want to use. When you want to upgrade to a new release, you will need to repeat this for the latest release tag. Each of the main releases also has a branch in which critical updates are applied (we try hard not to patch the stable releases, but sometimes there is a crucial change that needs to be made). If you want to use the patched version of a release, then check out the branch rather than the tag. Use .. code-block:: sh cd MathJax git branch to get a list of the available branches. There are separate branches for the main releases, but with ``-latest`` appended. These contain all the patches for that particular release. You can check out one of the branches just as you would a tagged copy. For example, the branch for the ``v2.1`` tagged release is ``v2.1-latest``. To get this release, use .. code-block:: sh cd MathJax git checkout v2.1-latest and to update it when changes occur, use .. code-block:: sh cd MathJax git pull origin v2.1-latest .. _getting-mathjax-svn: Obtaining MathJax via SVN ========================= If you are more comfortable with the `subversion `_ source control system, you may want to use GitHub's ``svn`` service to obtain MathJax. If you want to get the latest revision using ``svn``, use the command .. code-block:: sh svn checkout http://github.com/mathjax/MathJax/trunk MathJax to obtain and set up a copy of MathJax. (Note that there is no longer a ``fonts.zip`` file as of v1.1, and that the ``fonts`` directory is now part of the repository itself.) Whenever you want to update MathJax, you can now use .. code-block:: sh cd MathJax svn status -u to check if there are updates to MathJax. If MathJax needs updating, use .. code-block:: sh cd MathJax svn update to update your copy of MathJax to the current release version. If you keep MathJax updated in this way, you will be sure that you have the latest bug fixes and new features as they become available. This gets you the current development copy of MathJax, which is the version that contains all the latest changes to MathJax. Although we try to make sure this version is a stable and usable version of MathJax, it is under active development, and at times it may be less stable than the "release" version. If you prefer to use one of the tagged releases instead, then use .. code-block:: sh svn checkout https://github.com/mathjax/MathJax/branches/[name] MathJax where ``[name]`` is replaced by the name of the branch you want to check out; e.g., ``2.1-latest``. The branch names can be found on the `GitHub MathJax page `_ under the `branches `_ tab. .. _getting-mathjax-zip: Obtaining MathJax via an archive ================================ Release versions of MathJax are available in archive files from the `MathJax download page `_ or the `MathJax GitHub page `_ (via the "zip" button, or the "downloads" tab), where you can download the archive that you need. You should download the v2.1 archive (which will get you a file with a name like ``mathjax-MathJax-v2.1-X-XXXXXXXX.zip``, where the X's are some sequence of random-looking letters and numbers), then simply unzip it. Once the MathJax directory is unpacked, you should move it to the desired location on your server (or your hard disk, if you are using it locally rather then through a web server). One natural location is to put it at the top level of your web server's hierarchy. That would let you refer to the main MathJax file as ``/MathJax/MathJax.js`` from within any page on your server. From the `MathJax GitHub download link `_, you can also select the ``Download .tar.gz`` or ``Download .zip`` buttons to get a copy of the current development version of MathJax that contains all the latest changes and bug-fixes. If a packaged release receives any important updates, then those updates will be part of the `branch` for that version. The link to the ``.zip`` file in the download list will be the original release version, not the patched version. To obtain the patched version, use the `Branches` drop down menu (at the far left of the menus within the page) to select the release branch that you want (for example ``v2.1-latest``), and then use the "zip" button just above it to get the latest patched version of that release. Obtaining MathJax via Bower =========================== Starting with version 2.3, it is possible to use `Bower `_ to install MathJax. Assuming Bower is installed on your system, just execute the following command: .. code-block:: sh bower install MathJax Testing your installation ========================= Use the HTML files in the ``test`` directory to see if your installation is working properly:: test/ index.html # Tests default configuration index-images.html # Tests image-font fallback display sample.html # Sample page with lots of pretty equations examples.html # Page with links to all sample pages Open these files in your browser to see that they appear to be working properly. If you have installed MathJax on a server, use the web address for those files rather than opening them locally. When you view the ``index.html`` file, you should see (after a few moments) a message that MathJax appears to be working. If not, you should check that the files have been transferred to the server completely, and that the permissions allow the server to access the files and folders that are part of the MathJax directory (be sure to verify the MathJax folder's permissions as well). Checking the server logs may help locate problems with the installation. .. _cross-domain-linking: Notes about shared installations ================================ Typically, you want to have MathJax installed on the same server as your web pages that use MathJax. There are times, however, when that may be impractical, or when you want to use a MathJax installation at a different site. For example, a departmental server at ``www.math.yourcollege.edu`` might like to use a college-wide installation at ``www.yourcollege.edu`` rather than installing a separate copy on the departmental machine. MathJax can certainly be loaded from another server, but there is one important caveat --- Firefox's and IE9's same-origin security policy for cross-domain scripting. Firefox's interpretation of the same-origin policy is more strict than most other browsers, and it affects how fonts are loaded with the `@font-face` CSS directive. MathJax uses this directive to load web-based math fonts into a page when the user doesn't have them installed locally on their own computer. Firefox's security policy, however, only allows this when the fonts come from the same server as the web page itself, so if you load MathJax (and hence its web fonts) from a different server, Firefox won't be able to access those web fonts. In this case, MathJax will pause while waiting for the font to download (which will never happen); it will time out after about 5 seconds and switch to image fonts as a fallback. Similarly, IE9 has a similar same-origin policy in its `IE9 standards mode`, so it exhibits this same behavior. There is a solution to this, however, if you manage the server where MathJax is installed, and if that server is running the `Apache web server `_. In the remote server's ``MathJax/fonts/`` folder, create a file called ``.htaccess`` that contains the following lines: :: Header set Access-Control-Allow-Origin "*" and make sure the permissions allow the server to read this file. (The file's name starts with a period, which causes it to be an "invisible" file on unix-based operating systems. Some systems, particularly those with graphical user interfaces, may not allow you to create such files, so you might need to use the command-line interface to accomplish this.) This file should make it possible for pages at other sites to load MathJax from this server in such a way that Firefox and IE9 will be able to download the web-based fonts. If you want to restrict the sites that can access the web fonts, change the ``Access-Control-Allow-Origin`` line to something like:: Header set Access-Control-Allow-Origin "http://www.math.yourcollege.edu" so that only pages at ``www.math.yourcollege.edu`` will be able to download the fonts from this site. See the open font library discussion of `web-font linking `_ for more details. .. _ff-local-fonts: Firefox and local fonts ======================= Firefox's same-origin security policy affects its ability to load web-based fonts, as described above. This has implications not only to cross-domain loading of MathJax, but also to using MathJax locally from your hard disk. Firefox's interpretation of the same-origin policy for local files is that the "same domain" for a page is the directory where that page exists, or any of its subdirectories. So if you use MathJax in a page with a ``file://`` URL, and if MathJax is loaded from a directory other than the one containing the original page, then MathJax will not be able to access the web-based fonts in Firefox. In that case, MathJax will fall back on image fonts to display the mathematics. In order for Firefox to be able to load the fonts properly for a local file, your MathJax installation must be in a subdirectory of the one containing the page that uses MathJax. This is an unfortunate restriction, but it is a limitiation imposed by Firefox's security model that MathJax can not circumvent. Currently, this is not a problem for other browsers. One solution to this problem is to install the MathJax fonts locally, so that Firefox will not have to use web-based fonts in the first place. To do that, either install the `STIX fonts `_, or copy the fonts from ``MathJax/fonts/HTML-CSS/TeX/otf`` into your systems fonts directory and restart your browser (see the `MathJax fonts help page `_ for details). IE9 and remote fonts ==================== IE9's same-origin policy affects its ability to load web-based fonts, as described above. This has implications not ony to cross-domain loading of MathJax, but also to the case where you view a local page (with a ``file://`` URL) that accesses MathJax from a remote site such as the MathJax CDN service. In this case, IE9 does **not** honor the ``Access-Control-Allow-Origin`` setting of the remote server (as it would if the web page came from an ``http://`` URL), and so it **never** allows the font to be accessed. One solution to this problem is to install the MathJax fonts locally so that MathJax doesn't have to use web-based fonts in the first place. Your best bet is to install the `STIX fonts`_ on your system (see the `MathJax fonts help page`_ for details). �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mathjax-docs-2.3+20140108/mathjax.rst���������������������������������������������������������������0000644�0000000�0000000�00000004037�12263271212�015521� 0����������������������������������������������������������������������������������������������������ustar �root����������������������������root�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������**************** What is MathJax? **************** MathJax is an open-source JavaScript display engine for LaTeX, MathML, and AsciiMath notation that works in all modern browsers. It was designed with the goal of consolidating the recent advances in web technologies into a single, definitive, math-on-the-web platform supporting the major browsers and operating systems, including those on mobile devices. It requires no setup on the part of the user (no plugins to download or software to install), so the page author can write web documents that include mathematics and be confident that users will be able to view it naturally and easily. One simply includes MathJax and some mathematics in a web page, and MathJax does the rest. MathJax uses web-based fonts (in those browsers that support it) to produce high-quality typesetting that scales and prints at full resolution (unlike mathematics included as images). MathJax can be used with screen readers, providing accessibility for the visually impaired. With MathJax, mathematics is text-based rather than image-based, and so it is available for search engines, meaning that your equations can be searchable, just like the text of your pages. MathJax allows page authors to write formulas using TeX and LaTeX notation, `MathML `_, a World Wide Web Consortium standard for representing mathematics in XML format, or `AsciiMath `_ notation. MathJax will even convert TeX notation into MathML, so that it can be rendered more quickly by those browsers that support MathML natively, or so that you can copy and paste it into other programs. MathJax is modular, so it loads components only when necessary, and can be extended to include new capabilities as needed. MathJax is highly configurable, allowing authors to customize it for the special requirements of their web sites. Finally, MathJax has a rich application programming interface (API) that can be used to make the mathematics on your web pages interactive and dynamic. �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������mathjax-docs-2.3+20140108/output.rst����������������������������������������������������������������0000644�0000000�0000000�00000027553�12263271212�015435� 0����������������������������������������������������������������������������������������������������ustar �root����������������������������root�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.. _output-formats: ********************** MathJax Output Formats ********************** Currently, MathJax can render math in three ways: - Using HTML-with-CSS to lay out the mathematics, - Using :term:`SVG` to lay out the mathematics, or - Using a browser's native MathML support. These are implemented by the `HTML-CSS`, `SVG` and `NativeMML` output processors. If you are using one of the combined configuration files, then this will select one of these output processors for you. If the config file ends in ``_HTML``, then it is the HTML-CSS output processor, and if it ends in ``_SVG`` then the SVG output processor will be used. If it ends in ``_HTMLorMML``, then the NativeMML output processor will be chosen if the browser supports it well enough, otherwise HTML-CSS output will be used. If you are performing your own in-line or file-based configuration, you select which one you want to use by including either ``"output/HTML-CSS"``, ``"output/SVG"``, or ``"output/NativeMML"`` in the `jax` array of your MathJax configuration. For example .. code-block:: javascript jax: ["input/TeX","output/HTML-CSS"] would specify TeX input and HTML-with-CSS output for the mathematics in your document. The **HTML-CSS output processor** produces high-quality output in all major browsers, with results that are consistent across browsers and operating systems. This is MathJax's primary output mode. Its major advantage is its quality and consistency; its drawback is that it is slower than the NativeMML mode at rendering the mathematics. Historically, the performance in Internet Explorer (and IE8 in particular) was quite poor, with the page getting slower and slower as more math is processed. MathJax version 2.0 includes a number of optimizations to improve the display performance in IE, and it is now more comparable to other browsers. The HTML-CSS output uses web-based fonts so that users don't have to have math fonts installed on their computers, which introduces some printing issues in certain browsers. The **SVG output processor** is new in MathJax version 2.0, and it uses `Scalable Vector Graphics` to render the mathematics on the page. SVG is supported in all the major browsers and most mobile devices; note, however, that Internet Explorer prior to IE9 does not support SVG, and IE9 only does in "IE9 standards mode", not its emulation modes for earlier versions. The SVG output mode is high quality and slightly faster than HTML-CSS, and it does not suffer from some of the font-related issues that HTML-CSS does, so prints well in all browsers. This format also works well in some ebook readers (e.g., iBooks). The disadvantages of this mode are the following: first, Internet Explorer only supports SVG in IE9 and later versions (and then only in IE9 standards mode or above), and some versions of the Android Internet browser don't have SVG enabled. Second, it does not take advantage of STIX fonts, and so only has access to the characters in the web-based fonts, and third, its variable-width tables become fixed size once they are typeset, and don't rescale if the window size changes (for example). Since equation numbers are handled through variable-width tables, that means equation numbers may not stay at the edge of the window if it is resized. For these reasons it is probably best not to force the use of SVG output unless you have some control over the browsers that are used to view your documents. The **NativeMML output processor** uses the browser's internal MathML support (if any) to render the mathematics. Currently, Firefox has native support for MathML, and IE has the `MathPlayer plugin `_ for rendering MathML. Opera has some built-in support for MathML that works well with simple equations, but fails with more complex formulas, so we don't recommend using the NativeMML output processor with Opera. Safari has some support for MathML since version 5.1, but the quality is not as high as either Firefox's implementation or IE with MathPlayer. Chrome, Konqueror, and most other browsers don't support MathML natively, but this may change in the future, since MathML is part of the HTML5 specification. The advantage of the NativeMML output Processor is its speed, since native MathML support is much faster than using complicated HTML and CSS to typeset mathematics, as the HTML-CSS output processor does. The disadvantage is that you are dependent on the browser's MathML implementation for your rendering, and these vary in quality of output and completeness of implementation. MathJax relies on features that are not available in some renderers (for example, Firefox's MathML support does not implement the features needed for labeled equations). The results using the NativeMML output processor may have spacing or other rendering problems that are outside of MathJax's control. Automatic Selection of the Output Processor =========================================== Since not all browsers support MathML natively, it would be unwise to choose the NativeMML output processor unless you are sure of your audience's browser capabilities. MathJax can help with that, however, since a number of its combined configuration files will select NativeMML output when the browser supports it well enough, and HTML-CSS output otherwise. These are the configuration files that end in ``_HTMLorMML``. If you are doing your own configuration, there is a special configuration file that you can include that will choose between NativeMML and HTML-CSS depending on the browser in use. To invoke it, add ``"MMLorHTML.js"`` to your configuration's `config` array, and **do not** include an output processor in your `jax` array; MathJax will fill that in for you based on the abilities of your user's browser. .. code-block:: javascript config: ["MMLorHTML.js"], jax: ["input/TeX"] By default, MathJax will choose HTML-CSS in all browsers except for one case: Internet Explorer when the MathPlayer plugin is present. In the past, MathJax selected NativeMML output for Firefox as well, but we have found that there are too many rendering issues with Firefox's native MathML implementation, and so MathJax now selects HTML-CSS output for Firefox by default as well. Users can still use the Mathjax contextual menu to select the NativeMML renderer if they wish to choose greater speed at the expense of some quality. You can customize which choice MathJax makes on a browser-by-browser basis or a global basis. See the ``config/default.js`` file or the :ref:`Configuring MMLorHTML ` section for further details. As an example, this configuration tells MathJax to use native MathML support rather than HTML-CSS output for Firefox: .. code-block:: html With this configuration, MathML output will be used for both Firefox and IE with the MathPlayer plugin. Note, however, that a user can employ the MathJax contextual menu to select the other renderer if he or she wishes. MathJax produces MathML that models the underlying mathematics as best it can, rather than using complicated hacks to improve output for a particular MathML implementation. When you make the choice to use the NativeMML output processor, you are making a trade-off: gaining speed at the expense of quality and reliability, a decision that should not be taken lightly. .. _automatic-linebreaking: Automatic Line Breaking ======================= The HTML-CSS and SVG output processors implement (most of) the MathML3 automatic line-breaking specification. (The NativeMML output processor relies on the browser's native MathML support to handle line breaking when it is used.) Since line-breaking takes extra processing and so can slow down the mathematical output, it is off by default, but you can enable it by adding .. code-block:: html to your page just before the ``