diff --git a/mathjax/COPYING.txt b/mathjax/COPYING.txt new file mode 100644 index 000000000..d64569567 --- /dev/null +++ b/mathjax/COPYING.txt @@ -0,0 +1,202 @@ + + 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. diff --git a/mathjax/README.txt b/mathjax/README.txt new file mode 100644 index 000000000..2ee90b967 --- /dev/null +++ b/mathjax/README.txt @@ -0,0 +1,480 @@ +OVERVIEW: + +MathJax (TM) is an open source, Ajax-based math display solution designed +with a goal of consolidating advances in many web technologies in a +single definitive math-on-the-web platform supporting all major +browsers. + +Some of the main features of MathJax include: + + o High-quality display of LaTeX and MathML math notation in HTML pages + + o Supported in most browsers with no plug-ins, extra fonts, or special + setup for the reader + + o Easy for authors, flexible for publishers, extensible for developers + + o Supports math accessibility, cut and paste interoperability and other + advanced functionality + + o Powerful API for integration with other web applications + +See http://www.mathjax.org/ for additional details. + + +INSTALLATION: + +MathJax can be used on a web server to support mathematics in your +public web pages, or it can be used locally from your hard disk for +your private pages. To use MathJax in either way, you will need to +obtain a copy of MathJax (see below) and its font package. These two +are separate pieces because the fonts are not likely to change often, +while the main code will be updated fairly regularly. + +Obtaining MathJax from SourceForge via SVN: + +The easiest way to obtain MathJax and keep it up-to-date is to use the +subversion program (svn) to check it out from the MathJax project at +SourceForge.net. The page + + http://sourceforge.net/projects/mathjax/develop + +lists the command you need to use to obtain a copy of MathJax via svn. +Once you have checked out a version of MathJax, you will find that it +includes a file called "fonts.zip" in the top-level directory. You +will need to unpack that file in order to complete the installation of +MathJax. It will create a fonts directory that contains the web fonts +and images fonts used by MathJax to support users who do not have math +fonts installed on their computers. Once you have checked out +MathJax, you will need to move the MathJax directory to your web +server in a location that is convenient for your use. + +Obtaining MathJax from SourceForge as an archive file: + +You can obtain MathJax from the MathJax project at SourceForge via +the link + + http://sourceforge.net/projects/mathjax/files/ + +where you will need to download a copy of the MathJax ZIP file (for +the current version) and the MathJax-webfonts ZIP file. Unpack the +MathJax ZIP file first, and then unpack the MathJax-webfonts ZIP file +into that. That should produce a fonts directory in the MathJax +folder (and MathJax/fonts should contain an HTML-CSS directory). The +fonts directory contains web fonts and image fonts used by MathJax to +support users who do not have math fonts installed on their +computers. Once you have unpacked both archives, you can move the +MathJax directory to your web server in a location that is convenient +for your use. + + +TESTING MATHJAX: + +Once you have MathJax installed, you can use the files in the +MathJax/test directory to test that your installation is working +properly. You can also use it to test if your version of MathJax +needs updating. If you have checked out MathJax using subversion +(svn), you can simply use "svn status" to see if your installation +needs to be updated, and "svn update" to get any updates. + + +USING MATHJAX IN A WEB PAGE: + +To use MathJax in a web page, you need to load MathJax.js near the top of +the document (preferably in the document HEAD). A SCRIPT tag like + + + +will do it if you have MathJax at the top level of your web server. +When called in this form, MathJax can be configured through the file +MathJax/config/MathJax.js, which contains the parameters that control +MathJax. There are comments in this file that explain what each of +the parameters does, so look there for details. + +Alternatively, you can configure MathJax in-line within your web page +(avoiding an extra file transfer). To do that, place the +configuration information within the SCRIPT tag itself, as in the +following example: + + + +which loads the tex2jax preprocessor and an extension that causes TeX +errors to show the original TeX code rather than an error message, +specifies the input and output jax (input format is TeX and output +format is HTML/CSS), configures the tex2jax preprocessor to allow +dollar signs to delimit inline-math as well as \(...\), and forces the +HTML/CSS output to use the MathJax TeX fonts (in particular, the STIX +fonts won't be used.) + +If you configure MathJax in this fashion, the MathJax/config/MathJax.js +file is not loaded, and your in-line configuration is used instead. +Note that you can include any of the parameters from the +config/MathJax.js file (and in fact any arbitrary JavaScript as well). + +With the default configuration, MathJax runs the tex2jax preprocessor +to look for TeX-style mathematics delimiters as a means of identifying +the mathematics on the page. This uses \(...\) to mark in-line +mathematics and \[...\] or $$...$$ for displayed mathematics. LaTeX +environments can also mark mathematics, as in +\begin{equation}...\end{equation}. Once the preprocessor runs, +MathJax will typeset the mathematics on the page. + +Note that there can not 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 ampersands (&), which have +special meaning to the browsers. For example, + + ... when $x using TeX-like syntax: + + ... when $x \lt y$ we have ... + +Keep in mind that the browser interprets your text before MathJax +does. + + +MATHJAX WITH NO PREPROCESSOR: + +The usual way to use MathJax is with the tex2jax preprocessor, but if +you are generating web pages via some other preprocessor of your own, +you may wish to bypass the tex2math preprocessing and mark the +mathematics in your page directly. This avoids an extra file +transfer, the time involed in running the tex2jax preprocessor, and +the issues involving less-than, greater-than, and ampersand discussed +in the section above. + +When MathJax processes a page, it looks for mathematics stored in +special SCRIPT tags. These are + + + +for in-line math, and + + + +for displayed math, where the contents of the SCRIPT tags are TeX or +LaTeX mathematics. Since SCRIPT tags can include less-than, +greater-than, and ampersand characters, this neatly avoids the problem +that these cause when you use the tex2jax preprocessor. + +Unfortunately, this method introduces a problem of its own, due to a +bug in Internet Explorer. The problem is that IE incorrectly removes +blank spaces from the page in order to avoid what it considers to be +multiple spaces in a row. In particular, if there is a space both +before and after a tag that IE thinks does not insert content into the +page, it removes one of the two blanks. Because SCRIPT tags don't +get displayed, IE will remove one of the spaces, so + + ... when we have ... + +will become "...whenx < y we have..." in the output, with no space +between the "when" and the "x". Because the space is removed before +MathJax runs, MathJax has no way to recover the missing space, as it +simply is no longer part of the page as far as IE is concerned. + +MathJax provides two different mechanisms to avoid this problem. One +is to add a prefix or postfix for the mathematics tags, which is text +that you insert before or after the tag that MathJax will remove when +it processes the tag. Patterns for the prefix and postfix are given +in the "preJax" and "postJax" parameters of the MathJax.Hub.Config() +command (see the MathJax/config/MathJax.js file for more details). +For example, setting + + preJax: "@@" + +would mean that + + ... when @@ we have ... + +would produce ".. when x < y we have ..." properly typeset. (One need +not use both a preJax and postJax, as one is enough, but both are +provided so that you can use either or both in combination.) Note, +however, that the "@@" in this example will be displayed as part of +the page until MathJax processes the mathematics and replaces the +preJax with the typeset mathematics. This may cause visual confusion +that disturbs your readers. It might be better to use something like +"[math]" as the text for the preJax, since this may make more sense to +your readers. Because the pre- and postJax are regular expression +patterns (not litteral strings), you will need to handle this +carefully because [ and ] have special meaning in regular expressions. +Use + + preJax: "\\[math\\]" + +to make preJax be "\[math\]" (the double backslashes are to quote the +backslash as part of the JavaScript string, and the resulting \[ and +\] quote these characters in the resulting regular expression so they +are treated as literal characters rather than having their special +meansings in regular expressions). + +The other approach is to use a "MathJax preview" before the SCRIPT +tag. This is a means by which you can supply an alternative form for +the mathematics to be displayed prior to when MathJax runs. You +could use a simple HTML version (if the mathematics is simple enough), +or an IMG tag, or just the raw TeX code, for example. Note that the +mathematics between the SCRIPT tags is NOT displayed (since it is a +script, not text), so the preview can be used to show the TeX code up +until the mathematics is typeset. (The tex2jax preprocessor does that +automatically, for example). To make a preview, include a SPAN with +CLASS="MathJax_Preview" as the element just before the math SCRIPT +tag, e.g., + + ... when x < y we have ... + +This circumvents the Internet Explorer space-removal bug, while at the +same time giving your readers a preview of the mathematics until +MathJax has been able to typeset it. + +You can use CSS styles to make it easier to distinguish the preview +from the rest of the text. For example: + + + +would cause the preview mathematics to be shown in red, with a border +and 2px of padding between the border and the preview text. + + +MATHJAX WITH MATHML: + +In addition to the TeX input processor, MathJax includes a MathML input +processor, so that you can specify your mathematics using MathML rather +than TeX, if you wish. (The input and output processors are called "jax".) +As with the TeX input jax, there is a pre-processor that looks for MathML +in your web page (XHTML or HTML) and converts it to the form needed by +MathJax. The preprocessor is called "mml2jax.js", and the associated input +jax is "input/MathML". You can request these in your +MathJax/config/MathJax.js file, or in line, as in the following example: + + + +When it is used, the mml2jax preprocessor will scan your page for +tags and insert them into the ... and
...
tags with +class="math", then you need to do a little more work for MathJax. These +need to be replaced by and tags. See also the section +MATHJAX WITHOUT A PREPROCESSOR above for some caveats concerning an +Internet Explorer bug that you will need to be aware of. + +If you are using a preprocessor of your own to write your HTML files, it +should be a simple matter of changing over the inserted tags to the ones +that MathJax needs. If you have existing HTML pages, however, and don't +want to (or can't) reprocess them, then you may want to use the jsMath2jax +preprocessor, which will first convert the span and div tags to script tags +before running MathJax. To do so, include "jsMath2jax.js" in your +extensions array, as in the following example: + + + +You should remove all the jsMath calls, like jsMath.Process(), or script +tags that load jsMath extensions. Only the single script tag that loads +MathJax should be needed. + +If you have created pages with dynamic mathematics that is processed by +jsMath on the fly, that is handled somewhat differently with MathJax. +MathJax has a richer API for dealing with mathematics on the page, but the +documentation is not yet ready. There have been discussions in the MathJax +on-line forums that deal with this topic, so your best bet right now is to +read them. + + +COMMUNITY: + +The main MathJax website is www.mathjax.org, and it includes announcements +and other important information. MathJax also has a SourceForge site at +http://sourceforge.net/projects/mathjax/ that includes the download site +for the MathJax distribution, the bug-tracker for reporting bugs, and +several user forums for asking questions and getting assistance: + + Bug tracker: http://sourceforge.net/tracker/?group_id=261188&atid=1240827 + MathJax Help: http://sourceforge.net/projects/mathjax/forums/forum/948701 + Open Discussion: http://sourceforge.net/projects/mathjax/forums/forum/948700 + +Before reporting a bug, please check that it has not already been reported. +Also, please use the bug tracker for reporting bugs rather than the help +forum. diff --git a/mathjax/docs/build/.buildinfo b/mathjax/docs/build/.buildinfo new file mode 100644 index 000000000..16fe5e992 --- /dev/null +++ b/mathjax/docs/build/.buildinfo @@ -0,0 +1,4 @@ +# Sphinx build info version 1 +# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. +config: fedf9ba9a5b2ef65b82b1fa1eea24e52 +tags: fbb0d17656682115ca4d033fb2f83ba1 diff --git a/mathjax/docs/build/.doctrees/CSS-styles.doctree b/mathjax/docs/build/.doctrees/CSS-styles.doctree new file mode 100644 index 000000000..fac151e43 Binary files /dev/null and b/mathjax/docs/build/.doctrees/CSS-styles.doctree differ diff --git a/mathjax/docs/build/.doctrees/HTML-snippets.doctree b/mathjax/docs/build/.doctrees/HTML-snippets.doctree new file mode 100644 index 000000000..696096fb1 Binary files /dev/null and b/mathjax/docs/build/.doctrees/HTML-snippets.doctree differ diff --git a/mathjax/docs/build/.doctrees/api/ajax.doctree b/mathjax/docs/build/.doctrees/api/ajax.doctree new file mode 100644 index 000000000..15cf5ebd4 Binary files /dev/null and b/mathjax/docs/build/.doctrees/api/ajax.doctree differ diff --git a/mathjax/docs/build/.doctrees/api/callback.doctree b/mathjax/docs/build/.doctrees/api/callback.doctree new file mode 100644 index 000000000..7565038e0 Binary files /dev/null and b/mathjax/docs/build/.doctrees/api/callback.doctree differ diff --git a/mathjax/docs/build/.doctrees/api/elementjax.doctree b/mathjax/docs/build/.doctrees/api/elementjax.doctree new file mode 100644 index 000000000..51677d23e Binary files /dev/null and b/mathjax/docs/build/.doctrees/api/elementjax.doctree differ diff --git a/mathjax/docs/build/.doctrees/api/html.doctree b/mathjax/docs/build/.doctrees/api/html.doctree new file mode 100644 index 000000000..ad381a94f Binary files /dev/null and b/mathjax/docs/build/.doctrees/api/html.doctree differ diff --git a/mathjax/docs/build/.doctrees/api/hub.doctree b/mathjax/docs/build/.doctrees/api/hub.doctree new file mode 100644 index 000000000..713ebfa65 Binary files /dev/null and b/mathjax/docs/build/.doctrees/api/hub.doctree differ diff --git a/mathjax/docs/build/.doctrees/api/index.doctree b/mathjax/docs/build/.doctrees/api/index.doctree new file mode 100644 index 000000000..7db64ab9c Binary files /dev/null and b/mathjax/docs/build/.doctrees/api/index.doctree differ diff --git a/mathjax/docs/build/.doctrees/api/inputjax.doctree b/mathjax/docs/build/.doctrees/api/inputjax.doctree new file mode 100644 index 000000000..f9c7348ab Binary files /dev/null and b/mathjax/docs/build/.doctrees/api/inputjax.doctree differ diff --git a/mathjax/docs/build/.doctrees/api/jax.doctree b/mathjax/docs/build/.doctrees/api/jax.doctree new file mode 100644 index 000000000..af3d5922c Binary files /dev/null and b/mathjax/docs/build/.doctrees/api/jax.doctree differ diff --git a/mathjax/docs/build/.doctrees/api/message.doctree b/mathjax/docs/build/.doctrees/api/message.doctree new file mode 100644 index 000000000..cbb982e06 Binary files /dev/null and b/mathjax/docs/build/.doctrees/api/message.doctree differ diff --git a/mathjax/docs/build/.doctrees/api/object.doctree b/mathjax/docs/build/.doctrees/api/object.doctree new file mode 100644 index 000000000..2f901ff3a Binary files /dev/null and b/mathjax/docs/build/.doctrees/api/object.doctree differ diff --git a/mathjax/docs/build/.doctrees/api/outputjax.doctree b/mathjax/docs/build/.doctrees/api/outputjax.doctree new file mode 100644 index 000000000..3b5ca7698 Binary files /dev/null and b/mathjax/docs/build/.doctrees/api/outputjax.doctree differ diff --git a/mathjax/docs/build/.doctrees/api/queue.doctree b/mathjax/docs/build/.doctrees/api/queue.doctree new file mode 100644 index 000000000..86a0ec1cb Binary files /dev/null and b/mathjax/docs/build/.doctrees/api/queue.doctree differ diff --git a/mathjax/docs/build/.doctrees/api/signal.doctree b/mathjax/docs/build/.doctrees/api/signal.doctree new file mode 100644 index 000000000..27fde7745 Binary files /dev/null and b/mathjax/docs/build/.doctrees/api/signal.doctree differ diff --git a/mathjax/docs/build/.doctrees/api/variable.doctree b/mathjax/docs/build/.doctrees/api/variable.doctree new file mode 100644 index 000000000..dee726be3 Binary files /dev/null and b/mathjax/docs/build/.doctrees/api/variable.doctree differ diff --git a/mathjax/docs/build/.doctrees/badge.doctree b/mathjax/docs/build/.doctrees/badge.doctree new file mode 100644 index 000000000..775598a48 Binary files /dev/null and b/mathjax/docs/build/.doctrees/badge.doctree differ diff --git a/mathjax/docs/build/.doctrees/callbacks.doctree b/mathjax/docs/build/.doctrees/callbacks.doctree new file mode 100644 index 000000000..bd92c9ae0 Binary files /dev/null and b/mathjax/docs/build/.doctrees/callbacks.doctree differ diff --git a/mathjax/docs/build/.doctrees/community.doctree b/mathjax/docs/build/.doctrees/community.doctree new file mode 100644 index 000000000..04d10094d Binary files /dev/null and b/mathjax/docs/build/.doctrees/community.doctree differ diff --git a/mathjax/docs/build/.doctrees/configuration.doctree b/mathjax/docs/build/.doctrees/configuration.doctree new file mode 100644 index 000000000..e1490e7e3 Binary files /dev/null and b/mathjax/docs/build/.doctrees/configuration.doctree differ diff --git a/mathjax/docs/build/.doctrees/dynamic.doctree b/mathjax/docs/build/.doctrees/dynamic.doctree new file mode 100644 index 000000000..18f196149 Binary files /dev/null and b/mathjax/docs/build/.doctrees/dynamic.doctree differ diff --git a/mathjax/docs/build/.doctrees/environment.pickle b/mathjax/docs/build/.doctrees/environment.pickle new file mode 100644 index 000000000..5a23e93e2 Binary files /dev/null and b/mathjax/docs/build/.doctrees/environment.pickle differ diff --git a/mathjax/docs/build/.doctrees/glossary.doctree b/mathjax/docs/build/.doctrees/glossary.doctree new file mode 100644 index 000000000..64a2f88dd Binary files /dev/null and b/mathjax/docs/build/.doctrees/glossary.doctree differ diff --git a/mathjax/docs/build/.doctrees/index.doctree b/mathjax/docs/build/.doctrees/index.doctree new file mode 100644 index 000000000..a02aaf547 Binary files /dev/null and b/mathjax/docs/build/.doctrees/index.doctree differ diff --git a/mathjax/docs/build/.doctrees/installation.doctree b/mathjax/docs/build/.doctrees/installation.doctree new file mode 100644 index 000000000..9246a5733 Binary files /dev/null and b/mathjax/docs/build/.doctrees/installation.doctree differ diff --git a/mathjax/docs/build/.doctrees/jsMath.doctree b/mathjax/docs/build/.doctrees/jsMath.doctree new file mode 100644 index 000000000..01e1d73bd Binary files /dev/null and b/mathjax/docs/build/.doctrees/jsMath.doctree differ diff --git a/mathjax/docs/build/.doctrees/mathjax.doctree b/mathjax/docs/build/.doctrees/mathjax.doctree new file mode 100644 index 000000000..96f59893d Binary files /dev/null and b/mathjax/docs/build/.doctrees/mathjax.doctree differ diff --git a/mathjax/docs/build/.doctrees/mathml.doctree b/mathjax/docs/build/.doctrees/mathml.doctree new file mode 100644 index 000000000..78f7e41b5 Binary files /dev/null and b/mathjax/docs/build/.doctrees/mathml.doctree differ diff --git a/mathjax/docs/build/.doctrees/model.doctree b/mathjax/docs/build/.doctrees/model.doctree new file mode 100644 index 000000000..e96ca3c82 Binary files /dev/null and b/mathjax/docs/build/.doctrees/model.doctree differ diff --git a/mathjax/docs/build/.doctrees/options/FontWarnings.doctree b/mathjax/docs/build/.doctrees/options/FontWarnings.doctree new file mode 100644 index 000000000..8d3a68d1d Binary files /dev/null and b/mathjax/docs/build/.doctrees/options/FontWarnings.doctree differ diff --git a/mathjax/docs/build/.doctrees/options/HTML-CSS.doctree b/mathjax/docs/build/.doctrees/options/HTML-CSS.doctree new file mode 100644 index 000000000..c720dafb8 Binary files /dev/null and b/mathjax/docs/build/.doctrees/options/HTML-CSS.doctree differ diff --git a/mathjax/docs/build/.doctrees/options/MMLorHTML.doctree b/mathjax/docs/build/.doctrees/options/MMLorHTML.doctree new file mode 100644 index 000000000..124911063 Binary files /dev/null and b/mathjax/docs/build/.doctrees/options/MMLorHTML.doctree differ diff --git a/mathjax/docs/build/.doctrees/options/MathML.doctree b/mathjax/docs/build/.doctrees/options/MathML.doctree new file mode 100644 index 000000000..10bc0e3c6 Binary files /dev/null and b/mathjax/docs/build/.doctrees/options/MathML.doctree differ diff --git a/mathjax/docs/build/.doctrees/options/MathMenu.doctree b/mathjax/docs/build/.doctrees/options/MathMenu.doctree new file mode 100644 index 000000000..50622d9d7 Binary files /dev/null and b/mathjax/docs/build/.doctrees/options/MathMenu.doctree differ diff --git a/mathjax/docs/build/.doctrees/options/MathZoom.doctree b/mathjax/docs/build/.doctrees/options/MathZoom.doctree new file mode 100644 index 000000000..1fbcf01ff Binary files /dev/null and b/mathjax/docs/build/.doctrees/options/MathZoom.doctree differ diff --git a/mathjax/docs/build/.doctrees/options/NativeMML.doctree b/mathjax/docs/build/.doctrees/options/NativeMML.doctree new file mode 100644 index 000000000..5d721ab69 Binary files /dev/null and b/mathjax/docs/build/.doctrees/options/NativeMML.doctree differ diff --git a/mathjax/docs/build/.doctrees/options/TeX.doctree b/mathjax/docs/build/.doctrees/options/TeX.doctree new file mode 100644 index 000000000..c29fa5b19 Binary files /dev/null and b/mathjax/docs/build/.doctrees/options/TeX.doctree differ diff --git a/mathjax/docs/build/.doctrees/options/hub.doctree b/mathjax/docs/build/.doctrees/options/hub.doctree new file mode 100644 index 000000000..1a334cf55 Binary files /dev/null and b/mathjax/docs/build/.doctrees/options/hub.doctree differ diff --git a/mathjax/docs/build/.doctrees/options/jsMath2jax.doctree b/mathjax/docs/build/.doctrees/options/jsMath2jax.doctree new file mode 100644 index 000000000..bb3d9b949 Binary files /dev/null and b/mathjax/docs/build/.doctrees/options/jsMath2jax.doctree differ diff --git a/mathjax/docs/build/.doctrees/options/mml2jax.doctree b/mathjax/docs/build/.doctrees/options/mml2jax.doctree new file mode 100644 index 000000000..24f332a45 Binary files /dev/null and b/mathjax/docs/build/.doctrees/options/mml2jax.doctree differ diff --git a/mathjax/docs/build/.doctrees/options/tex2jax.doctree b/mathjax/docs/build/.doctrees/options/tex2jax.doctree new file mode 100644 index 000000000..cacc98d6c Binary files /dev/null and b/mathjax/docs/build/.doctrees/options/tex2jax.doctree differ diff --git a/mathjax/docs/build/.doctrees/output.doctree b/mathjax/docs/build/.doctrees/output.doctree new file mode 100644 index 000000000..2d059e9f7 Binary files /dev/null and b/mathjax/docs/build/.doctrees/output.doctree differ diff --git a/mathjax/docs/build/.doctrees/platforms/index.doctree b/mathjax/docs/build/.doctrees/platforms/index.doctree new file mode 100644 index 000000000..ddeb5b02c Binary files /dev/null and b/mathjax/docs/build/.doctrees/platforms/index.doctree differ diff --git a/mathjax/docs/build/.doctrees/platforms/movable-type.doctree b/mathjax/docs/build/.doctrees/platforms/movable-type.doctree new file mode 100644 index 000000000..63a2b1b1f Binary files /dev/null and b/mathjax/docs/build/.doctrees/platforms/movable-type.doctree differ diff --git a/mathjax/docs/build/.doctrees/platforms/wordpress.doctree b/mathjax/docs/build/.doctrees/platforms/wordpress.doctree new file mode 100644 index 000000000..a0a9eace6 Binary files /dev/null and b/mathjax/docs/build/.doctrees/platforms/wordpress.doctree differ diff --git a/mathjax/docs/build/.doctrees/queues.doctree b/mathjax/docs/build/.doctrees/queues.doctree new file mode 100644 index 000000000..d8f60334b Binary files /dev/null and b/mathjax/docs/build/.doctrees/queues.doctree differ diff --git a/mathjax/docs/build/.doctrees/signals.doctree b/mathjax/docs/build/.doctrees/signals.doctree new file mode 100644 index 000000000..7460bf11f Binary files /dev/null and b/mathjax/docs/build/.doctrees/signals.doctree differ diff --git a/mathjax/docs/build/.doctrees/start.doctree b/mathjax/docs/build/.doctrees/start.doctree new file mode 100644 index 000000000..776b58b05 Binary files /dev/null and b/mathjax/docs/build/.doctrees/start.doctree differ diff --git a/mathjax/docs/build/.doctrees/startup.doctree b/mathjax/docs/build/.doctrees/startup.doctree new file mode 100644 index 000000000..f51a14713 Binary files /dev/null and b/mathjax/docs/build/.doctrees/startup.doctree differ diff --git a/mathjax/docs/build/.doctrees/synchronize.doctree b/mathjax/docs/build/.doctrees/synchronize.doctree new file mode 100644 index 000000000..0813c204a Binary files /dev/null and b/mathjax/docs/build/.doctrees/synchronize.doctree differ diff --git a/mathjax/docs/build/.doctrees/tex.doctree b/mathjax/docs/build/.doctrees/tex.doctree new file mode 100644 index 000000000..cab6dcada Binary files /dev/null and b/mathjax/docs/build/.doctrees/tex.doctree differ diff --git a/mathjax/docs/build/.doctrees/typeset.doctree b/mathjax/docs/build/.doctrees/typeset.doctree new file mode 100644 index 000000000..b6632234c Binary files /dev/null and b/mathjax/docs/build/.doctrees/typeset.doctree differ diff --git a/mathjax/docs/build/CSS-styles.html b/mathjax/docs/build/CSS-styles.html new file mode 100644 index 000000000..cdaa43574 --- /dev/null +++ b/mathjax/docs/build/CSS-styles.html @@ -0,0 +1,173 @@ + + + + + + + + CSS Style Objects — MathJax v1.0 documentation + + + + + + + + + + + + + +
+
+
+
+ +
+

CSS Style Objects

+

Many MathJax components allow you to specify CSS styles that control +the look of the elements they create. These are described using CSS +style objects, which are JavaScript objects that represent standard +CSS declarations. The main CSS style object is a collection of +name:value pairs where the name is the CSS selector that is being +defined, and the value is an object that gives the style for that +selector. Most often, the selector will need to be enclosed in +quotation marks, as it will contain special characters, so you would +need to use "#myID" rather than just #myID and "ul li" +rather than just ul li.

+

The value used to define the CSS style can either be a string +containing the CSS definition, or a javascript object that is itself a +collection of name:value pairs, where the name is the attribute +being defined and value is the value that attibute should be given. +Note that, since this is a JavaScript object, the pairs are separated +by commas (not semi-colons) and the values are enclosed in quotation +marks. If the name contains dashes, it should be enclosed in +quotation marks as well.

+

For example, jax/output/HTML-CSS/config.js includes the following +declaration:

+
styles: {
+
+  ".MathJax .merror": {
+    "background-color": "#FFFF88",
+    color:   "#CC0000",
+    border:  "1px solid #CC0000",
+    padding: "1px 3px",
+    "font-family": "serif",
+    "font-style": "normal",
+    "font-size":  "90%"
+  },
+
+  ".MathJax_Preview": {color: "#888888"},
+
+}
+
+
+

This defines two CSS styles, one for the selector .MathJax +.merror, which specifies a background color, foreground color, +border, and so on, and a second for .MathJax_Preview that sets its +color.

+

You can add as many such definitions to a styles object as you +wish. Note, however, that since this is a JavaScript object, the +selectors must be unique (e.g., you can’t use two definitions for +"img", for example, as only the last one would be saved). If you +need to use more than one entry for a single selector, you can add +comments like /* 1 */ and /* 2 */ to the selector to make them +unique.

+

It is possible to include selectors like "@media print", in which +case the value is a CSS style object. For example:

+
styles: {
+  "@media print": {
+    ".MathJax .merror": {
+       "background-color": "white",
+       border: 0
+    }
+  }
+}
+
+
+

The various extensions and output processors include more examples of +CSS style objects, so see the code for those files for additional +samples. In particular, the extensions/MathMenu.js, +extensions/MathZoom.js, extensions/FontWarnsing.js, and +jax/output/HTML-CSS/jax.js files include such definitions.

+
+ + +
+
+
+
+
+

Previous topic

+

Describing HTML snippets

+

Next topic

+

Glossary

+

This Page

+ + + +
+
+
+
+ + + + \ No newline at end of file diff --git a/mathjax/docs/build/HTML-snippets.html b/mathjax/docs/build/HTML-snippets.html new file mode 100644 index 000000000..47e3a9004 --- /dev/null +++ b/mathjax/docs/build/HTML-snippets.html @@ -0,0 +1,170 @@ + + + + + + + + Describing HTML snippets — MathJax v1.0 documentation + + + + + + + + + + + + + +
+
+
+
+ +
+

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 +configutation 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 elements that formt +he 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

+
[["img",{src:"/images/mypic.jpg"}]]
+
+
+

represents an HTML snippet that includes one element: an <img> tag +with src set to /images/mypic.jpg. That is, this is +equivalent to

+
<img src="/images/mypic.jpg">
+
+
+

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:

+
[
+  "Please read the ",
+  ["a",{href:"instructions.html"},["instructions"]],
+  " carefully before proceeding"
+]
+
+
+

which is equivalent to

+
please read the <a href="instructions.html">instructions</a> carefully
+before proceeding.
+
+
+

A final example shows how to set style attributes on an object:

+
[["span",
+  {
+    id:"mySpan",
+    style: {color:"red", "font-weight":"bold"}
+  },
+  [" This is bold text shown in red "]
+]]
+
+
+

which is equivalent to

+
<span id="mySpan" style="color: red; font-weight: bold;">
+This is bold text shown in red
+</span>
+
+
+
+ + +
+
+
+
+
+

Previous topic

+

Converting to MathJax from jsMath

+

Next topic

+

CSS Style Objects

+

This Page

+ + + +
+
+
+
+ + + + \ No newline at end of file diff --git a/mathjax/docs/build/_images/badge.gif b/mathjax/docs/build/_images/badge.gif new file mode 100644 index 000000000..e5082b651 Binary files /dev/null and b/mathjax/docs/build/_images/badge.gif differ diff --git a/mathjax/docs/build/_images/mt_head.png b/mathjax/docs/build/_images/mt_head.png new file mode 100644 index 000000000..eb81080e6 Binary files /dev/null and b/mathjax/docs/build/_images/mt_head.png differ diff --git a/mathjax/docs/build/_images/mt_menu.png b/mathjax/docs/build/_images/mt_menu.png new file mode 100644 index 000000000..e64f2ae9a Binary files /dev/null and b/mathjax/docs/build/_images/mt_menu.png differ diff --git a/mathjax/docs/build/_images/mt_templates.png b/mathjax/docs/build/_images/mt_templates.png new file mode 100644 index 000000000..ddf22f499 Binary files /dev/null and b/mathjax/docs/build/_images/mt_templates.png differ diff --git a/mathjax/docs/build/_images/wp_menu.png b/mathjax/docs/build/_images/wp_menu.png new file mode 100644 index 000000000..c10cc6d14 Binary files /dev/null and b/mathjax/docs/build/_images/wp_menu.png differ diff --git a/mathjax/docs/build/_images/wp_templates.png b/mathjax/docs/build/_images/wp_templates.png new file mode 100644 index 000000000..35c9105d3 Binary files /dev/null and b/mathjax/docs/build/_images/wp_templates.png differ diff --git a/mathjax/docs/build/_sources/CSS-styles.txt b/mathjax/docs/build/_sources/CSS-styles.txt new file mode 100644 index 000000000..32920c9b7 --- /dev/null +++ b/mathjax/docs/build/_sources/CSS-styles.txt @@ -0,0 +1,79 @@ +.. _css-style-objects: + +***************** +CSS Style Objects +***************** + +Many MathJax components allow you to specify CSS styles that control +the look of the elements they create. These are described using CSS +style objects, which are JavaScript objects that represent standard +CSS declarations. The main CSS style object is a collection of +`name:value` pairs where the `name` is the CSS selector that is being +defined, and the `value` is an object that gives the style for that +selector. Most often, the selector will need to be enclosed in +quotation marks, as it will contain special characters, so you would +need to use ``"#myID"`` rather than just ``#myID`` and ``"ul li"`` +rather than just ``ul li``. + +The value used to define the CSS style can either be a string +containing the CSS definition, or a javascript object that is itself a +collection of `name:value` pairs, where the `name` is the attribute +being defined and `value` is the value that attibute should be given. +Note that, since this is a JavaScript object, the pairs are separated +by commas (not semi-colons) and the values are enclosed in quotation +marks. If the name contains dashes, it should be enclosed in +quotation marks as well. + +For example, ``jax/output/HTML-CSS/config.js`` includes the following +declaration: + +.. code-block:: javascript + + styles: { + + ".MathJax .merror": { + "background-color": "#FFFF88", + color: "#CC0000", + border: "1px solid #CC0000", + padding: "1px 3px", + "font-family": "serif", + "font-style": "normal", + "font-size": "90%" + }, + + ".MathJax_Preview": {color: "#888888"}, + + } + +This defines two CSS styles, one for the selector ``.MathJax +.merror``, which specifies a background color, foreground color, +border, and so on, and a second for ``.MathJax_Preview`` that sets its +color. + +You can add as many such definitions to a ``styles`` object as you +wish. Note, however, that since this is a JavaScript object, the +selectors must be unique (e.g., you can't use two definitions for +``"img"``, for example, as only the last one would be saved). If you +need to use more than one entry for a single selector, you can add +comments like ``/* 1 */`` and ``/* 2 */`` to the selector to make them +unique. + +It is possible to include selectors like ``"@media print"``, in which +case the value is a CSS style object. For example: + +.. code-block:: javascript + + styles: { + "@media print": { + ".MathJax .merror": { + "background-color": "white", + border: 0 + } + } + } + +The various extensions and output processors include more examples of +CSS style objects, so see the code for those files for additional +samples. In particular, the ``extensions/MathMenu.js``, +``extensions/MathZoom.js``, ``extensions/FontWarnsing.js``, and +``jax/output/HTML-CSS/jax.js`` files include such definitions. diff --git a/mathjax/docs/build/_sources/HTML-snippets.txt b/mathjax/docs/build/_sources/HTML-snippets.txt new file mode 100644 index 000000000..305f0c624 --- /dev/null +++ b/mathjax/docs/build/_sources/HTML-snippets.txt @@ -0,0 +1,83 @@ +.. _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 +configutation 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 elements that formt +he 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 + + diff --git a/mathjax/docs/build/_sources/api/ajax.txt b/mathjax/docs/build/_sources/api/ajax.txt new file mode 100644 index 000000000..0da172d63 --- /dev/null +++ b/mathjax/docs/build/_sources/api/ajax.txt @@ -0,0 +1,196 @@ +.. _api-ajax: + +*********************** +The MathJax.Ajax Object +*********************** + +The `MathJax.Ajax` structure holds the data and functions for handling +loading of external modules. Modules are loaded only once, even if +called for in several places. The loading of files is asynchronous, +and so the code that requests an external module will continue to run +even when that module has not completed loading, so it is important to +be aware of the timing issues this may cause. Similarly, creating or +loading stylesheets is an asynchronous action. In particular, all +actions that rely on the file or stylesheet having been loaded must be +delayed until after the file has been downloaded completely. This is +the reason for the large number of routines that take callback +functions. + +Any operation that could cause the loading of a file or stylesheet +must be synchronized with the rest of the code via such callbacks. +Since processing any mathematics might cause files to be loaded (e.g., +little-used markup might be implemented in an extension that is loaded +only when that markup is used), any code that dynamically typesets +mathematics will need to be structured to use callbacks to guarantee +that the mathematics has been completely processed before the code +tries to use it. See the :ref:`Synchronizing with MathJax ` +documentation for details on how to do this properly. + + +Properties +========== + +.. describe:: timeout + + Number of milliseconds to wait for a file to load before + it is considered to have failed to load. + + *Default:* 20 seconds + +.. describe:: STATUS.OK + + The value used to indicate that a file load has occurred + successfully. + +.. describe:: STATUS.ERROR + + The value used to indicate that a file load has caused an error or + a timeout to occur. + +.. describe:: loaded + + An object containing the names of the files that have been loaded (or + requested) so far. ``MathJax.Ajax.loaded["file"]`` will be + non-``null`` when the file has been loaded, with the value being + the ``MathJax.Ajax.STATUS`` value of the load attempt. + +.. describe:: loading + + An object containing the files that are currently loading, the + callbacks that are to be run when they load or timeout, and + additional internal data. + + +Methods +======= + +.. method:: Require(file[,callback]) + + Loads the given file if it hasn't been already. The file must be a + JavaScript file or a CSS stylesheet; i.e., it must end in ``.js`` + or ``.css``. Alternatively, it can be an object with a single + `key:value` pair where the `key` is one of ``js`` or ``css`` and + the `value` is the file of that type to be loaded (this makes it + possible to have the file be created by a CGI script, for example, + or to use a ``data::`` URL). The file must be relative to the + MathJax home directory and can not contain ``../`` file path + components. + + When the file is completely loaded and run, the `callback`, if + provided, will be executed passing it the status of the file load. + If there was an error while loading the file, or if the file fails + to load within the time limit given by ``MathJax.Ajax.timout``, + the status will be ``MathJax.Ajax.STATUS.ERROR`` otherwise it + will be ``MathJax.Ajax.STATUS.OK``. If the file is already + loaded, the callback will be called immediately and the file will + not be loaded again. + + :Parameters: + - **file** --- name of the file to be loaded + - **callback** --- the callback specification + :Returns: the callback object + +.. method:: Load(file[,callback]) + + Used internally to load a given file without checking if it + already has been loaded, or where it is to be found. + + :Parameters: + - **file** --- name of the file to be loaded + - **callback** --- the callback specification + :Returns: the callback object + +.. method:: loadComplete(file) + + Called from within the loaded files to inform MathJax that the + file has been completely loaded and initialized. The `file` + parameter is the name of the file that has been loaded. This + routine will cause any callback functions registered for the file + or included in the :meth:``MathJax.Ajax.Require()`` calls to be + executed, passing them the status or the load + (`MathJax.Ajax.STATUS.OK`` or ``MathJax.Ajax.STATUS.ERROR``) as + their last parameter. + + :Parameters: + - **file** --- name of the file that has been loaded + :Returns: ``null`` + +.. method:: loadTimeout(file) + + Called when the timeout period is over and the file hasn't loaded. + This indicates an error condition, and the + :meth:`MathJax.Ajax.loadError()` method will be executed, then the + file's callback will be run with ``MathJax.Ajax.STATUS.ERROR`` as + its parameter. + + :Parameters: + - **file** --- name of the file that timed out + :Returns: ``null`` + +.. method:: loadError(file) + + The default error handler called when a file fails to load. It + puts a warning message into the MathJax message box on screen. + + :Parameters: + - **file** --- the name of the file that failed to load + :Returns: ``null`` + +.. method:: loadHook(file,callback) + + Registers a callback to be executed when the given file is + loaded. The file load operation need to be started when this + method is called, so it can be used to register a hook for a file + that may be loaded in the future. + + :Parameters: + - **file** --- the name of the file to wait for + - **callback** --- the callback specification + :Returns: the callback object + +.. method:: Styles(styles[,callback]) + + Creates a stylesheet from the given style data. `styles` can + either be a string containing a stylesheet definition, or an + object containing a :ref:`CSS Style Object `. + For example: + + .. code-block:: javascript + + MathJax.Ajax.Styles("body {font-family: serif; font-style: italic}"); + + and + + .. code-block:: javascript + + MathJax.Ajax.Styles({ + body: { + "font-family": "serif", + "font-style": "italic" + } + }); + + both set the body font family and style. + + The callback routine is called when the stylesheet has been + created and is available for use. + + :Parameters: + - **styles** --- CSS style object for the styles to set + - **callback** --- the callback specification + :Returns: the callback object + + .. note:: + + Internet Explorer has a limit of 32 dynamically created + stylesheets, so it is best to combine your styles into one + large group rather than making several smaller calls. + +.. method:: fileURL(file) + + Returns a complete URL to a file (replacing ``[MathJax]`` with the + actual root URL location). + + :Parameters: + - **file** --- the file name possibly including ``[MathJax]`` + :Returns: the full URL for the file diff --git a/mathjax/docs/build/_sources/api/callback.txt b/mathjax/docs/build/_sources/api/callback.txt new file mode 100644 index 000000000..3e51db0d6 --- /dev/null +++ b/mathjax/docs/build/_sources/api/callback.txt @@ -0,0 +1,259 @@ +.. _api-callback: + +************************** +The MathJax.Callback Class +************************** + +The ``MathJax.Callback`` object is one of the key mechanisms used by +MathJax to synchronize its actions with those that occur +asynchronously, like loading files and stylesheets. A `Callback` +object is used to tie the execution of a function to the completion of +an asynchronous action. See :ref:`Synchronizing with MathJax +` for more details, and :ref:`Using Callbacks +` in particular for examples of how to specify and +use MathJax `Callback` objects. + + +Specifying a callback +--------------------- + +When a method includes a callback as one of its arguments, that +callback can be specified in a number of different ways, depending on +the functionality that is required of the callback. The easiest case +is to simply provide a function to be called, but it is also possible +to include data to pass to the function when it is executed, and even +the object that will be used as the javascript `this` object when the +function is called. + +Most functions that take callbacks as arguments accept a `callback +specification` rather than an actual callback object, though you can +use the :meth:`MathJax.Callback` function to convert a callback +specification into a Callback object if needed. + +A callback specification is any one of the following: + + .. describe:: fn + + A function that is to be called when the callback is executed. + No additional data is passed to it (other that what it is + called with at the time the callback is executed), and `this` + will be the window object. + + .. describe:: [fn] + + An array containing a function to be called when the callback + is executed (as above). + + .. describe:: [fn, data...] + + An array containing a function together with data to be passed + to that function when the callback is executed; `this` is still + the window object. For example, + + .. code-block:: javascript + + [function (x,y) {return x+y}, 2, 3] + + would specify a callback that would pass ``2`` and ``3`` to + the given function, and it would return their sum, ``5``, when + the callback is executed. + + .. describe:: [object, fn] + + An array containing an object to use as `this` and a function to + call for the callback. For example, + + .. code-block:: javascript + + [{x:'foo', y:'bar'}, function () {this.x}] + + would produce a callback that returns the string ``"foo"`` + when it is called. + + .. describe:: [object, fn, data...] + + Similar to the previous case, but with data that is passed to + the function as well. + + ..describe:: ["method", object] + + Here, `object` is an object that has a method called `method`, and + the callback will execute that method (with the object as + `this`) when it is called. For example, + + .. code-block:: javascript + + ["length",[1,2,3,4]] + + would call the `length` method on the array ``[1,2,3,4]`` when + the callback is called, returning ``4``. + + .. describe:: ["method", object, data...] + + Similar to the previous case, but with data that is passed to + the method. E.g., + + .. code-block:: javascript + + ["slice",[1,2,3,4],1,3] + + would perform the equivalent of ``[1,2,3,4].slice(1,3)``, + which returns the array ``[2,3]`` as a result. + + .. describe:: {hook: fn, data: [...], object: this} + + Here the data for the callback are given in an associative + array of `key:value` pairs. The value of `hook` is the + function to call, the value of `data` is an array of the + arguments to pass to the function, and the value of `object` + is the object to use as `this` in the function call. The + specification need not include all three `key:value` pairs; any + that are missing get default values (a function that does + nothing, an empty array, and the window object, respectively). + + .. describe:: "string" + + This specifies a callback where the string is executed via an + ``eval()`` statement. The code is run in the global context, + so any variables or functions created by the string become + part of the global namespace. The return value is the value of + the last statement executed in the string. + + +Executing a Callback Object +=========================== + +The `Callback` object is itself a function, and calling that function +executes the callback. You can pass the callback additional +parameters, just as you can any function, and these will be added to +the callback function's argument list following any data that was +supplied at the time the callback was created. For example + +.. code-block:: javascript + + var f = function (x,y) {return x + " and " +y} + var cb = MathJax.Callback([f, "foo"]); + var result = cb("bar"); // sets result to "foo and bar" + +Usually, the callback is not executed by the code that creates it (as +it is in the example above), but by some other code that runs at a +later time at the completion of some other activity (say the loading +of a file), or in response to a user action. For example: + +.. code-block:: javascript + + function f(x) {alert("x contains "+x)}; + function DelayedX(time) { + var x = "hi"; + setTimeout(MathJax.Callback([f, x], time); + } + +The ``DelayedX`` function arranges for the function ``f`` to be called at +a later time, passing it the value of a local variable, ``x``. Normally, +this would require the use of a closure, but that is not needed when a +`MathJax.Callback` object is used. + + +Callback Object Properties +-------------------------- + +.. describe:: hook + + The function to be called when the callback is executed. + +.. describe:: data + + An array containing the arguments to pass to the callback + function when it is executed. + +.. describe:: object + + The object to use as `this` during the call to the callback + function. + +.. describe:: called + + Set to ``true`` after the callback has been called, and undefined + otherwise. A callback will not be exectued a second time unless + the callback's :meth:`reset()` method is called first, or its + ``autoReset`` property is set to ``true``. + +.. describe:: autoReset + + Set this to ``true`` if you want to be able to call the callback + more than once. (This is the case for signal listeners, for example). + +.. describe:: isCallback + + Always set to ``true`` (used to detect if an object is a callback + or not). + + +Callback Object Methods +----------------------- + +.. method:: reset() + + Clears the callback's `called` property. + + +MathJax.Callback Methods +------------------------ + +.. method:: Delay(time[, callback]) + + Waits for the specified time (given in milliseconds) and then + performs the callback. It returns the Callback object (or a blank + one if none was supplied). The returned callback structure has a + `timeout` property set to the result of the ``setTimeout()`` call + that was used to perform the wait so that you can cancel the wait, + if needed. Thus :meth:`MathJax.Callback.Delay()` can be used to + start a timeout delay that executes the callback if an action + doesn't occur within the given time (and if the action does occur, + the timeout can be canceled). Since + :meth:`MathJax.Callback.Delay()` returns a callback structure, it + can be used in a callback queue to insert a delay between queued + commands. + + :Parameters: + - **time** --- the amount of time to wait + - **callback** --- the callback specification + :Returns: the callback object + +.. method:: executeHooks(hooks[, data[,reset]]) + + Calls each callback in the `hooks` array (or the single hook if it + is not an array), passing it the arguments stored in the data + array. It `reset` is ``true``, then the callback's + :meth:`reset()` method will be called before each hook is + executed. If any of the hooks returns a `Callback` object, then + it collects those callbacks and returns a new callback that will + execute when all the ones returned by the hooks have been + completed. Otherwise, :meth:`MathJax.Callback.executeHooks()` + returns ``null``. + + :Parameters: + - **hooks** --- array of hooks to be called, or a hook + - **data** --- array of arguments to pass to each hook in turn + - **reset** --- ``true`` if the :meth:`reset()` method should be called + :Returns: callback that waits for all the hooks to complete, or ``null`` + +.. method:: Queue([callback,...]) + + Creates a `MathJax.CallBack.Queue` object and pushes the given + callbacks into the queue. See :ref:`Using Queues ` + for more details about MathJax queues. + + :Parameters: + - **callback** --- one or more callback specifications + :Returns: the `Queue` object + +.. method:: Signal(name) + + Looks for a named signal, creates it if it doesn't already exist, + and returns the signal object. See + :ref:`Using Signals ` for more details. + + :Parameters: + - **name** --- name of the signal to get or create + :Returns: the `Signal` object diff --git a/mathjax/docs/build/_sources/api/elementjax.txt b/mathjax/docs/build/_sources/api/elementjax.txt new file mode 100644 index 000000000..8ef996273 --- /dev/null +++ b/mathjax/docs/build/_sources/api/elementjax.txt @@ -0,0 +1,122 @@ +.. _api-element-jax: + +**************************** +The MathJax.ElementJax Class +**************************** + +The element jax is the bridge between the input and output jax, and +contains the data produced by the input jax needed by the output jax +to display the results. It is tied to the individual `` + +where ``path-to-MathJax`` is replaced by the URL of the MathJax +directory on your server, or (if you are using MathJax locally rather +than through a server) the location of that directory on your hard +disk. For example, if the MathJax directory is at the top level of +your web server's directory hierarchy, you might use + +.. code-block:: html + + + +to load MathJax. + +Although it is possible to load MathJax from a site other than your +own web server, there are issues involved in doing so that you need to +take into consideration. See the :ref:`Notes About Shared Servers +` for more details. Please do **not** link to +the copy of MathJax at ``www.mathjax.org``, as we do not have the +resources to act as a web service for all the sites on the web that +would like to display mathematics. If you are able to run MathJax +from your own server, please do so (this will probably give you better +response time in any case). + +It is best to load MathJax in the document's ```` block, but it +is also possible to load MathJax into the ```` section, if +needed. If you do this, load it as earlier early as possible, as +MathJax will begin to load its components as soon as it is included in +the page, and that will help speed up the processing of the +mathematics on your page. MathJax does expect there to be a +```` section to the document, however, so be sure there is one +if you are loading MathJax in the ````. + +It is also possible to load MathJax dynamically after the page has +been prepared, for example, via a `GreaseMonkey +`_ script, or using a specially prepared +`bookmarklet `_. This is an +advanced topic, however; see :ref:`Loading MathJax Dynamically +` for more details. + + +Configuring MathJax +=================== + +There are several ways to configure MathJax, but the easiest is to use +the ``config/MathJax.js`` file that comes with MathJax. See the +comments in that file, or the :ref:`configuration details +` section, for explanations of the meanings of the various +configuration options. You can edit the ``config/MathJax.js`` file to +change any of the settings that you want to customize. When you +include MathJax in your page via + +.. code-block:: html + + + +it will load ``config/MathJax.js`` automatically as one of its +first actions. + +Alternatively, you can configure MathJax efficiently by calling +:meth:`MathJax.Hub.Config()` when you include MathJax in your page, as +follows: + +.. code-block:: html + + + +This example includes the ``tex2jax`` preprocessor and configures it +to use both the standard TeX and LaTeX math delimiters. It uses the +TeX input processor and the HTML-CSS output processor, and forces the +HTML-CSS processor to use the TeX fonts rather that other locally +installed fonts (e.g., :term:`STIX` fonts). See the +:ref:`configuration options ` section (or the comments +in the ``config/MathJax.js`` file) for more information about the +configuration options that you can include in the +:meth:`MathJax.Hub.Config()` call. Note that if you configure MathJax +using this in-line approach, the ``config/MathJax.js`` file is **not** +loaded. + +Finally, if you would like to use several different configuration +files (like ``config/MathJax.js``, but with different settings in each +one), you can copy ``config/MathJax.js`` to ``config/MathJax-2.js``, +or some other convenient name, and use + +.. code-block:: html + + + +to load the alternative configuration file ``config/MathJax-2.js`` +from the MathJax ``config`` directory. In this way, you can have as +many distinct configuration files as you need. + + +.. _common-configurations: + +Common Configurations +===================== + +The following examples show configurations that are useful for some +common situations. This is certainly not an exhaustive list, and +there are variations possible for any of them. Again, the comments in +the ``config/MathJax.js`` file can help you decide what settings to +include, even if you are using the in-line configuration method. + +The TeX setup +------------- + +This example calls the ``tex2jax`` preprocessor to identify +mathematics in the page by looking for TeX and LaTeX math delimiters. +It uses ``$...$`` and ``\(...\)`` for in-line mathematics, while +``$$...$$`` and ``\[...\]`` mark displayed equations. Because dollar +signs are used to mark mathematics, if you want to produce an actual +dollar sign in your document, you must "escape" it using a slash: +``\$``. This configuration also loads the ``AMSmath`` and +``AMSsymbols`` extensions so that the macros and environments they +provide are defined for use on the page. + +.. code-block:: javascript + + MathJax.Hub.config({ + extensions: ["tex2jax.js","TeX/AMSmath.js","TeX/AMSsymbols.js"], + jax: ["input/TeX","output/HTML-CSS"], + tex2jax: { + inlineMath: [['$','$'],["\\(","\\)"]], + processEscapes: true, + }, + }); + +Other extensions that you may consider adding to the `extensions` +array include: ``TeX/noErrors.js``, which shows the original TeX code +if an error occurs while processing the mathematics (rather than an +error message), ``TeX/noUndefined.js``, which shows undefined +macros names in red (rather than producing an error), and +``TeX/autobold.js``, which automatically inserts ``\boldsymbol{...}`` +around your mathematics when it appears in a section of your page that +is in bold. Most of the other TeX extensions are loaded automatically +when needed, and so do not need to be included explicitly in your +`extensions` array. + +See the :ref:`tex2jax configuration ` section for +other configuration options for the ``tex2jax`` preprocessor, and the +:ref:`TeX input jax configuration ` section for options +that control the TeX input processor. + + +The MathML setup +---------------- + +This example calls the ``mml2jax`` preprocessor to identify +mathematics in the page that is in :term:`MathML` format, which uses +```` to indicate displayed equations, and +```` or simply ```` to mark in-line +formulas. + +.. code-block:: javascript + + MathJax.Hub.config({ + extensions: ["mml2jax.js"], + jax: ["input/MathML","output/HTML-CSS"] + }); + +Note that this will work in HTML files, not just XHTML files (MathJax +works with both), and that the web page need not be served with any +special MIME-type. Also note that, unless you are using XHTML rather +than HTML, you should not include a namespace prefix for your +```` tags; for example, you should not use ```` except +in a file where you have tied the ``m`` namespace to the MathML DTD. + +See the :ref:`mml2jax configuration ` section for +other configuration options for the ``mml2jax`` preprocessor, and the +:ref:`MathML input jax configuration ` section for +options that control the MathML input processor. + + +Both TeX and MathML +------------------- + +This example provides for both TeX and MathML input in the same file. +It calls on both the ``tex2jax`` and ``mml2jax`` preprocessors and the +TeX and MathML input jax to do the job. + +.. code-block:: javascript + + MathJax.Hub.config({ + extensions: ["tex2jax.js", "mml2jax.js"], + jax: ["input/TeX", "input/MathML", "output/HTML-CSS"], + }); + +Notice that no ``tex2jax`` configuration section is included, so it +uses its default options (no single dollar signs for in-line math). + +The majority of the code for the TeX and MathML input processors are +not loaded until they are actually needed by the mathematics on the +page, so if this configuration is used on a page that include only +MathML, the TeX input processor will not be loaded. Thus it is +reasonably efficient to specify both input processors even if only one +(or neither one) is used. + + +TeX input with MathML output +---------------------------- + +This example configures MathJax to use the ``tex2jax`` preprocessor +and TeX input processor, but the choice of output format is determined +by MathJax depending on the capabilities of the users's browser. The +is performed by the ``MMLorHTML.js`` configuration file that is loaded +in the `config`` array. + +.. code-block:: javascript + + MathJax.Hub.Config({ + config: ["MMLorHTML.js"], + extensions: ["tex2jax.js"], + jax: ["input/TeX"] + }); + +With this setup, Firefox or Internet Explorer with the `MathPlayer +plugin `_ installed +will use the NativeMML output processor, while all other browsers will +use the HTML-CSS output processor. Since native MathML support is +faster than MathJax's HTML-CSS processor, this will mean that the web +pages will display faster for Firefox and IE than they woudl +otherwise. This speed comes at the cost, however, as you are now +relying on the native MathML support to render the mathematics, and +that is outside of MathJax's control. There may be spacing or other +display differences (compared to MathJax's HTML-CSS output) when the +NativeMML output processor is used. + +See :ref:`MathJax Output Formats ` for more +information on the NativeMML and HTML-CSS output processors. See the +:ref:`MMLorHTML configuration ` section for +details on the options that control the ``MMLorHTML`` configuration. + + +MathML input and output in all browsers +--------------------------------------- + +This example configures MathJax to look for MathML within your page, +and to display it using the browser's native MathML support, if +possible, or its HTML-CSS output if not. + +.. code-block:: javascript + + MathJax.Hub.Config({ + config: ["MMLorHTML.js"], + extensions: ["mml2jax.js"], + jax: ["input/MathML"] + }); + +Using this configuration, MathJax finally makes MathML available in +all modern browsers. + +See the :ref:`MMLorHTML configuration ` section +for details on the options that control the ``MMLorHTML`` +configuration file, the :ref:`MathML configuration ` +section for the options that control the MathML output processor, and +the :ref:`mml2jax configuration ` section for the +options that control the ``mml2jax`` preprocessor. + + +.. _configuration: + +Configuration Objects +===================== + +The various components of MathJax, including its input and output +processors, its preprocessors, its extensions, and the MathJax core, +all can be configured through the ``config/MathJax.js`` file, or via a +:meth:`MathJax.Hub.Config()` call (indeed, if you look closely, you +will see that ``config/MathJax.js`` is itself one big call to +:meth:`MathJax.Hub.Config()`). Anything that is in +``config/MathJax.js`` can be included in-line to configure MathJax. + +The structure that you pass to :meth:`MathJax.Hub.Config()` is a +JavaScript object that includes name-value pairs giving the names of +parameters and their values, with pairs separated by commas. Be +careful not to include a comma after the last value, however, as some +browsers (namely Internet Explorer) will fail to process the +configuration if you do. + +The MathJax components, like the TeX input processor, have their own +sections in the configuration object, labeled by the component name, +and using an configuration object as its value. The object is itself +a configuration object made up of name-value pairs that give the +configuration options for the component. + +For example, + +.. code-block:: javascript + + MathJax.Hub.Config({ + showProcessingMessages: false, + jax: ["input/TeX", "output/HTML-CSS"], + TeX: { + TagSide: "left", + Macros: { + RR: '{\\bf R}', + bold: ['{\\bf #1}',1] + } + } + }); + +is a configration that includes two settings for the MathJax Hub (one +for `showProcessingMessages` and one of the `jax` array), and a +configuration object for the TeX input processor. The latter includes +a setting for the TeX input processor's `TagSide` option (to set tags +on the left rather than the right) and a setting for `Macros`, which +defines new TeX macros (in this case, two macros, one called ``\RR`` +that produces a bold "R", and one called ``\bold`` that puts is +argument in bold face). + +The ``config/MathJax.js`` file is another example that shows nearly +all the configuration options for all of MathJax's components. + + +Configuration Options by Component +================================== + +The individual options are explained in the following sections, which +are categorized by the component they affect. + +.. toctree:: + :maxdepth: 1 + + The core options + +.. toctree:: + :maxdepth: 1 + + The tex2jax preprocessor options + The mml2jax preprocessor options + The jsMath2jax preprocessor options + +.. toctree:: + :maxdepth: 1 + + The TeX input processor options + The MathML input processor options + The HTML-CSS output processor options + The NativeMML output processor options + The MMLorHTML configuration options + +.. toctree:: + :maxdepth: 1 + + The MathMenu options + The MathZoom options + The FontWarnings options + + diff --git a/mathjax/docs/build/_sources/dynamic.txt b/mathjax/docs/build/_sources/dynamic.txt new file mode 100644 index 000000000..ef386435d --- /dev/null +++ b/mathjax/docs/build/_sources/dynamic.txt @@ -0,0 +1,181 @@ +.. _ajax-mathjax: + +*************************** +Loading MathJax Dynamically +*************************** + +MathJax is designed to be included via a ```` section of your HTML document, and it does rely on being +part of the original document in that it uses an ``onload`` event +handler to synchronize its actions with the loading of the page. +If you wish to insert MathJax into a document after it has +been loaded, that will normally occur *after* the page's ``onload`` +handler has fired, and so MathJax will not be able to tell if it is +safe for it to process the contents of the page. Indeed, it will wait +forever for its ``onload`` handler to fire, and so will never process +the page. + +To solve this problem, you will need to call MathJax's ``onload`` +handler yourself, to let it know that it is OK to typeset the +mathematics on the page. You accomplish this by calling the +:meth:`MathJax.Hub.Startup.onload()` method as part of your MathJax +startup script. To do this, you will need to give MathJax an in-line +configuration, so you will not be able to use the +``config/MathJax.js`` file (though you can add it to your in-line +configuration's `config` array). + +Here is an example of how to load and configure MathJax dynamically: + +.. code-block:: javascript + + (function () { + var script = document.createElement("script"); + script.type = "text/javascript"; + script.src = "/MathJax/MathJax.js"; // use the location of your MathJax + + var config = 'MathJax.Hub.Config({' + + 'extensions: ["tex2jax.js"],' + + 'jax: ["input/TeX","output/HTML-CSS"]' + + '});' + + 'MathJax.Hub.Startup.onload();'; + + if (window.opera) {script.innerHTML = config} + else {script.text = config} + + document.getElementsByTagName("head")[0].appendChild(script); + })(); + +Be sure to set the ``src`` to the correct URL for your copy of +MathJax. You can adjust the ``config`` variable to your needs, but be +careful to get the commas right. The ``window.opera`` test is because +Opera doesn't handle setting ``script.text`` properly, while Internet +Explorer doesn't handle setting the ``innerHTML`` of a script tag. + +Here is a version that uses the ``config/MathJax.js`` file to +configure MathJax: + +.. code-block:: javascript + + (function () { + var script = document.createElement("script"); + script.type = "text/javascript"; + script.src = "/MathJax/MathJax.js"; // use the location of your MathJax + + var config = 'MathJax.Hub.Config({ config: "MathJax.js" }); ' + + 'MathJax.Hub.Startup.onload();'; + + if (window.opera) {script.innerHTML = config} + else {script.text = config} + + document.getElementsByTagName("head")[0].appendChild(script); + })(); + +Note that the **only** reliable way to configure MathJax is to use an +in-line configuration of the type discussed above. You should **not** +call :meth:`MathJax.Hub.Config()` directly in your code, as it will +not run at the correct time --- it will either run too soon, in which +case ``MathJax`` may not be defined and the function will throw an +error, or it will run too late, after MathJax has already finished its +configuration process, so your changes will not have the desired +effect. + + +MathJax and GreaseMonkey +======================== + +You can use techniques like the ones discussed above to good effect in +GreaseMonkey scripts. There are GreaseMonkey work-alikes for all the +major browsers: + +- Firefox: `GreaseMonkey `_ +- Safari: `GreaseKit `_ (also requires `SIMBL `_) +- Opera: Built-in (`instructions `_) +- Internet Explorer: `IEPro7 `_ +- Chrome: Built-in for recent releases + +Note, however, that most browsers don't allow you to insert a script +that loads a ``file://`` URL into a page that comes from the web (for +security reasons). That means that you can't have your GreaseMonkey +script load a local copy of MathJax, so you have to refer to a +server-based copy. In the scripts below, you need to insert the URL +of a copy of MathJax from your own server. + +---- + +Here is a script that runs MathJax in any document that contains +MathML (whether its includes MathJax or not). That allows +browsers that don't have native MathML support to view any web pages +with MathML, even if they say it only works in Forefox and +IE+MathPlayer. + +.. code-block:: javascript + + // ==UserScript== + // @name MathJax MathML + // @namespace http://www.mathjax.org/ + // @description Insert MathJax into pages containing MathML + // @include * + // ==/UserScript== + + if ((window.unsafeWindow == null ? window : unsafeWindow).MathJax == null) { + if ((document.getElementsByTagName("math").length > 0) || + (document.getElementsByTagNameNS == null ? false : + (document.getElementsByTagNameNS("http://www.w3.org/1998/Math/MathML","math").length > 0))) { + var script = document.createElement("script"); + script.src = "http://www.yoursite.edu/MathJax/MathJax.js"; // put your URL here + var config = 'MathJax.Hub.Config({' + + 'extensions:["mml2jax.js"],' + + 'jax:["input/MathML","output/HTML-CSS"]' + + '});' + + 'MathJax.Hub.Startup.onload()'; + if (window.opera) {script.innerHTML = config} else {script.text = config} + document.getElementsByTagName("head")[0].appendChild(script); + } + } + +**Source**: `mathjax_mathml.user.js <_statis/mathjax_mathml.user.js>`_ + +---- + +Here is a script that runs MathJax in Wikipedia pages after first +converting the math images to their original TeX code. + +.. code-block:: javascript + + // ==UserScript== + // @name MathJax in Wikipedia + // @namespace http://www.mathjax.org/ + // @description Insert MathJax into Wikipedia pages + // @include http://en.wikipedia.org/wiki/* + // ==/UserScript== + + if ((window.unsafeWindow == null ? window : unsafeWindow).MathJax == null) { + // + // Replace the images with MathJax scripts of type math/tex + // + var images = document.getElementsByTagName('img'); + for (var i = images.length - 1; i >= 0; i--) { + var img = images[i]; + if (img.className === "tex") { + var script = document.createElement("script"); script.type = "math/tex"; + if (window.opera) {script.innerHTML = img.alt} else {script.text = img.alt} + img.parentNode.replaceChild(script,img); + } + } + // + // Load MathJax and have it process the page + // + var script = document.createElement("script"); + script.src = "http://www.yoursite.edu/MathJax/MathJax.js"; // put your URL here + var config = 'MathJax.Hub.Config({' + + 'config: ["MMLorHTML.js"],' + + 'extensions:["TeX/noErrors.js","TeX/noUndefined.js",' + + '"TeX/AMSmath.js","TeX/AMSsymbols.js"],' + + 'jax:["input/TeX"]' + + '});' + + 'MathJax.Hub.Startup.onload()'; + if (window.opera) {script.innerHTML = config} else {script.text = config} + document.getElementsByTagName("head")[0].appendChild(script); + } + +**Source**: `mathjax_wikipedia.user.js <_statis/mathjax_wikipedia.user.js>`_ diff --git a/mathjax/docs/build/_sources/glossary.txt b/mathjax/docs/build/_sources/glossary.txt new file mode 100644 index 000000000..9f6772d26 --- /dev/null +++ b/mathjax/docs/build/_sources/glossary.txt @@ -0,0 +1,75 @@ +.. _glossary: + +******** +Glossary +******** + +.. if you add new entries, keep the alphabetical sorting! + +.. glossary:: + + Callback + A JavaScript function that is used to perform actions that + must wait for other actions to complete before they are + performed. + + Callback Queue + MathJax uses `Queues` to synchronize its activity so that + actions that operate asynchronously (like loading files) will + be performed in the right order. :term:`Callback` functions + are pushed onto the queue, and are performed in order, with + MathJax handling the synchronization if operations need to + wait for other actions to finish. + + Callback Signal + A JavaScript object that acts as a mailbox for MathJax events. + Like an event handler, but it also keeps a history of + messages. Your code can register an "interest" in a signal, + or can register a :term:`callback` to be called when a + particular message is sent along the signal channel. + + HTML-CSS + MathJax output form that employs only on HTML and CSS 2.1, + allowing MathJax to remain compatible across all browsers. + + jax + MathJax's input and output processors are called "jax", as is + its internal format manager. The code for the jax are in the + ``MathJax/jax`` directory. + + LaTeX + Build on the :term:`TeX` language + + .. seealso:: + + `LaTeX Wikipedia entry `_ + + MathML + An XML specification created to describe mathematical + notations and capture both its structure and content. MathML + is much more verbose than :term:`TeX`, but is much more + machine-readable. + + .. seealso:: + + `MathML Wikipedia entry `_ + + STIX + The Scientific and Technical Information Exchange font + package. A comprehensive set of scientific glyphs. + + .. seealso:: + + `STIX project `_ + + TeX + A document markup language with robust math markup commands + developed by Donald Knuth in the late 1970's, but still in + extensive use today. It became the industry standard for + typesetting of mathematics, and is one of the most common + formats for mathematical journals, articles, and books. + + .. seealso:: + + `TeX Wikipedia entry `_ + diff --git a/mathjax/docs/build/_sources/index.txt b/mathjax/docs/build/_sources/index.txt new file mode 100644 index 000000000..b44893d46 --- /dev/null +++ b/mathjax/docs/build/_sources/index.txt @@ -0,0 +1,70 @@ +##################### +MathJax Documentation +##################### + +MathJax is an open-source JavaScript display engine for LaTeX and +MathML that works in all modern browsers. + +Basic Usage +=========== + +.. toctree:: + :maxdepth: 1 + + What is MathJax? + Getting Started with MathJax + Installing and Testing MathJax + Loading and Configuring MathJax + Using MathJax in Web Platforms + +.. toctree:: + :maxdepth: 1 + + MathJax TeX and LaTeX Support + MathJax MathML Support + MathJax Output Formats + +.. toctree:: + :maxdepth: 1 + + "Powered by MathJax" + The MathJax Community + + +Advanced Topics +=============== + +.. toctree:: + :maxdepth: 1 + + The MathJax Processing Model + The MathJax Startup Sequence + Synchronizing Your Code with MathJax + Loading MathJax Dynamically + Modifying Math on the Page + +.. toctree:: + :maxdepth: 1 + + Details of the MathJax API + +.. toctree:: + :maxdepth: 1 + + Converting to MathJax from jsMath + +Reference Pages +=============== + +.. toctree:: + :maxdepth: 1 + + HTML snippets + CSS style objects + Glossary + +* :ref:`search` + +-------- + +This version of the documentation was built |today|. diff --git a/mathjax/docs/build/_sources/installation.txt b/mathjax/docs/build/_sources/installation.txt new file mode 100644 index 000000000..5eb3b2524 --- /dev/null +++ b/mathjax/docs/build/_sources/installation.txt @@ -0,0 +1,215 @@ +.. _installation: + +****************************** +Installing and Testing 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 and its font package. There are +two main ways to do this: via ``svn`` or via a pre-packaged archive. +We recommend the former, as it is easier to keep your installation up +to date using ``svn``. + + +.. _getting-mathjax-svn: + +Obtaining MathJax via SVN +========================= + +The easiest way to get MathJax and keep it up to date is to use the +`subversion `_ source control system, +``svn``. Use the commands + +.. code-block:: sh + + svn co https://mathjax.svn.sourceforge.net/svnroot/trunk/mathjax mathjax + cd mathjax + unzip fonts.zip + +to obtain and set up a copy of MathJax. (The `SourceForge development +page `_ also shows +how to do this.) + +Whenever you want to update MathJax, you can now use + +.. code-block:: sh + + cd mathjax + svn status + +to check if there are updates to MathJax. If MathJax needs updating, +use + +.. code-block:: sh + + cd mathjax + svn update + # if fonts.zip is updated, do the following as well: + rm -rf fonts + unzip fonts.zip + +to udpate your copy of MathJax to the current release version. If the +``fonts.zip`` file has been updated, you will need to remove the old +fonts directory and unpack the new one bring your installation up to +date. 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 +"bleeding-edge" version that contains all the latest changes to +MathJax. At times, however, these 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), use + +.. code-block:: sh + + svn co + https://mathjax.svn.sourcesforge.net/svnroot/tags/mathjax-1.0 mathajx + cd mathjax + unzip fonts.zip + +to obtain the version 1.0 release. When you wish to update to a new +release, you will need to check out a new copy of MathJax with the new +release number. + + +.. _getting-mathjax-zip: + +Obtaining MathJax via an archive +================================ + +Release versions of MathJax are available in archive files from the +`MathJax download page `_ or the +`SourceForge files page +`_, where you can +download the archives that you need. + +You should download **either** + +- the ``MathJax-complete-v1.0.zip`` file, **or** +- both ``MathJax-v1.0.zip`` and ``MathJax-webfonts-v1.0.zip``. + +You do not need to get all three, as the first is a combination of the +other two. (The code and fonts are in separate archives because the +web fonts are not likely to change often, while the MathJax code will +be updated regularly). + +If you obtained the "complete" archive, simply unzip it. If you +obtained the two separate archives, unzip ``MathJax-v1.0.zip`` which +should create a ``MathJax/`` directory. Then unzip +``MathJax-webfonts-v1.0.zip`` inside the MathJax directory. Commands +to do this might look like + +.. code-block:: sh + + unzip MathJax-v1.0.zip + cd MathJax + unzip ../MathJax-webfonts-v1.0.zip + +You should end up with a ``MathJax`` directory containing a ``fonts`` +folder along with ``config``, ``extensions``, ``MathJax.js`` and other +files and folders. The ``MathJax/fonts`` folder should contain an +``HTML-CSS`` folder and nothing else. If you end up with +``MathJax/MathJax/fonts`` or ``MathJax/MathJax-webfonts-v1.0/fonts`` +or something similar, then you need to move the fonts folder up one +level in the hierarchy so that it is ``MathJax/fonts``. (You can then +remove the empty ``MathJax`` or ``MathJax-webfonts-v1.0`` folder.) + +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. + + +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 + +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, that +the fonts archive has been unpacked in the correct location, 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 imporant caveat --- +Firefox'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 directory 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) and will time out after about 15 +seconds for each font it tries to access. Typically that is three or +four fonts, so your Foirefox users will experience a minute or so +delay before mathematics is displayed, and then it will probably +display incorrectly because the browser doesn't have access to the +correct fonts. + +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/HTML-CSS/TeX/otf`` 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 graphic 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 Forefox 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. + + diff --git a/mathjax/docs/build/_sources/jsMath.txt b/mathjax/docs/build/_sources/jsMath.txt new file mode 100644 index 000000000..3f40febab --- /dev/null +++ b/mathjax/docs/build/_sources/jsMath.txt @@ -0,0 +1,31 @@ +.. _jsMath-support: + +********************************* +Converting to MathJax from jsMath +********************************* + +MathJax is the successor to the popular `jsMath +`_ package for rendering +mathematics in web pages. Like jsMath, MathJax works by locating and +processing the mathematics within the webpage once it has been loaded +in the browser by a user viewing your web pages. If you are using +jsMath with its ``tex2math`` preprocessor, then switching to MathJax +should be easy, and is simply a matter of configuring MathJax +appropriately. See the section on :ref:`Configuring MathJax +` for details about loading and configuring MathJax. + +On the other hand, if you are using jsMath's ``...`` and ``
...
`` tags to +mark the mathematics in your document, then you should use MathJax's +``jsMath2jax`` preprocessor when you switch to MathJax. To do this, +include ``"jsMath2jax.js"`` in the `extensions` array of your +configuration, with the `jax` array set to include ``"input/TeX"``. + +.. code-block:: javascript + + extensions: ["jsMath2jax.js"], + jax: ["input/TeX", ...] + +There are a few configuration options for ``jsMath2jax``, which you +can find in the ``config/MathJax.js`` file, or in the :ref:`jsMath +configuration options ` section. diff --git a/mathjax/docs/build/_sources/mathjax.txt b/mathjax/docs/build/_sources/mathjax.txt new file mode 100644 index 000000000..c52b7c66d --- /dev/null +++ b/mathjax/docs/build/_sources/mathjax.txt @@ -0,0 +1,36 @@ +**************** +What is MathJax? +**************** + +MathJax is an open-source JavaScript display engine for LaTeX and +MathML 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. It requires no setup on the part of +the user (no plugins to downlaod 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, or MathML, a powerful interchange format for mathematics +that has become an industry standard. 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 +past 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 configurble, 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. + diff --git a/mathjax/docs/build/_sources/mathml.txt b/mathjax/docs/build/_sources/mathml.txt new file mode 100644 index 000000000..13acda760 --- /dev/null +++ b/mathjax/docs/build/_sources/mathml.txt @@ -0,0 +1,97 @@ +.. _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` reprocessor 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, 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 the copy +the source markup, and so on, so there is added value to using MathJax +even whith a pure MathML workflow. + + +MathML in HTML pages +==================== + +For MathML that is handled via the pre-processor, you should not use +the named MathML entities, but rather use the 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 woth 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 ````, 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. + + +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``. + +- Limited support for line breaking (they are only allowed in direct + children of ``mrow`` or implied ``mrow`` elements. + +- No support for alignment groups in table. + +- No support for right-to-left rendering. + +See the `results of the MathML3.0 test suite +`_ for details. diff --git a/mathjax/docs/build/_sources/model.txt b/mathjax/docs/build/_sources/model.txt new file mode 100644 index 000000000..acc7ea240 --- /dev/null +++ b/mathjax/docs/build/_sources/model.txt @@ -0,0 +1,224 @@ +**************************** +The MathJax Processing Model +**************************** + +The purpose of MathJax is to bring the ability to include mathematics +easily in web pages to as wide a range of browsers as possible. +Authors can specify mathematics in a variety of formats (e.g., +:term:`MathML` or :term:`LaTeX`), and MathJax provides high-quality +mathematical typesetting even in those browsers that do not have +native MathML support. This all happens without the need for special +downloads or plugins, but rendering will be enhanced if high-quality +math fonts (e.g., :term:`STIX`) are available to the browser. + +MathJax is broken into several different kinds of components: page +preprocessors, input processors, output processors, and the MathJax +Hub that organizes and connects the others. The input and output +processors are called :term:`jax`, and are described in more detail +below. + +When MathJax runs, it looks through the page for special tags that +hold mathematics; for each such tag, it locates an appropriate input +jax which it uses to convert the mathematics into an internal form +(called an element jax), and then calls an output jax to transform the +internal format into HTML content that displays the mathematics within +the page. The page author configures MathJax by indicating which +input and output jax are to be used. + +Often, and especially with pages that are authored by hand, the +mathematics is not stored (initially) within the special tags needed +by MathJax, as that would require more notation than the average page +author is willing to type. Instead, it is entered in a form that is +more natural to the page author, for example, using the standard TeX +math delimiters ``$...$`` and ``$$...$$`` to indicate what part of the +document is to be typeset as mathematics. In this case, MathJax can +run a preprocessor to locate the math delimiters and replace them by +the special tags that it uses to mark the formulas. There are +preprocessors for :ref:`TeX notation `, :ref:`MathML +notation `, and the :ref:`jsMath notation +` that uses `span` and `div` tags. + +For pages that are constructed programatically, such as HTML +pages that result from running a processor on text in some other +format (e.g., pages produced from Markdown documents, or via programs +like `tex4ht`), it would be best to use MathJax's special tags +directly, as described below, rather than having MathJax run +another preprocessor. This will speed up the final display of the +mathematics, since the extra preprocessing step would not be needed, +and it also avoids the conflict between the use of the less-than sign, +``<``, in mathematics and asn an HTML special character (that starts +an HTML tag). + + +How mathematics is stored in the page +===================================== + +In order to identify mathematics in the page, MathJax uses special +``[math] + + would display "[math]" in place of the math until MathJax is able + to typeset it. + + See also the ``preJax`` and ``postJax`` comments above. + +.. describe:: showProcessingMessages: true + + This value controls whether the `Processing Math: nn%` message are + displayed in the lower left-hand corner. Set to ``false`` to + prevent those messages (though file loading and other messages + will still be shown). + +.. describe:: messageStyle: "normal" + + This value controls the verbosity of the messages in the lower + left-hand corner. Set it to ``"none"`` to eliminate all messages, + or set it to ``"simple"`` to show "Loading..." and "Processing..." + rather than showing the full file name or the percentage of the + mathematics processed. + +.. describe:: displayAlign: "center" and displayIndent: "0em" + + These two parameters control the alignment and shifting of + displayed equations. The first can be ``"left"``, ``"center"``, + or ``"right"``, and determines the alignment of displayed + equations. When the alignment is not ``"center"``, the second + determines an indentation from the left or right side for the + displayed equations. + + +.. describe:: delayStartupUntil: "none" + + Normally MathJax will perform its starup commands (loading of + configuration, styles, jax, and so on) as soon as it can. If you + expect to be doing additional configuration on the page, however, + you may want to have it wait until the page's onload hander is + called. If so, set this to ``"onload"``. + +.. describe:: skipStartupTypeset: false + + Normally MathJax will typeset the mathematics on the page as soon + as the page is loaded. If you want to delay that process, in + which case you will need to call :meth:`MathJax.Hub.Typeset()` + yourself by hand, set this value to ``true``. + +.. describe:: menuSettings: { ... } + + This block contains settings for the mathematics contextual menu + that act as the defaults for the user's settings in that menu. + The possible values are: + + .. describe:: zoom: "none" + + This indicates when typeset mathematics should be zoomed. It + can be set to ``"None"``, ``"Hover"``, ``"Click"``, or + ``"Double-Click"`` to set the zoom trigger. + + .. describe:: CTRL: false, ALT: false, CMD: false, Shift: false + + These values indicate which keys must be pressed in order for + math zoom to be triggered. For example, if ``CTRL`` is set to + ``true`` and ``zoom`` is ``"Click"``, then math will be zoomed + only when the user control-clicks on mathematics (i.e., clicks + while holding down the `CTRL` key). If more than one is + ``true``, then all the indicated keys must be pressed for the + zoom to occur. + + .. describe:: zscale: "200%" + + This is the zoom scaling factor, and it can be set to any of + the values available in the `Zoom Factor` menu of the + `Settings` submenu of the contextual menu. + + .. describe:: context: "MathJax" + + This controls what contextual menu will be presented when a + right click (on a PC) or CTRL-click (on the Mac) occurs over a + typeset equation. When set to ``"MathJax"``, the MathJax + contextual menu will appear; when set to ``"Browser"``, the + browser's contextual menu will be used. For example, in + Internet Explorer with the MathPlayer plugin, if this is set + to ``"Browser"``, you will get the MathPlayer contextual menu + rather than the MathJax menu. + + There are also settings for ``format``, ``renderer``, and ``font``, + but these are maintained by MathJax and should not be set by the + page author. + +.. describe:: errorSettings: { ... } + + This block contains settings that control how MathJax responds to + unexpected errors while processing mathematical equations. Rather + than simply crash, MathJax can report an error and go on. The + options you can set include: + + .. describe:: message: ["[Math Processing Error"]] + + This is an HTML snippet that will be inserted at the location + of the mathematics for any formula that causes MathJax to + produce an internal error (i.e., an error in the MathJax code + itself). See the :ref:`description of HTML snippets + ` for details on how to represent HTML code in + this way. + + .. describe:: style: {color:"#CC0000", "font-style":"italic"} + + This is the CSS style description to use for the error + messages produced by internal MathJax errors. See the section + on :ref:`CSS style objects ` for details on + how these are specified in JavaScript. + diff --git a/mathjax/docs/build/_sources/options/jsMath2jax.txt b/mathjax/docs/build/_sources/options/jsMath2jax.txt new file mode 100644 index 000000000..b471749ba --- /dev/null +++ b/mathjax/docs/build/_sources/options/jsMath2jax.txt @@ -0,0 +1,52 @@ +.. _configure-jsMath2jax: + +*************************** +The jsMath2jax Preprocessor +*************************** + +The options below control the operation of the `jsMath2jax` +preprocessor. They are listed with their default values. To set any +of these options, include a ``jsMath2jax`` section in your +:meth:`MathJax.Hub.Config()` call. For example + +.. code-block:: javascript + + MathJax.Hub.Config({ + jsMath2jax: { + preview: "none" + } + }); + +would set the ``preview`` parameter to ``"none"``. + + +.. describe:: element: null + + The id name of the element that should be processed by `jsMath2jax`. + The default is the whole document. + +.. describe:: preview: "TeX" + + This controls whether `jsMath2jax` inserts ``MathJax_Preview`` spans + to make a preview available, and what preview to use, when it + locates in-line or display mathematics in the page. The default + is ``"TeX"``, which means use the TeX code as the preview (which + will be visible until it is processed by MathJax). Set to + ``"none"`` to prevent previews from being inserted (the math + will simply disappear until it is typeset). Set to an array + containing the description of an HTML snippet in order to use the + same preview for all equations on the page. + + Examples: + + .. code-block:: javascript + + preview: ["[math]"], // insert the text "[math]" as the preview + + .. code-block:: javascript + + preview: [["img",{src: "/images/mypic.jpg"}]], // insert an image as the preview + + See the :ref:`description of HTML snippets ` for + details on how to represent HTML code in this way. + diff --git a/mathjax/docs/build/_sources/options/mml2jax.txt b/mathjax/docs/build/_sources/options/mml2jax.txt new file mode 100644 index 000000000..aa9dd8134 --- /dev/null +++ b/mathjax/docs/build/_sources/options/mml2jax.txt @@ -0,0 +1,52 @@ +.. _configure-mml2jax: + +************************ +The mml2jax Preprocessor +************************ + +The options below control the operation of the `mml2jax` preprocessor. +They are listed with their default values. To set any of these +options, include a ``mml2jax`` section in your +:meth:`MathJax.Hub.Config()` call. For example + +.. code-block:: javascript + + MathJax.Hub.Config({ + mml2jax: { + preview: "none" + } + }); + +would set the ``preview`` parameter to ``"none"``. + +.. describe:: element: null + + The id name of the element that should be processed by `mml2jax`. + The default is the whole document. + +.. describe:: preview: "alttext" + + This controls whether `mml2jax` inserts ``MathJax_Preview`` spans + to make a preview available, and what preview to use, when it + locates mathematics on the page. The default is ``"alttext"``, + which means use the ```` tag's ``alttext`` attribute as the + preview (visible until it is processed by MathJax), if the tag has + one. Set it to ``"none"`` to prevent the previews from being + inserted (the math will simply disappear until it is typeset). + Set it to an array containing the description of an HTML snippet + in order to use the same preview for all equations on the page. + + Examples: + + .. code-block:: javascript + + preview: ["[math]"], // insert the text "[math]" as the preview + + .. code-block:: javascript + + preview: [["img",{src: "/images/mypic.jpg"}]], // insert an image as the preview + + See the :ref:`description of HTML snippets ` for + details on how to represent HTML code in this way. + + diff --git a/mathjax/docs/build/_sources/options/tex2jax.txt b/mathjax/docs/build/_sources/options/tex2jax.txt new file mode 100644 index 000000000..3a91e0cd0 --- /dev/null +++ b/mathjax/docs/build/_sources/options/tex2jax.txt @@ -0,0 +1,136 @@ +.. _configure-tex2jax: + +************************ +The tex2jax Preprocessor +************************ + +The options below control the operation of the `tex2jax` +preprocessor. They are listed with their default values. To set any +of these options, include a ``tex2jax`` section in your +:meth:`MathJax.Hub.Config()` call. For example + +.. code-block:: javascript + + MathJax.Hub.Config({ + tex2jax: { + inlineMath: [ ['$','$'], ['\\(','\\)'] ] + } + }); + +would set the ``inlineMath`` delimiters for the `tex2jax` +preprocessor. + + +.. describe:: element: null + + The id name of the element that should be processed by `tex2jax`. + The default is the whole document. + +.. describe:: inlineMath: [['\\(','\\)']] + + Array of pairs of strings that are to be used as in-line math + delimters. The first in each pair is the initial delimiter and + the second is the terminal delimiter. You can have as many pairs + as you want. For example, + + .. code-block:: javascript + + inlineMath: [ ['$','$'], ['\\(','\\)'] ] + + would cause `tex2jax` to look for ``$...$`` and ``\(...\)`` as + delimiters for inline mathematics. (Note that the single dollar + signs are not enabled by default because they are used too + frequently in normal text, so if you want to use them for math + delimiters, you must specify them explicitly.) + + Note that the delimiters can't look like HTML tags (i.e., can't + include the less-than sign), as these would be turned into tags by + the browser before MathJax has the chance to run. You can only + include text, not tags, as your math delimiters. + +.. describe:: displayMath: [ ['$$','$$'], ['\\[','\\]'] ] + + Array of pairs of strings that are to be used as delimters for + displayed equations. The first in each pair is the initial + delimiter and the second is the terminal delimiter. You can have + as many pairs as you want. + + Note that the delimiters can't look like HTML tags (i.e., can't + include the less-than sign), as these would be turned into tags by + the browser before MathJax has the chance to run. You can only + include text, not tags, as your math delimiters. + +.. describe:: processEscapes: false + + When set to ``true``, you may use ``\$`` to represent a literal + dollar sign, rather than using it as a math delimiter. When + ``false``, ``\$`` will not be altered, and the dollar sign may be + considered part of a math delimiter. Typically this is set to + ``true`` if you enable the ``$ ... $`` in-line delimiters, so you + can type ``\$`` and `tex2jax` will convert it to a regular dollar + sign in the rendered document. + +.. describe:: processEnvironments: true + + When ``true``, `tex2jax` looks not only for the in-line and + display math delimters, but also for LaTeX environments + (``\begin{something}...\end{something}``) and marks them for + processing by MathJax. When ``false``, LaTeX environments will + not be processed outside of math mode. + +.. describe:: preview: "TeX" + + This controls whether `tex2jax` inserts ``MathJax_Preview`` spans + to make a preview available, and what preview to use, when it + locates in-line or display mathematics in the page. The default + is ``"TeX"``, which means use the TeX code as the preview (which + will be visible until it is processed by MathJax). Set to + ``"none"`` to prevent previews from being inserted (the math + will simply disappear until it is typeset). Set to an array + containing the description of an HTML snippet in order to use the + same preview for all equations on the page. + + Examples: + + .. code-block:: javascript + + preview: ["[math]"], // insert the text "[math]" as the preview + + .. code-block:: javascript + + preview: [["img",{src: "/images/mypic.jpg"}]], // insert an image as the preview + + See the :ref:`description of HTML snippets ` for + details on how to represent HTML code in this way. + +.. describe:: skipTags: ["script","noscript","style","textarea","pre","code"] + + This array lists the names of the tags whose contents should not + be processed by `tex2jax` (other than to look for ignore/process + classes as listed below). You can add to (or remove from) this + list to prevent MathJax from processing mathematics in specific + contexts. + +.. describe:: ignoreClass: "tex2jax_ignore" + + This is the class name used to mark elements whose contents should + not be processed by tex2jax (other than to look for the + ``processClass`` pattern below). Note that this is a regular + expression, and so you need to be sure to quote any `regexp` + special characters. The pattern is automatically preceeded by + ``'(^| )('`` and followed by ``')( |$)'``, so your pattern will + have to match full words in the class name. Assigning an element + this class name will prevent `tex2jax` from processing its + contents. + +.. describe:: processClass: "tex2jax_process" + + This is the class name used to mark elements whose contents + *should* be processed by `tex2jax`. This is used to turn on + processing within tags that have been marked as ignored or skipped + above. Note that this is a regular expression, and so you need to + be sure to quote any `regexp` special characters. The pattern is + automatically preceeded by ``'(^| )('`` and followed by ``')( + |$)'``, so your pattern will have to match full words in the class + name. Use this to restart processing within an element that has + been marked as ignored above. diff --git a/mathjax/docs/build/_sources/output.txt b/mathjax/docs/build/_sources/output.txt new file mode 100644 index 000000000..30e7b20a3 --- /dev/null +++ b/mathjax/docs/build/_sources/output.txt @@ -0,0 +1,126 @@ +.. _output-formats: + +********************** +MathJax Output Formats +********************** + +Currently, MathJax can render math in two ways: + +- Using HTML-with-CSS to lay out the mathematics, or +- Using a browser's native MathML support. + +These are implemented by the `HTML-CSS` and `NativeMML` output +processors. You select which one you want to use by including either +``"output/HTML-CSS"`` 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. It's major +advantage is its quality and consistency; it's drawback is that it is +slower that the NativeMML mode at rendering the mathematics. (The +HTML-CSS processor has not yet been optimized for speed, so you can +expect some improvement in the future. Note that IE8 in "IE8 +standards mode" is an order of magnitude slower than any other browser +when processing math through the HTML-CSS output processor; see +:ref:`HTML-CSS with IE8 ` below for some strategies +to deal with this.) + +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, +Chrome, Konqueror, and most other browsers don't support MathML +natively. + +The advantage of the NativeMML output Processor is its speed, since +native MathML support is much faster than using complicated HTML and +CSS to lay out mathematics via an interpreted language like JavaScript +(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 may rely on features that are not available +in some renderers (for example, Firefox's MathML support does not +implement some of the named widths, such as +``negativethinmathspace``). 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 there is a special configuration file that will choose between +NativeMML and HTML-CSS depending on the browser in use. To invoke it, +add ``"MMLorHTML.js"`` to your configurations `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"] + +You can customize which choice to make on a browser-by-browser basis +or a global basis. See the ``config/MathJax.js`` file or the +:ref:`Configuring MathJax ` section for futher +details. + +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. Note, however, that a user can employ the MathJax +contectual menu to select the other other renderer if he or she +wishes. + + +.. _html-css-with-ie8: + +HTML-CSS with IE8 +================= + +Internet Explorer 8 has at least eight different rendering modes in +which can operate, and that are triggered by the `DOCTYPE` of the +document being viewed. It's "quirks" mode is its fasted mode, and its +"IE8 standards" mode is its slowest. This is the mode triggered by +strict HTML document types, and since most modern content management +systems now include a `DOCTYPE` that activates "standards" mode, IE8 +will operate in its slowest manner. This is particularly apparent +when MathJax is used, since IE8 in standards mode runs 20 to 30 times +slower than its does in its IE7 emulation mode, and 60 times slower +than in quirks mode. + +Most users find this speed reduction unacceptable when there is much +mathematics on the page. To overcome this problem, you may wish to +tell IE8 to use its IE7 emulation mode rather than its IE8 standards +mode. You can accomplish this by including the line + +.. code-block:: html + + + +at the top of the ```` section of your HTML documents. This +lets you keep the strict `DOCTYPE` for validation purposes, while +still managing to get reasonable perforance from Internext Explorer +8. Note that this line must come at the beginning of the ````, +before any stylesheets or other content are loaded. + +Altertnatively, you can use the `MMLorHTML` configuration file +described above to select NativeMML output when possible, and request +that your users install the `MathPlayer plugin +`_, which will render +the mathematics much more quickly. diff --git a/mathjax/docs/build/_sources/platforms/index.txt b/mathjax/docs/build/_sources/platforms/index.txt new file mode 100644 index 000000000..2349c3d85 --- /dev/null +++ b/mathjax/docs/build/_sources/platforms/index.txt @@ -0,0 +1,65 @@ +.. _platforms: + +====================================== +Using MathJax in popular web platforms +====================================== + +Most web-based content-management systems include a theme or template +layer that determines how the pages look, and that loads information +common to all pages. Such theme files provide one popular way to +include MathJax in your web templates in the absense of +MathJax-specific plugins for the system you are using. To take +advantage of this approach, you will need access to your theme files, +which probably means you need to be an administrator for the site; if +you are not, you may need to have an administrator do these steps for +you. + +To enable MathJax in your web platform, add the line:: + + + +(where ``path-to-MathJax`` is the web-address of the main MathJax +directory for your server) either just before the ```` tag in +your theme file, or at the end of the file if it contains no +````. + +The theme files for various popular platforms are: + + `WordPress `_ + ``wp-content/themes/[current_theme]/header.php`` + + `Movable Type `_ + ``[current_theme_templates]/html_head.mhtml`` + + `Drupal `_ + ``themes/[current_theme]/page.tpl.php`` + + `Joomla `_ + ``templates/[current_theme]/index.php`` + + `MediaWiki `_ + ``skins/[current_skin].php`` + + `TiddlyWiki `_ + ``*.php`` (Whatever you call your TiddlyWiki php file) + + `Moodle `_ + ``theme/[current_theme]/header.html`` + +Keep in mind that this will enable MathJax for your current +theme/template only. If you change themes or update your theme, you +will have to repeat these steps. + + +Insructions for Specific Platforms +================================== + +Some programs, such as WordPress and Moveable Type, allow you to edit +template files from inside their administrator interfaces. Specific +instructions for these are given via the links below. + +.. toctree:: + :maxdepth: 1 + + Wordpress + Movable Type diff --git a/mathjax/docs/build/_sources/platforms/movable-type.txt b/mathjax/docs/build/_sources/platforms/movable-type.txt new file mode 100644 index 000000000..86ae2dba5 --- /dev/null +++ b/mathjax/docs/build/_sources/platforms/movable-type.txt @@ -0,0 +1,41 @@ +.. _platform-movable-type: + +========================== +Using MathJax in WordPress +========================== + +These instructions assume you already have placed the MathJax files on +your server (see :ref:`Installing and Testing MathJax `). + +1. Open Moveable Type Admin interface for the site on which you want to enable + MathJax. + +2. In the dashboard menu on the left, open up the Design menu. This + should show you the templates you are currently using on the site. + + .. image:: ../images/mt_menu.png + + +3. Scroll down to the Template Modules section in the template list + and open the `HTML Head` template. + + .. image:: ../images/mt_templates.png + +4. At the end of the file, insert + + .. code-block:: html + + + + where ``path-to-MathJax`` is replaced by the web-address of the + main MathJax dorectory on your server. + + .. image:: ../images/mt_head.png + +5. Save the file. This should enable MathJax, so you should be able + to start adding mathematical content to your pages. Use the + ``config/MathJas.js`` file in the MathJax directory to configure + MathJax to your needs (see :ref:`Configuring MathJax + ` for details). + + diff --git a/mathjax/docs/build/_sources/platforms/wordpress.txt b/mathjax/docs/build/_sources/platforms/wordpress.txt new file mode 100644 index 000000000..efe1063eb --- /dev/null +++ b/mathjax/docs/build/_sources/platforms/wordpress.txt @@ -0,0 +1,42 @@ +.. _platform-wordpress: + +=============================== +Installing MathJax in WordPress +=============================== + +These instructions assume you already have placed the MathJax files on +your server (see :ref:`Installing MathJax `). + +1. Open the WordPress admin interface. + +2. In the administration menu on the left, open up the `Appearance` + menu and click on the `Editor` submenu option. + + .. image:: ../images/wp_menu.png + + When you click on the editor option, WordPress should open up the + first stylesheet in the current theme. + +3. In the template list on the right side of the page, click on the + header file (it should be ``header.php``). + + .. image:: ../images/wp_templates.png + + This part depends slightly on how your current theme is written. + In the ``header.php`` file, look for the end-of-head tag, + ````. If you find it, insert + + .. code-block:: html + + + + just before that. Otherwise, insert the same code at the very + bottom of the file. Here, ``path-to-MathJax`` should be replaced + by the web-address of the main MathJax directory on your server, + e.g., ``src="/mathjax/MathJax.js"``. + +4. Save the file. This should enable MathJax, so you should be able to + start adding mathematical content to your pages. Use the + ``config/MathJas.js`` file in the MathJax directory to configure + MathJax to your needs (see :ref:`Configuring MathJax + ` for details). diff --git a/mathjax/docs/build/_sources/queues.txt b/mathjax/docs/build/_sources/queues.txt new file mode 100644 index 000000000..d85fa50d0 --- /dev/null +++ b/mathjax/docs/build/_sources/queues.txt @@ -0,0 +1,254 @@ +.. _using-queues: + +************ +Using Queues +************ + +The `callback queue` is one of MathJax's main tools for synchronizing +its actions, both internally, and with external programs, like +javascript code that you may write as part of dynamic web pages. +Because many actions in MathJax (like loading files) operate +asynchornously, MathJax needs a way to coordinate those actions so +that they occur in the right order. The +`MathJax.Callback.Queue` object provides that mechanism. + +A `callback queue` is a list of commands that will be performed one at +a time, in order. If the return value of one of the commands is a +`Callback` object, processing is suspended until that callback is +called, and then processing of the commands is resumed. In this way, +if a command starts an asynchronous operation like loading a file, it +can return the callback for that file-load operation and the queue +will wait until the file has loaded before continuing. Thus a queue +can be used to guarantee that commands don't get performed until other +ones are known to be finished, even if those commands usually operate +asynchronously. + + +Constructing Queues +=================== + +A queue is created via the :meth:`MathJax.Callback.Queue()` command, +which returns a `MathJax.Callback.Queue` object. The queue +itself consists of a series of commands given as callback +specifications (see :ref:`Using Callbacks ` for +details on callbacks), which allow you to provide functions (together +with their arguments) to be executed. You can provide the collection +of callback specifications when the queue is created by passing them +as arguments to :meth:`MathJax.Callback.Queue()`, or you can create an +empty queue to which commands are added later. Once a +`MathJax.Callback.Queue` object is created, you can push +additional callbacks on the end of the queue; if the queue is empty, +the command will be performed immediately, while if the queue is +waiting for another command to complete, the new command will be +queued for later processing. + +For example, + +.. code-block:: javascript + + function f(x) {alert(x)} + var queue = MathJax.Callback.Queue([f, 15], [f, 10], [f, 5]); + queue.Push([f, 0]); + +would create a queue containing three commands, each calling the +function ``f`` with a different input, that are performed in order. A +fourth command is then added to the queue, to be performed after the +other three. In this case, the result will be four alerts, the first +with the number 15, the second with 10, the third with 5 and the +fourth with 0. Of course ``f`` is not a function that operates +asynchronously, so it would have been easier to just call ``f`` four +times directly. The power of the queue comes from calling commands +that could operate asynchronously. For example: + +.. code-block:: javascript + + function f(x) {alert(x)} + MathJax.Callback.Queue( + [f, 1], + ["Require", MathJax.Ajax, "[MathJax]/extensions/AMSmath.js"], + [f, 2] + ); + +Here, the command ``MathJax.Ajax.require("extensions/AMSmath.js")`` is +queued between two calls to ``f``. The first call to ``f(1)`` will be +made immediately, then the :meth:`MathJax.Ajax.Require` statement will +be performed. Since the ``Require`` method loads a file, it operates +asynchronously, and its return value is a `MathJax.Callback` +object that will be called when the file is loaded. The call to +``f(2)`` will not be made until that callback is performed, +effectively synchronizing the second call to ``f`` with the completion +of the file loading. This is equivalent to + +.. code-block:: javascript + + f(1); + MathJax.Ajax.Require("[MathJax]/extensions/AMSmath.js", [f, 2]); + +since the ``Require()`` command allows you to specify a (single) +callback to be performed on the completion of the file load. Note, +however, that the queue could be used to synchronize several file +loads along with multiple function calls, so is more flexible. + +For example, + +.. code-block:: javascript + + MathJax.Callback.Queue( + ["Require", MathJax.Ajax, "[MathJax]/extensions/AMSmath.js"], + [f, 1], + ["Require", MathJax.Ajax, "[MathJax]/config/local/AMSmathAdditions.js"], + [f, 2] + ); + +would load the AMSmath extension, then call ``f(1)`` then load the +local AMSmath modifications, and then call ``f(2)``, with each action +waiting for the previous one to complete before being performed +itself. + + +Callbacks versus Callback Specifications +======================================== + +If one of the callback specifications is an actual callback object +itself, then the queue will wait for that action to be performed +before proceeding. For example, + +.. code-block:: javascript + + MathJax.Callback.Queue( + [f, 1], + MathJax.Ajax.Require("[MathJax]/extensions/AMSmath.js"), + [f, 2], + ); + +starts the loading of the AMSmath extension before the queue is +created, and then creates the queue containing the call to ``f``, the +callback for the file load, and the second call to ``f``. The queue +performs ``f(1)``, waits for the file load callback to be called, and +then calls ``f(2)``. The difference between this and the second +example above is that, in this example the file load is started before +the queue is even created, so the file is potentially loaded and +executed before the call to ``f(1)``, while in the example above, the +file load is guaranteed not to begin until after ``f(1)`` is executed. + +As a further example, consider + +.. code-block:: javascript + + MathJax.Callback.Queue( + MathJax.Ajax.Require("[MathJax]/extensions/AMSmath.js"), + [f, 1], + MathJax.Ajax.Require("[MathJax]/config/local/AMSmathAdditions.js"), + [f, 2] + ); + +in comparison to the example above that uses ``["Require", +MathJax.Ajax, "[MathJax]/extensions/AMSmath.js"]`` and ``["Require", +MathJax.Ajax, "[MathJax]/config/local/AMSmathAdditions.js"]`` instead. In that +example, ``AMSmath.js`` is loaded, then ``f(1)`` is called, then the +local additions are loaded, then ``f(2)`` is called. + +Here, however, both file loads are started before the queue is +created, and are operating in parallel (rather than sequentially as in +the earlier example). It is possible for the loading of the local +additions to complete before the AMSmath extension is loaded in this +case, which was guaranteed **not** to happen in the other example. +Note, however, that ``f(1)`` is guaranteed not to be performed until +after the AMSmath extensions load, and ``f(2)`` will not occur until +after both files are loaded. + +In this way, it is possible to start asynchronous loading of several +files simultaneously, and wait until all of them are loaded (in +whatever order) to perform some command. For instance, + +.. code-block:: javascript + + MathJax.Callback.Queue( + MathJax.Ajax.Require("file1.js"), + MathJax.Ajax.Require("file2.js"), + MathJax.Ajax.Require("file3.js"), + MathJax.Ajax.Require("file4.js"), + [f, "all done"] + ); + +starts four files loading all at once, and waits for all four to +complete before calling ``f("all done")``. The order in which they +complete is immaterial, and they all are being requested +simultaneously. + + +The MathJax Processing Queue +============================ + +MathJax uses a queue stored as ``MathJax.Hub.queue`` to regulate its +own actions so that they operate in the right order even when some +of them include asynchronous operations. You can take advantage of +that queue when you make calls to MathJax methods that need to be +synchronized with the other actions taken by MathJax. It may not +always be apparent, however, which methods fall into that category. + +The main source of asynchronous actions in MathJax is the loading of +external files, so any action that may cause a file to be loaded may +act asynchronously. Many important actions do so, including some that +you might not expect; e.g., typesetting mathematics can cause files to +be loaded. This is because some TeX commands, for example, are rare +enough that they are not included in the core TeX input processor, but +instead are defined in extensions that are loaded automatically when +needed. The typesetting of an expression containing one of these TeX +commands can cause the typesetting process to be suspended while the +file is loaded, and then restarted when the extension has become +evailable. + +As a result, any call to :meth:`MathJax.Hub.Typeset()` (or +:meth:`MathJax.Hub.Process()`, or :meth:`MathJax.Hub.Update()`, etc.) +could return long before the mathematics is actually typeset, and the +rest of your code may run before the mathematics is available. If you +have code that relys on the mathematics being visible on screen, you +will need to break that out into a separate operation that is +synchronized with the typesetting via the MathJax queue. + +Furthermore, your own typesetting calls may need to wait for file loading +to occur that is already underway, so even if you don't need to access +the mathematics after it is typeset, you may still need to queue the +typeset command in order to make sure it is properly synchronized with +*previous* typeset calls. For instance, if an earlier call +started loading an extension and you start another typeset call before +that extension is fully loaded, MathJax's internal state may be in +flux, and it may not be prepared to handle another typeset operation +yet. This is even more important if you are using other libraries +that may call MathJax, in which case your code may not be aware of the +state that MathJax is in. + +For these reasons, it is always best to perform typesetting operations +through the MathJax queue, and the same goes for any other action +that could cause files to load. A good rule of thumb is that, if a +MathJax function includes a callback argument, that function may operate +asynchronously; you should use the MathJax queue to perform it and +any actions that rely on its results. + +To place an action in the MathJax queue, use the +:meth:`MathJax.Hub.Queue()` command. For example + +.. code-block:: javascript + + MathJax.Hub.Queue(["Typeset",MathJax.Hub,"MathDiv"]); + +would queue the command ``MathJax.Hub.Typeset("MathDiv")``, causing +the contents of the DOM element with `id` equal to ``MathDiv`` to be +typeset. + +One of the uses of the MathJax queue is to allow you to synchronize an +action with the startup process for MathJax. If you want to have a +function performed after MathJax has become completely set up (and +performed its initial typesetting of the page), you can push it onto +the ``MathJax.Hub.queue`` so that it won't be performed until MathJax +finishes everything it has queued when it was loaded. For example, + +.. code-block:: html + + + diff --git a/mathjax/docs/build/_sources/signals.txt b/mathjax/docs/build/_sources/signals.txt new file mode 100644 index 000000000..f4ca8f6c6 --- /dev/null +++ b/mathjax/docs/build/_sources/signals.txt @@ -0,0 +1,161 @@ +.. _using-signals: + +************* +Using Signals +************* + +Because much of MathJax operates asynchronously, it is important for +MathJax to be able to indicated to other components operating on the +page that certain actions have been taken. For example, as MathJax is +starting up, it loads external files such as its configuration files +and the various input and output :term:`jax` that are used on the +page. This means that MathJax may not be ready to run until well +after the `` + +in your document's ```` block. Here, ``path-to-MathJax`` should +be replaced by the URL for the main MathJax directory, so if you have +put the ``MathJax`` directory at the top level of you server's web +site, you could use + +.. code-block:: html + + + +to load MathJax in your page. For example, your page could look like + +.. code-block:: html + + + + ... + + + + ... + + + +Although it is possible to load MathJax from a site other than your +own web server, there are issues involved in doing so that you need to +take into consideration. See the :ref:`Notes About Shared Servers +` for more details. Please do **not** link to +the copy of MathJax at ``www.mathjax.org``, as we do not have the +resources to act as a web service for all the sites on the web that +would like to display mathematics. If you are able to run MathJax +from your own server, please do so (this will probably give you better +response time in any case). + + +Putting mathematics in a web page +================================= + +To put mathematics in your web page, you can use either TeX and LaTeX +notation, or MathML notation (or both); the configuration file tells +MathJax which you want to use, and how you plan to indicate the +mathematics when you are using TeX notation. The following sections +tell you how to use each of these formats. + + +.. _tex-and-latex-input: + +TeX and LaTeX input +------------------- + +To process mathematics that is written in :term:`TeX` or :term:`LaTeX` +format, include ``"input/TeX"`` in your configuration's `jax` array, +and add ``"tex2jax.js"`` to the `extensions` array so that MathJax +will look for TeX-style math delimiters to identify the mathematics on +the page. + +.. code-block:: javascript + + extensions: ["tex2math.js"], + jax: ["input/TeX", "output/HTML-CSS"] + +Note that the default math delimiters are ``$$...$$`` and ``\[...\]`` +for displayed mathematics, and ``\(...\)`` for in-line mathematics. +In particular, the ``$...$`` in-line delimiters are **not** used by +default. 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 + + tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]} + +See the ``config/MathJax.js`` file, or the :ref:`tex2jax configuration +options ` page, for additional configuration +parameters that you can specify for the ``tex2jax`` preprocessor. + +Here is a complete sample page containing TeX mathematics (which +assumes that ``config/MathJax.js`` is configured as described above): + +.. code-block:: html + + + + MathJax TeX Test Page + + + + When \(a \ne 0\), there are two solutions to \(ax^2 + bx + c = 0\) and they are + $$x = {-b \pm \sqrt{b^2-4ac} \over 2a}.$$ + + + +There are a number of extensions for the TeX input processor that you +might want to add to the `extensions` array. These include: + +- `TeX/AMSmath.js`, which defines the AMS math environments and + macros, + +- `TeX/AMSsymbols.js`, which defines the macros for the symbols in + the msam10 and msbm10 fonts, + +- `TeX/noErrors.js`, which shows the original TeX code rather than + an error message when there is a problem processing the TeX, and + +- `TeX/noUndefined.js`, which prevents undefined macros from + producing an error message, and instead shows the macro name in red. + +For example, + +.. code-block:: javascript + + extensions: ["tex2math.js","TeX/noErrors.js","TeX/noUndefined.js", + "TeX/AMSmath.js","TeX/AMSsymbols.js"] + +loads all four extensions, in addition to the ``tex2math`` +preprocessor. + + +MathML input +------------ + +To process mathematics written in :term:`MathML`, include +``"input/MathML"`` in your configuration's `jax` array, and add +``"mml2jax.js"`` to the `extensions` array so that MathJax will +locate the ```` elements in the page automatically. + +.. code-block:: javascript + + extensions: ["mml2jax.js"], + jax: ["input/MathML", "output/HTML-CSS"] + +With this configuration, you would mark your mathematics using +standard ```` tags, where ```` represents +displayed mathematics and ```` or just +```` represents in-line mathematics. + +Note that this will work in HTML files, not just XHTML files (MathJax +works with both), and that the web page need not be served with any +special MIME-type. Also note that, unless you are using XHTML rather +than HTML, you should not include a namespace prefix for your +```` tags; for example, you should not use ```` except +in a file where you have tied the ``m`` namespace to the MathML DTD. + +Here is a complete sample page containing MathML mathematics (which +assumes that ``config/MathJax.js`` is configured as described above): + +.. code-block:: html + + + + MathJax MathML Test Page + + + + + When a0, + there are two solutions to + ax2 + + bx + + c = 0 + and they are + + x = + + + + + b + ± + + b2 + + 4ac + + + 2a + + + . + + + + + +The ``mml2jax`` has only a few configuration options; see the +``config/MathJax.js`` file or the :ref:`mml2jax configuration options +` page for more details. + + +Where to go from here? +====================== + +If you have followed the instructions above, you should now have +MathJax installed and configured on your web server, and you should be +able to use it to write web pages that include mathematics. At this +point, you can start making pages that contain mathematical content! + +You could also read more about the details of how to :ref:`customize +MathJax `. + +If you are trying to use MathJax in blog or wiki software or in some +other content-manangement system, you might want to read about :ref:`using +MathJax in popular platforms `. + +If you are working on dynamic pages that include mathematics, you +might want to read about the :ref:`MathJax Application Programming +Interface ` (it's API), so you know how to include +mathematics in your interactive pages. + +If you are having trouble getting MathJax to work, you can read more +about :ref:`installing MathJax `, or :ref:`loading and +configuring MathJax `. + +Finally, if you have questions or comments, or want to help support +MathJax, you could visit the :ref:`MathJax community forums +` or the :ref:`MathJax bug tracker +`. diff --git a/mathjax/docs/build/_sources/startup.txt b/mathjax/docs/build/_sources/startup.txt new file mode 100644 index 000000000..49aa84fb1 --- /dev/null +++ b/mathjax/docs/build/_sources/startup.txt @@ -0,0 +1,152 @@ +.. _startup-sequence: + +**************************** +The MathJax Startup Sequence +**************************** + +When you load ``MathJax.js`` into a web page, it configures itself and +immediately begins loading the components it needs. As MathJax starts +up, it uses its :ref:`signaling mechanism ` +to indicate the actions that it is taking so that MathJax extensions +can tie into the initialization process, and so other applications +within the page can synchronize their actions with MathJax. + +The startup process performs the following actions: + +- It creates the ``MathJax`` variable, and defines the following + subsystems: + + - ``MathJax.Object`` (object-oriented programming model) + - ``MathJax.Callback`` (callbacks, signals, and queues) + - ``MathJax.Ajax`` (file-loading and style-creation code) + - ``MathJax.HTML`` (support code for creating HTML elements) + - ``MathJax.Message`` (manages the menu line in the lower left) + - ``MathJax.Hub`` (the core MathJax functions) + +.. + +- It then creates the base ``MathJax.InputJax``, + ``MathJax.OutputJax``, and ``MathJax.ElementJax`` objects. + +.. + +- MathJax sets up the default configuration, and creates the + signal objects used for the startup and hub actions. + +.. + +- MathJax locates the `` + + + + + + + Type some TeX code: + +

+ +

+ You typed: ${}$ +
+ + + diff --git a/mathjax/docs/build/_static/basic.css b/mathjax/docs/build/_static/basic.css new file mode 100644 index 000000000..69f30d4fb --- /dev/null +++ b/mathjax/docs/build/_static/basic.css @@ -0,0 +1,509 @@ +/* + * basic.css + * ~~~~~~~~~ + * + * Sphinx stylesheet -- basic theme. + * + * :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + * :license: BSD, see LICENSE for details. + * + */ + +/* -- main layout ----------------------------------------------------------- */ + +div.clearer { + clear: both; +} + +/* -- relbar ---------------------------------------------------------------- */ + +div.related { + width: 100%; + font-size: 90%; +} + +div.related h3 { + display: none; +} + +div.related ul { + margin: 0; + padding: 0 0 0 10px; + list-style: none; +} + +div.related li { + display: inline; +} + +div.related li.right { + float: right; + margin-right: 5px; +} + +/* -- sidebar --------------------------------------------------------------- */ + +div.sphinxsidebarwrapper { + padding: 10px 5px 0 10px; +} + +div.sphinxsidebar { + float: left; + width: 230px; + margin-left: -100%; + font-size: 90%; +} + +div.sphinxsidebar ul { + list-style: none; +} + +div.sphinxsidebar ul ul, +div.sphinxsidebar ul.want-points { + margin-left: 20px; + list-style: square; +} + +div.sphinxsidebar ul ul { + margin-top: 0; + margin-bottom: 0; +} + +div.sphinxsidebar form { + margin-top: 10px; +} + +div.sphinxsidebar input { + border: 1px solid #98dbcc; + font-family: sans-serif; + font-size: 1em; +} + +img { + border: 0; +} + +/* -- search page ----------------------------------------------------------- */ + +ul.search { + margin: 10px 0 0 20px; + padding: 0; +} + +ul.search li { + padding: 5px 0 5px 20px; + background-image: url(file.png); + background-repeat: no-repeat; + background-position: 0 7px; +} + +ul.search li a { + font-weight: bold; +} + +ul.search li div.context { + color: #888; + margin: 2px 0 0 30px; + text-align: left; +} + +ul.keywordmatches li.goodmatch a { + font-weight: bold; +} + +/* -- index page ------------------------------------------------------------ */ + +table.contentstable { + width: 90%; +} + +table.contentstable p.biglink { + line-height: 150%; +} + +a.biglink { + font-size: 1.3em; +} + +span.linkdescr { + font-style: italic; + padding-top: 5px; + font-size: 90%; +} + +/* -- general index --------------------------------------------------------- */ + +table.indextable { + width: 100%; +} + +table.indextable td { + text-align: left; + vertical-align: top; +} + +table.indextable dl, table.indextable dd { + margin-top: 0; + margin-bottom: 0; +} + +table.indextable tr.pcap { + height: 10px; +} + +table.indextable tr.cap { + margin-top: 10px; + background-color: #f2f2f2; +} + +img.toggler { + margin-right: 3px; + margin-top: 3px; + cursor: pointer; +} + +div.modindex-jumpbox { + border-top: 1px solid #ddd; + border-bottom: 1px solid #ddd; + margin: 1em 0 1em 0; + padding: 0.4em; +} + +div.genindex-jumpbox { + border-top: 1px solid #ddd; + border-bottom: 1px solid #ddd; + margin: 1em 0 1em 0; + padding: 0.4em; +} + +/* -- general body styles --------------------------------------------------- */ + +a.headerlink { + visibility: hidden; +} + +h1:hover > a.headerlink, +h2:hover > a.headerlink, +h3:hover > a.headerlink, +h4:hover > a.headerlink, +h5:hover > a.headerlink, +h6:hover > a.headerlink, +dt:hover > a.headerlink { + visibility: visible; +} + +div.body p.caption { + text-align: inherit; +} + +div.body td { + text-align: left; +} + +.field-list ul { + padding-left: 1em; +} + +.first { + margin-top: 0 !important; +} + +p.rubric { + margin-top: 30px; + font-weight: bold; +} + +.align-left { + text-align: left; +} + +.align-center { + clear: both; + text-align: center; +} + +.align-right { + text-align: right; +} + +/* -- sidebars -------------------------------------------------------------- */ + +div.sidebar { + margin: 0 0 0.5em 1em; + border: 1px solid #ddb; + padding: 7px 7px 0 7px; + background-color: #ffe; + width: 40%; + float: right; +} + +p.sidebar-title { + font-weight: bold; +} + +/* -- topics ---------------------------------------------------------------- */ + +div.topic { + border: 1px solid #ccc; + padding: 7px 7px 0 7px; + margin: 10px 0 10px 0; +} + +p.topic-title { + font-size: 1.1em; + font-weight: bold; + margin-top: 10px; +} + +/* -- admonitions ----------------------------------------------------------- */ + +div.admonition { + margin-top: 10px; + margin-bottom: 10px; + padding: 7px; +} + +div.admonition dt { + font-weight: bold; +} + +div.admonition dl { + margin-bottom: 0; +} + +p.admonition-title { + margin: 0px 10px 5px 0px; + font-weight: bold; +} + +div.body p.centered { + text-align: center; + margin-top: 25px; +} + +/* -- tables ---------------------------------------------------------------- */ + +table.docutils { + border: 0; + border-collapse: collapse; +} + +table.docutils td, table.docutils th { + padding: 1px 8px 1px 5px; + border-top: 0; + border-left: 0; + border-right: 0; + border-bottom: 1px solid #aaa; +} + +table.field-list td, table.field-list th { + border: 0 !important; +} + +table.footnote td, table.footnote th { + border: 0 !important; +} + +th { + text-align: left; + padding-right: 5px; +} + +table.citation { + border-left: solid 1px gray; + margin-left: 1px; +} + +table.citation td { + border-bottom: none; +} + +/* -- other body styles ----------------------------------------------------- */ + +ol.arabic { + list-style: decimal; +} + +ol.loweralpha { + list-style: lower-alpha; +} + +ol.upperalpha { + list-style: upper-alpha; +} + +ol.lowerroman { + list-style: lower-roman; +} + +ol.upperroman { + list-style: upper-roman; +} + +dl { + margin-bottom: 15px; +} + +dd p { + margin-top: 0px; +} + +dd ul, dd table { + margin-bottom: 10px; +} + +dd { + margin-top: 3px; + margin-bottom: 10px; + margin-left: 30px; +} + +dt:target, .highlighted { + background-color: #fbe54e; +} + +dl.glossary dt { + font-weight: bold; + font-size: 1.1em; +} + +.field-list ul { + margin: 0; + padding-left: 1em; +} + +.field-list p { + margin: 0; +} + +.refcount { + color: #060; +} + +.optional { + font-size: 1.3em; +} + +.versionmodified { + font-style: italic; +} + +.system-message { + background-color: #fda; + padding: 5px; + border: 3px solid red; +} + +.footnote:target { + background-color: #ffa +} + +.line-block { + display: block; + margin-top: 1em; + margin-bottom: 1em; +} + +.line-block .line-block { + margin-top: 0; + margin-bottom: 0; + margin-left: 1.5em; +} + +.guilabel, .menuselection { + font-family: sans-serif; +} + +.accelerator { + text-decoration: underline; +} + +.classifier { + font-style: oblique; +} + +/* -- code displays --------------------------------------------------------- */ + +pre { + overflow: auto; +} + +td.linenos pre { + padding: 5px 0px; + border: 0; + background-color: transparent; + color: #aaa; +} + +table.highlighttable { + margin-left: 0.5em; +} + +table.highlighttable td { + padding: 0 0.5em 0 0.5em; +} + +tt.descname { + background-color: transparent; + font-weight: bold; + font-size: 1.2em; +} + +tt.descclassname { + background-color: transparent; +} + +tt.xref, a tt { + background-color: transparent; + font-weight: bold; +} + +h1 tt, h2 tt, h3 tt, h4 tt, h5 tt, h6 tt { + background-color: transparent; +} + +.viewcode-link { + float: right; +} + +.viewcode-back { + float: right; + font-family: sans-serif; +} + +div.viewcode-block:target { + margin: -1px -10px; + padding: 0 10px; +} + +/* -- math display ---------------------------------------------------------- */ + +img.math { + vertical-align: middle; +} + +div.body div.math p { + text-align: center; +} + +span.eqno { + float: right; +} + +/* -- printout stylesheet --------------------------------------------------- */ + +@media print { + div.document, + div.documentwrapper, + div.bodywrapper { + margin: 0 !important; + width: 100%; + } + + div.sphinxsidebar, + div.related, + div.footer, + #top-link { + display: none; + } +} diff --git a/mathjax/docs/build/_static/doctools.js b/mathjax/docs/build/_static/doctools.js new file mode 100644 index 000000000..eeea95ea5 --- /dev/null +++ b/mathjax/docs/build/_static/doctools.js @@ -0,0 +1,247 @@ +/* + * doctools.js + * ~~~~~~~~~~~ + * + * Sphinx JavaScript utilties for all documentation. + * + * :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + * :license: BSD, see LICENSE for details. + * + */ + +/** + * select a different prefix for underscore + */ +$u = _.noConflict(); + +/** + * make the code below compatible with browsers without + * an installed firebug like debugger +if (!window.console || !console.firebug) { + var names = ["log", "debug", "info", "warn", "error", "assert", "dir", + "dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace", + "profile", "profileEnd"]; + window.console = {}; + for (var i = 0; i < names.length; ++i) + window.console[names[i]] = function() {}; +} + */ + +/** + * small helper function to urldecode strings + */ +jQuery.urldecode = function(x) { + return decodeURIComponent(x).replace(/\+/g, ' '); +} + +/** + * small helper function to urlencode strings + */ +jQuery.urlencode = encodeURIComponent; + +/** + * This function returns the parsed url parameters of the + * current request. Multiple values per key are supported, + * it will always return arrays of strings for the value parts. + */ +jQuery.getQueryParameters = function(s) { + if (typeof s == 'undefined') + s = document.location.search; + var parts = s.substr(s.indexOf('?') + 1).split('&'); + var result = {}; + for (var i = 0; i < parts.length; i++) { + var tmp = parts[i].split('=', 2); + var key = jQuery.urldecode(tmp[0]); + var value = jQuery.urldecode(tmp[1]); + if (key in result) + result[key].push(value); + else + result[key] = [value]; + } + return result; +}; + +/** + * small function to check if an array contains + * a given item. + */ +jQuery.contains = function(arr, item) { + for (var i = 0; i < arr.length; i++) { + if (arr[i] == item) + return true; + } + return false; +}; + +/** + * highlight a given string on a jquery object by wrapping it in + * span elements with the given class name. + */ +jQuery.fn.highlightText = function(text, className) { + function highlight(node) { + if (node.nodeType == 3) { + var val = node.nodeValue; + var pos = val.toLowerCase().indexOf(text); + if (pos >= 0 && !jQuery(node.parentNode).hasClass(className)) { + var span = document.createElement("span"); + span.className = className; + span.appendChild(document.createTextNode(val.substr(pos, text.length))); + node.parentNode.insertBefore(span, node.parentNode.insertBefore( + document.createTextNode(val.substr(pos + text.length)), + node.nextSibling)); + node.nodeValue = val.substr(0, pos); + } + } + else if (!jQuery(node).is("button, select, textarea")) { + jQuery.each(node.childNodes, function() { + highlight(this); + }); + } + } + return this.each(function() { + highlight(this); + }); +}; + +/** + * Small JavaScript module for the documentation. + */ +var Documentation = { + + init : function() { + this.fixFirefoxAnchorBug(); + this.highlightSearchWords(); + this.initIndexTable(); + }, + + /** + * i18n support + */ + TRANSLATIONS : {}, + PLURAL_EXPR : function(n) { return n == 1 ? 0 : 1; }, + LOCALE : 'unknown', + + // gettext and ngettext don't access this so that the functions + // can safely bound to a different name (_ = Documentation.gettext) + gettext : function(string) { + var translated = Documentation.TRANSLATIONS[string]; + if (typeof translated == 'undefined') + return string; + return (typeof translated == 'string') ? translated : translated[0]; + }, + + ngettext : function(singular, plural, n) { + var translated = Documentation.TRANSLATIONS[singular]; + if (typeof translated == 'undefined') + return (n == 1) ? singular : plural; + return translated[Documentation.PLURALEXPR(n)]; + }, + + addTranslations : function(catalog) { + for (var key in catalog.messages) + this.TRANSLATIONS[key] = catalog.messages[key]; + this.PLURAL_EXPR = new Function('n', 'return +(' + catalog.plural_expr + ')'); + this.LOCALE = catalog.locale; + }, + + /** + * add context elements like header anchor links + */ + addContextElements : function() { + $('div[id] > :header:first').each(function() { + $('\u00B6'). + attr('href', '#' + this.id). + attr('title', _('Permalink to this headline')). + appendTo(this); + }); + $('dt[id]').each(function() { + $('\u00B6'). + attr('href', '#' + this.id). + attr('title', _('Permalink to this definition')). + appendTo(this); + }); + }, + + /** + * workaround a firefox stupidity + */ + fixFirefoxAnchorBug : function() { + if (document.location.hash && $.browser.mozilla) + window.setTimeout(function() { + document.location.href += ''; + }, 10); + }, + + /** + * highlight the search words provided in the url in the text + */ + highlightSearchWords : function() { + var params = $.getQueryParameters(); + var terms = (params.highlight) ? params.highlight[0].split(/\s+/) : []; + if (terms.length) { + var body = $('div.body'); + window.setTimeout(function() { + $.each(terms, function() { + body.highlightText(this.toLowerCase(), 'highlighted'); + }); + }, 10); + $('') + .appendTo($('.sidebar .this-page-menu')); + } + }, + + /** + * init the domain index toggle buttons + */ + initIndexTable : function() { + var togglers = $('img.toggler').click(function() { + var src = $(this).attr('src'); + var idnum = $(this).attr('id').substr(7); + $('tr.cg-' + idnum).toggle(); + if (src.substr(-9) == 'minus.png') + $(this).attr('src', src.substr(0, src.length-9) + 'plus.png'); + else + $(this).attr('src', src.substr(0, src.length-8) + 'minus.png'); + }).css('display', ''); + if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) { + togglers.click(); + } + }, + + /** + * helper function to hide the search marks again + */ + hideSearchWords : function() { + $('.sidebar .this-page-menu li.highlight-link').fadeOut(300); + $('span.highlighted').removeClass('highlighted'); + }, + + /** + * make the url absolute + */ + makeURL : function(relativeURL) { + return DOCUMENTATION_OPTIONS.URL_ROOT + '/' + relativeURL; + }, + + /** + * get the current relative url + */ + getCurrentURL : function() { + var path = document.location.pathname; + var parts = path.split(/\//); + $.each(DOCUMENTATION_OPTIONS.URL_ROOT.split(/\//), function() { + if (this == '..') + parts.pop(); + }); + var url = parts.join('/'); + return path.substring(url.lastIndexOf('/') + 1, path.length - 1); + } +}; + +// quick alias for translations +_ = Documentation.gettext; + +$(document).ready(function() { + Documentation.init(); +}); diff --git a/mathjax/docs/build/_static/file.png b/mathjax/docs/build/_static/file.png new file mode 100644 index 000000000..d18082e39 Binary files /dev/null and b/mathjax/docs/build/_static/file.png differ diff --git a/mathjax/docs/build/_static/jquery.js b/mathjax/docs/build/_static/jquery.js new file mode 100644 index 000000000..7c2430802 --- /dev/null +++ b/mathjax/docs/build/_static/jquery.js @@ -0,0 +1,154 @@ +/*! + * jQuery JavaScript Library v1.4.2 + * http://jquery.com/ + * + * Copyright 2010, John Resig + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * Includes Sizzle.js + * http://sizzlejs.com/ + * Copyright 2010, The Dojo Foundation + * Released under the MIT, BSD, and GPL Licenses. + * + * Date: Sat Feb 13 22:33:48 2010 -0500 + */ +(function(A,w){function ma(){if(!c.isReady){try{s.documentElement.doScroll("left")}catch(a){setTimeout(ma,1);return}c.ready()}}function Qa(a,b){b.src?c.ajax({url:b.src,async:false,dataType:"script"}):c.globalEval(b.text||b.textContent||b.innerHTML||"");b.parentNode&&b.parentNode.removeChild(b)}function X(a,b,d,f,e,j){var i=a.length;if(typeof b==="object"){for(var o in b)X(a,o,b[o],f,e,d);return a}if(d!==w){f=!j&&f&&c.isFunction(d);for(o=0;o)[^>]*$|^#([\w-]+)$/,Ua=/^.[^:#\[\.,]*$/,Va=/\S/, +Wa=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,Xa=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,P=navigator.userAgent,xa=false,Q=[],L,$=Object.prototype.toString,aa=Object.prototype.hasOwnProperty,ba=Array.prototype.push,R=Array.prototype.slice,ya=Array.prototype.indexOf;c.fn=c.prototype={init:function(a,b){var d,f;if(!a)return this;if(a.nodeType){this.context=this[0]=a;this.length=1;return this}if(a==="body"&&!b){this.context=s;this[0]=s.body;this.selector="body";this.length=1;return this}if(typeof a==="string")if((d=Ta.exec(a))&& +(d[1]||!b))if(d[1]){f=b?b.ownerDocument||b:s;if(a=Xa.exec(a))if(c.isPlainObject(b)){a=[s.createElement(a[1])];c.fn.attr.call(a,b,true)}else a=[f.createElement(a[1])];else{a=sa([d[1]],[f]);a=(a.cacheable?a.fragment.cloneNode(true):a.fragment).childNodes}return c.merge(this,a)}else{if(b=s.getElementById(d[2])){if(b.id!==d[2])return T.find(a);this.length=1;this[0]=b}this.context=s;this.selector=a;return this}else if(!b&&/^\w+$/.test(a)){this.selector=a;this.context=s;a=s.getElementsByTagName(a);return c.merge(this, +a)}else return!b||b.jquery?(b||T).find(a):c(b).find(a);else if(c.isFunction(a))return T.ready(a);if(a.selector!==w){this.selector=a.selector;this.context=a.context}return c.makeArray(a,this)},selector:"",jquery:"1.4.2",length:0,size:function(){return this.length},toArray:function(){return R.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this.slice(a)[0]:this[a]},pushStack:function(a,b,d){var f=c();c.isArray(a)?ba.apply(f,a):c.merge(f,a);f.prevObject=this;f.context=this.context;if(b=== +"find")f.selector=this.selector+(this.selector?" ":"")+d;else if(b)f.selector=this.selector+"."+b+"("+d+")";return f},each:function(a,b){return c.each(this,a,b)},ready:function(a){c.bindReady();if(c.isReady)a.call(s,c);else Q&&Q.push(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(R.apply(this,arguments),"slice",R.call(arguments).join(","))},map:function(a){return this.pushStack(c.map(this, +function(b,d){return a.call(b,d,b)}))},end:function(){return this.prevObject||c(null)},push:ba,sort:[].sort,splice:[].splice};c.fn.init.prototype=c.fn;c.extend=c.fn.extend=function(){var a=arguments[0]||{},b=1,d=arguments.length,f=false,e,j,i,o;if(typeof a==="boolean"){f=a;a=arguments[1]||{};b=2}if(typeof a!=="object"&&!c.isFunction(a))a={};if(d===b){a=this;--b}for(;b
a"; +var e=d.getElementsByTagName("*"),j=d.getElementsByTagName("a")[0];if(!(!e||!e.length||!j)){c.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(j.getAttribute("style")),hrefNormalized:j.getAttribute("href")==="/a",opacity:/^0.55$/.test(j.style.opacity),cssFloat:!!j.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:s.createElement("select").appendChild(s.createElement("option")).selected, +parentNode:d.removeChild(d.appendChild(s.createElement("div"))).parentNode===null,deleteExpando:true,checkClone:false,scriptEval:false,noCloneEvent:true,boxModel:null};b.type="text/javascript";try{b.appendChild(s.createTextNode("window."+f+"=1;"))}catch(i){}a.insertBefore(b,a.firstChild);if(A[f]){c.support.scriptEval=true;delete A[f]}try{delete b.test}catch(o){c.support.deleteExpando=false}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function k(){c.support.noCloneEvent= +false;d.detachEvent("onclick",k)});d.cloneNode(true).fireEvent("onclick")}d=s.createElement("div");d.innerHTML="";a=s.createDocumentFragment();a.appendChild(d.firstChild);c.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;c(function(){var k=s.createElement("div");k.style.width=k.style.paddingLeft="1px";s.body.appendChild(k);c.boxModel=c.support.boxModel=k.offsetWidth===2;s.body.removeChild(k).style.display="none"});a=function(k){var n= +s.createElement("div");k="on"+k;var r=k in n;if(!r){n.setAttribute(k,"return;");r=typeof n[k]==="function"}return r};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=e=j=null}})();c.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};var G="jQuery"+J(),Ya=0,za={};c.extend({cache:{},expando:G,noData:{embed:true,object:true, +applet:true},data:function(a,b,d){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var f=a[G],e=c.cache;if(!f&&typeof b==="string"&&d===w)return null;f||(f=++Ya);if(typeof b==="object"){a[G]=f;e[f]=c.extend(true,{},b)}else if(!e[f]){a[G]=f;e[f]={}}a=e[f];if(d!==w)a[b]=d;return typeof b==="string"?a[b]:a}},removeData:function(a,b){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var d=a[G],f=c.cache,e=f[d];if(b){if(e){delete e[b];c.isEmptyObject(e)&&c.removeData(a)}}else{if(c.support.deleteExpando)delete a[c.expando]; +else a.removeAttribute&&a.removeAttribute(c.expando);delete f[d]}}}});c.fn.extend({data:function(a,b){if(typeof a==="undefined"&&this.length)return c.data(this[0]);else if(typeof a==="object")return this.each(function(){c.data(this,a)});var d=a.split(".");d[1]=d[1]?"."+d[1]:"";if(b===w){var f=this.triggerHandler("getData"+d[1]+"!",[d[0]]);if(f===w&&this.length)f=c.data(this[0],a);return f===w&&d[1]?this.data(d[0]):f}else return this.trigger("setData"+d[1]+"!",[d[0],b]).each(function(){c.data(this, +a,b)})},removeData:function(a){return this.each(function(){c.removeData(this,a)})}});c.extend({queue:function(a,b,d){if(a){b=(b||"fx")+"queue";var f=c.data(a,b);if(!d)return f||[];if(!f||c.isArray(d))f=c.data(a,b,c.makeArray(d));else f.push(d);return f}},dequeue:function(a,b){b=b||"fx";var d=c.queue(a,b),f=d.shift();if(f==="inprogress")f=d.shift();if(f){b==="fx"&&d.unshift("inprogress");f.call(a,function(){c.dequeue(a,b)})}}});c.fn.extend({queue:function(a,b){if(typeof a!=="string"){b=a;a="fx"}if(b=== +w)return c.queue(this[0],a);return this.each(function(){var d=c.queue(this,a,b);a==="fx"&&d[0]!=="inprogress"&&c.dequeue(this,a)})},dequeue:function(a){return this.each(function(){c.dequeue(this,a)})},delay:function(a,b){a=c.fx?c.fx.speeds[a]||a:a;b=b||"fx";return this.queue(b,function(){var d=this;setTimeout(function(){c.dequeue(d,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var Aa=/[\n\t]/g,ca=/\s+/,Za=/\r/g,$a=/href|src|style/,ab=/(button|input)/i,bb=/(button|input|object|select|textarea)/i, +cb=/^(a|area)$/i,Ba=/radio|checkbox/;c.fn.extend({attr:function(a,b){return X(this,a,b,true,c.attr)},removeAttr:function(a){return this.each(function(){c.attr(this,a,"");this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(c.isFunction(a))return this.each(function(n){var r=c(this);r.addClass(a.call(this,n,r.attr("class")))});if(a&&typeof a==="string")for(var b=(a||"").split(ca),d=0,f=this.length;d-1)return true;return false},val:function(a){if(a===w){var b=this[0];if(b){if(c.nodeName(b,"option"))return(b.attributes.value||{}).specified?b.value:b.text;if(c.nodeName(b,"select")){var d=b.selectedIndex,f=[],e=b.options;b=b.type==="select-one";if(d<0)return null;var j=b?d:0;for(d=b?d+1:e.length;j=0;else if(c.nodeName(this,"select")){var u=c.makeArray(r);c("option",this).each(function(){this.selected= +c.inArray(c(this).val(),u)>=0});if(!u.length)this.selectedIndex=-1}else this.value=r}})}});c.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(a,b,d,f){if(!a||a.nodeType===3||a.nodeType===8)return w;if(f&&b in c.attrFn)return c(a)[b](d);f=a.nodeType!==1||!c.isXMLDoc(a);var e=d!==w;b=f&&c.props[b]||b;if(a.nodeType===1){var j=$a.test(b);if(b in a&&f&&!j){if(e){b==="type"&&ab.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed"); +a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&&b.specified?b.value:bb.test(a.nodeName)||cb.test(a.nodeName)&&a.href?0:w;return a[b]}if(!c.support.style&&f&&b==="style"){if(e)a.style.cssText=""+d;return a.style.cssText}e&&a.setAttribute(b,""+d);a=!c.support.hrefNormalized&&f&&j?a.getAttribute(b,2):a.getAttribute(b);return a===null?w:a}return c.style(a,b,d)}});var O=/\.(.*)$/,db=function(a){return a.replace(/[^\w\s\.\|`]/g, +function(b){return"\\"+b})};c.event={add:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){if(a.setInterval&&a!==A&&!a.frameElement)a=A;var e,j;if(d.handler){e=d;d=e.handler}if(!d.guid)d.guid=c.guid++;if(j=c.data(a)){var i=j.events=j.events||{},o=j.handle;if(!o)j.handle=o=function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(o.elem,arguments):w};o.elem=a;b=b.split(" ");for(var k,n=0,r;k=b[n++];){j=e?c.extend({},e):{handler:d,data:f};if(k.indexOf(".")>-1){r=k.split("."); +k=r.shift();j.namespace=r.slice(0).sort().join(".")}else{r=[];j.namespace=""}j.type=k;j.guid=d.guid;var u=i[k],z=c.event.special[k]||{};if(!u){u=i[k]=[];if(!z.setup||z.setup.call(a,f,r,o)===false)if(a.addEventListener)a.addEventListener(k,o,false);else a.attachEvent&&a.attachEvent("on"+k,o)}if(z.add){z.add.call(a,j);if(!j.handler.guid)j.handler.guid=d.guid}u.push(j);c.event.global[k]=true}a=null}}},global:{},remove:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){var e,j=0,i,o,k,n,r,u,z=c.data(a), +C=z&&z.events;if(z&&C){if(b&&b.type){d=b.handler;b=b.type}if(!b||typeof b==="string"&&b.charAt(0)==="."){b=b||"";for(e in C)c.event.remove(a,e+b)}else{for(b=b.split(" ");e=b[j++];){n=e;i=e.indexOf(".")<0;o=[];if(!i){o=e.split(".");e=o.shift();k=new RegExp("(^|\\.)"+c.map(o.slice(0).sort(),db).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(r=C[e])if(d){n=c.event.special[e]||{};for(B=f||0;B=0){a.type= +e=e.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();c.event.global[e]&&c.each(c.cache,function(){this.events&&this.events[e]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType===8)return w;a.result=w;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;(f=c.data(d,"handle"))&&f.apply(d,b);f=d.parentNode||d.ownerDocument;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()]))if(d["on"+e]&&d["on"+e].apply(d,b)===false)a.result=false}catch(j){}if(!a.isPropagationStopped()&& +f)c.event.trigger(a,b,f,true);else if(!a.isDefaultPrevented()){f=a.target;var i,o=c.nodeName(f,"a")&&e==="click",k=c.event.special[e]||{};if((!k._default||k._default.call(d,a)===false)&&!o&&!(f&&f.nodeName&&c.noData[f.nodeName.toLowerCase()])){try{if(f[e]){if(i=f["on"+e])f["on"+e]=null;c.event.triggered=true;f[e]()}}catch(n){}if(i)f["on"+e]=i;c.event.triggered=false}}},handle:function(a){var b,d,f,e;a=arguments[0]=c.event.fix(a||A.event);a.currentTarget=this;b=a.type.indexOf(".")<0&&!a.exclusive; +if(!b){d=a.type.split(".");a.type=d.shift();f=new RegExp("(^|\\.)"+d.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)")}e=c.data(this,"events");d=e[a.type];if(e&&d){d=d.slice(0);e=0;for(var j=d.length;e-1?c.map(a.options,function(f){return f.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d},fa=function(a,b){var d=a.target,f,e;if(!(!da.test(d.nodeName)||d.readOnly)){f=c.data(d,"_change_data");e=Fa(d);if(a.type!=="focusout"||d.type!=="radio")c.data(d,"_change_data", +e);if(!(f===w||e===f))if(f!=null||e){a.type="change";return c.event.trigger(a,b,d)}}};c.event.special.change={filters:{focusout:fa,click:function(a){var b=a.target,d=b.type;if(d==="radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return fa.call(this,a)},keydown:function(a){var b=a.target,d=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(d==="checkbox"||d==="radio")||d==="select-multiple")return fa.call(this,a)},beforeactivate:function(a){a=a.target;c.data(a, +"_change_data",Fa(a))}},setup:function(){if(this.type==="file")return false;for(var a in ea)c.event.add(this,a+".specialChange",ea[a]);return da.test(this.nodeName)},teardown:function(){c.event.remove(this,".specialChange");return da.test(this.nodeName)}};ea=c.event.special.change.filters}s.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(f){f=c.event.fix(f);f.type=b;return c.event.handle.call(this,f)}c.event.special[b]={setup:function(){this.addEventListener(a, +d,true)},teardown:function(){this.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,f,e){if(typeof d==="object"){for(var j in d)this[b](j,f,d[j],e);return this}if(c.isFunction(f)){e=f;f=w}var i=b==="one"?c.proxy(e,function(k){c(this).unbind(k,i);return e.apply(this,arguments)}):e;if(d==="unload"&&b!=="one")this.one(d,f,e);else{j=0;for(var o=this.length;j0){y=t;break}}t=t[g]}m[q]=y}}}var f=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g, +e=0,j=Object.prototype.toString,i=false,o=true;[0,0].sort(function(){o=false;return 0});var k=function(g,h,l,m){l=l||[];var q=h=h||s;if(h.nodeType!==1&&h.nodeType!==9)return[];if(!g||typeof g!=="string")return l;for(var p=[],v,t,y,S,H=true,M=x(h),I=g;(f.exec(""),v=f.exec(I))!==null;){I=v[3];p.push(v[1]);if(v[2]){S=v[3];break}}if(p.length>1&&r.exec(g))if(p.length===2&&n.relative[p[0]])t=ga(p[0]+p[1],h);else for(t=n.relative[p[0]]?[h]:k(p.shift(),h);p.length;){g=p.shift();if(n.relative[g])g+=p.shift(); +t=ga(g,t)}else{if(!m&&p.length>1&&h.nodeType===9&&!M&&n.match.ID.test(p[0])&&!n.match.ID.test(p[p.length-1])){v=k.find(p.shift(),h,M);h=v.expr?k.filter(v.expr,v.set)[0]:v.set[0]}if(h){v=m?{expr:p.pop(),set:z(m)}:k.find(p.pop(),p.length===1&&(p[0]==="~"||p[0]==="+")&&h.parentNode?h.parentNode:h,M);t=v.expr?k.filter(v.expr,v.set):v.set;if(p.length>0)y=z(t);else H=false;for(;p.length;){var D=p.pop();v=D;if(n.relative[D])v=p.pop();else D="";if(v==null)v=h;n.relative[D](y,v,M)}}else y=[]}y||(y=t);y||k.error(D|| +g);if(j.call(y)==="[object Array]")if(H)if(h&&h.nodeType===1)for(g=0;y[g]!=null;g++){if(y[g]&&(y[g]===true||y[g].nodeType===1&&E(h,y[g])))l.push(t[g])}else for(g=0;y[g]!=null;g++)y[g]&&y[g].nodeType===1&&l.push(t[g]);else l.push.apply(l,y);else z(y,l);if(S){k(S,q,l,m);k.uniqueSort(l)}return l};k.uniqueSort=function(g){if(B){i=o;g.sort(B);if(i)for(var h=1;h":function(g,h){var l=typeof h==="string";if(l&&!/\W/.test(h)){h=h.toLowerCase();for(var m=0,q=g.length;m=0))l||m.push(v);else if(l)h[p]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()}, +CHILD:function(g){if(g[1]==="nth"){var h=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=h[1]+(h[2]||1)-0;g[3]=h[3]-0}g[0]=e++;return g},ATTR:function(g,h,l,m,q,p){h=g[1].replace(/\\/g,"");if(!p&&n.attrMap[h])g[1]=n.attrMap[h];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,h,l,m,q){if(g[1]==="not")if((f.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=k(g[3],null,null,h);else{g=k.filter(g[3],h,l,true^q);l||m.push.apply(m, +g);return false}else if(n.match.POS.test(g[0])||n.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true);return g}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled===true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild},has:function(g,h,l){return!!k(l[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)}, +text:function(g){return"text"===g.type},radio:function(g){return"radio"===g.type},checkbox:function(g){return"checkbox"===g.type},file:function(g){return"file"===g.type},password:function(g){return"password"===g.type},submit:function(g){return"submit"===g.type},image:function(g){return"image"===g.type},reset:function(g){return"reset"===g.type},button:function(g){return"button"===g.type||g.nodeName.toLowerCase()==="button"},input:function(g){return/input|select|textarea|button/i.test(g.nodeName)}}, +setFilters:{first:function(g,h){return h===0},last:function(g,h,l,m){return h===m.length-1},even:function(g,h){return h%2===0},odd:function(g,h){return h%2===1},lt:function(g,h,l){return hl[3]-0},nth:function(g,h,l){return l[3]-0===h},eq:function(g,h,l){return l[3]-0===h}},filter:{PSEUDO:function(g,h,l,m){var q=h[1],p=n.filters[q];if(p)return p(g,l,h,m);else if(q==="contains")return(g.textContent||g.innerText||a([g])||"").indexOf(h[3])>=0;else if(q==="not"){h= +h[3];l=0;for(m=h.length;l=0}},ID:function(g,h){return g.nodeType===1&&g.getAttribute("id")===h},TAG:function(g,h){return h==="*"&&g.nodeType===1||g.nodeName.toLowerCase()===h},CLASS:function(g,h){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(h)>-1},ATTR:function(g,h){var l=h[1];g=n.attrHandle[l]?n.attrHandle[l](g):g[l]!=null?g[l]:g.getAttribute(l);l=g+"";var m=h[2];h=h[4];return g==null?m==="!=":m=== +"="?l===h:m==="*="?l.indexOf(h)>=0:m==="~="?(" "+l+" ").indexOf(h)>=0:!h?l&&g!==false:m==="!="?l!==h:m==="^="?l.indexOf(h)===0:m==="$="?l.substr(l.length-h.length)===h:m==="|="?l===h||l.substr(0,h.length+1)===h+"-":false},POS:function(g,h,l,m){var q=n.setFilters[h[2]];if(q)return q(g,l,h,m)}}},r=n.match.POS;for(var u in n.match){n.match[u]=new RegExp(n.match[u].source+/(?![^\[]*\])(?![^\(]*\))/.source);n.leftMatch[u]=new RegExp(/(^(?:.|\r|\n)*?)/.source+n.match[u].source.replace(/\\(\d+)/g,function(g, +h){return"\\"+(h-0+1)}))}var z=function(g,h){g=Array.prototype.slice.call(g,0);if(h){h.push.apply(h,g);return h}return g};try{Array.prototype.slice.call(s.documentElement.childNodes,0)}catch(C){z=function(g,h){h=h||[];if(j.call(g)==="[object Array]")Array.prototype.push.apply(h,g);else if(typeof g.length==="number")for(var l=0,m=g.length;l";var l=s.documentElement;l.insertBefore(g,l.firstChild);if(s.getElementById(h)){n.find.ID=function(m,q,p){if(typeof q.getElementById!=="undefined"&&!p)return(q=q.getElementById(m[1]))?q.id===m[1]||typeof q.getAttributeNode!=="undefined"&& +q.getAttributeNode("id").nodeValue===m[1]?[q]:w:[]};n.filter.ID=function(m,q){var p=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");return m.nodeType===1&&p&&p.nodeValue===q}}l.removeChild(g);l=g=null})();(function(){var g=s.createElement("div");g.appendChild(s.createComment(""));if(g.getElementsByTagName("*").length>0)n.find.TAG=function(h,l){l=l.getElementsByTagName(h[1]);if(h[1]==="*"){h=[];for(var m=0;l[m];m++)l[m].nodeType===1&&h.push(l[m]);l=h}return l};g.innerHTML=""; +if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")n.attrHandle.href=function(h){return h.getAttribute("href",2)};g=null})();s.querySelectorAll&&function(){var g=k,h=s.createElement("div");h.innerHTML="

";if(!(h.querySelectorAll&&h.querySelectorAll(".TEST").length===0)){k=function(m,q,p,v){q=q||s;if(!v&&q.nodeType===9&&!x(q))try{return z(q.querySelectorAll(m),p)}catch(t){}return g(m,q,p,v)};for(var l in g)k[l]=g[l];h=null}}(); +(function(){var g=s.createElement("div");g.innerHTML="
";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length===0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){n.order.splice(1,0,"CLASS");n.find.CLASS=function(h,l,m){if(typeof l.getElementsByClassName!=="undefined"&&!m)return l.getElementsByClassName(h[1])};g=null}}})();var E=s.compareDocumentPosition?function(g,h){return!!(g.compareDocumentPosition(h)&16)}: +function(g,h){return g!==h&&(g.contains?g.contains(h):true)},x=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false},ga=function(g,h){var l=[],m="",q;for(h=h.nodeType?[h]:h;q=n.match.PSEUDO.exec(g);){m+=q[0];g=g.replace(n.match.PSEUDO,"")}g=n.relative[g]?g+"*":g;q=0;for(var p=h.length;q=0===d})};c.fn.extend({find:function(a){for(var b=this.pushStack("","find",a),d=0,f=0,e=this.length;f0)for(var j=d;j0},closest:function(a,b){if(c.isArray(a)){var d=[],f=this[0],e,j= +{},i;if(f&&a.length){e=0;for(var o=a.length;e-1:c(f).is(e)){d.push({selector:i,elem:f});delete j[i]}}f=f.parentNode}}return d}var k=c.expr.match.POS.test(a)?c(a,b||this.context):null;return this.map(function(n,r){for(;r&&r.ownerDocument&&r!==b;){if(k?k.index(r)>-1:c(r).is(a))return r;r=r.parentNode}return null})},index:function(a){if(!a||typeof a=== +"string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){a=typeof a==="string"?c(a,b||this.context):c.makeArray(a);b=c.merge(this.get(),a);return this.pushStack(qa(a[0])||qa(b[0])?b:c.unique(b))},andSelf:function(){return this.add(this.prevObject)}});c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode", +d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a,2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")},nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling",d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")? +a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a,b){c.fn[a]=function(d,f){var e=c.map(this,b,d);eb.test(a)||(f=d);if(f&&typeof f==="string")e=c.filter(f,e);e=this.length>1?c.unique(e):e;if((this.length>1||gb.test(f))&&fb.test(a))e=e.reverse();return this.pushStack(e,a,R.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return c.find.matches(a,b)},dir:function(a,b,d){var f=[];for(a=a[b];a&&a.nodeType!==9&&(d===w||a.nodeType!==1||!c(a).is(d));){a.nodeType=== +1&&f.push(a);a=a[b]}return f},nth:function(a,b,d){b=b||1;for(var f=0;a;a=a[d])if(a.nodeType===1&&++f===b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&d.push(a);return d}});var Ja=/ jQuery\d+="(?:\d+|null)"/g,V=/^\s+/,Ka=/(<([\w:]+)[^>]*?)\/>/g,hb=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,La=/<([\w:]+)/,ib=/"},F={option:[1,""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]};F.optgroup=F.option;F.tbody=F.tfoot=F.colgroup=F.caption=F.thead;F.th=F.td;if(!c.support.htmlSerialize)F._default=[1,"div
","
"];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d= +c(this);d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==w)return this.empty().append((this[0]&&this[0].ownerDocument||s).createTextNode(a));return c.text(this)},wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this}, +wrapInner:function(a){if(c.isFunction(a))return this.each(function(b){c(this).wrapInner(a.call(this,b))});return this.each(function(){var b=c(this),d=b.contents();d.length?d.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a)})}, +prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this)});else if(arguments.length){var a=c(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b, +this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},remove:function(a,b){for(var d=0,f;(f=this[d])!=null;d++)if(!a||c.filter(a,[f]).length){if(!b&&f.nodeType===1){c.cleanData(f.getElementsByTagName("*"));c.cleanData([f])}f.parentNode&&f.parentNode.removeChild(f)}return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++)for(b.nodeType===1&&c.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild); +return this},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,f=this.ownerDocument;if(!d){d=f.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(Ja,"").replace(/=([^="'>\s]+\/)>/g,'="$1">').replace(V,"")],f)[0]}else return this.cloneNode(true)});if(a===true){ra(this,b);ra(this.find("*"),b.find("*"))}return b},html:function(a){if(a===w)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(Ja, +""):null;else if(typeof a==="string"&&!ta.test(a)&&(c.support.leadingWhitespace||!V.test(a))&&!F[(La.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Ka,Ma);try{for(var b=0,d=this.length;b0||e.cacheable||this.length>1?k.cloneNode(true):k)}o.length&&c.each(o,Qa)}return this}});c.fragments={};c.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){c.fn[a]=function(d){var f=[];d=c(d);var e=this.length===1&&this[0].parentNode;if(e&&e.nodeType===11&&e.childNodes.length===1&&d.length===1){d[b](this[0]); +return this}else{e=0;for(var j=d.length;e0?this.clone(true):this).get();c.fn[b].apply(c(d[e]),i);f=f.concat(i)}return this.pushStack(f,a,d.selector)}}});c.extend({clean:function(a,b,d,f){b=b||s;if(typeof b.createElement==="undefined")b=b.ownerDocument||b[0]&&b[0].ownerDocument||s;for(var e=[],j=0,i;(i=a[j])!=null;j++){if(typeof i==="number")i+="";if(i){if(typeof i==="string"&&!jb.test(i))i=b.createTextNode(i);else if(typeof i==="string"){i=i.replace(Ka,Ma);var o=(La.exec(i)||["", +""])[1].toLowerCase(),k=F[o]||F._default,n=k[0],r=b.createElement("div");for(r.innerHTML=k[1]+i+k[2];n--;)r=r.lastChild;if(!c.support.tbody){n=ib.test(i);o=o==="table"&&!n?r.firstChild&&r.firstChild.childNodes:k[1]===""&&!n?r.childNodes:[];for(k=o.length-1;k>=0;--k)c.nodeName(o[k],"tbody")&&!o[k].childNodes.length&&o[k].parentNode.removeChild(o[k])}!c.support.leadingWhitespace&&V.test(i)&&r.insertBefore(b.createTextNode(V.exec(i)[0]),r.firstChild);i=r.childNodes}if(i.nodeType)e.push(i);else e= +c.merge(e,i)}}if(d)for(j=0;e[j];j++)if(f&&c.nodeName(e[j],"script")&&(!e[j].type||e[j].type.toLowerCase()==="text/javascript"))f.push(e[j].parentNode?e[j].parentNode.removeChild(e[j]):e[j]);else{e[j].nodeType===1&&e.splice.apply(e,[j+1,0].concat(c.makeArray(e[j].getElementsByTagName("script"))));d.appendChild(e[j])}return e},cleanData:function(a){for(var b,d,f=c.cache,e=c.event.special,j=c.support.deleteExpando,i=0,o;(o=a[i])!=null;i++)if(d=o[c.expando]){b=f[d];if(b.events)for(var k in b.events)e[k]? +c.event.remove(o,k):Ca(o,k,b.handle);if(j)delete o[c.expando];else o.removeAttribute&&o.removeAttribute(c.expando);delete f[d]}}});var kb=/z-?index|font-?weight|opacity|zoom|line-?height/i,Na=/alpha\([^)]*\)/,Oa=/opacity=([^)]*)/,ha=/float/i,ia=/-([a-z])/ig,lb=/([A-Z])/g,mb=/^-?\d+(?:px)?$/i,nb=/^-?\d/,ob={position:"absolute",visibility:"hidden",display:"block"},pb=["Left","Right"],qb=["Top","Bottom"],rb=s.defaultView&&s.defaultView.getComputedStyle,Pa=c.support.cssFloat?"cssFloat":"styleFloat",ja= +function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){return X(this,a,b,true,function(d,f,e){if(e===w)return c.curCSS(d,f);if(typeof e==="number"&&!kb.test(f))e+="px";c.style(d,f,e)})};c.extend({style:function(a,b,d){if(!a||a.nodeType===3||a.nodeType===8)return w;if((b==="width"||b==="height")&&parseFloat(d)<0)d=w;var f=a.style||a,e=d!==w;if(!c.support.opacity&&b==="opacity"){if(e){f.zoom=1;b=parseInt(d,10)+""==="NaN"?"":"alpha(opacity="+d*100+")";a=f.filter||c.curCSS(a,"filter")||"";f.filter= +Na.test(a)?a.replace(Na,b):b}return f.filter&&f.filter.indexOf("opacity=")>=0?parseFloat(Oa.exec(f.filter)[1])/100+"":""}if(ha.test(b))b=Pa;b=b.replace(ia,ja);if(e)f[b]=d;return f[b]},css:function(a,b,d,f){if(b==="width"||b==="height"){var e,j=b==="width"?pb:qb;function i(){e=b==="width"?a.offsetWidth:a.offsetHeight;f!=="border"&&c.each(j,function(){f||(e-=parseFloat(c.curCSS(a,"padding"+this,true))||0);if(f==="margin")e+=parseFloat(c.curCSS(a,"margin"+this,true))||0;else e-=parseFloat(c.curCSS(a, +"border"+this+"Width",true))||0})}a.offsetWidth!==0?i():c.swap(a,ob,i);return Math.max(0,Math.round(e))}return c.curCSS(a,b,d)},curCSS:function(a,b,d){var f,e=a.style;if(!c.support.opacity&&b==="opacity"&&a.currentStyle){f=Oa.test(a.currentStyle.filter||"")?parseFloat(RegExp.$1)/100+"":"";return f===""?"1":f}if(ha.test(b))b=Pa;if(!d&&e&&e[b])f=e[b];else if(rb){if(ha.test(b))b="float";b=b.replace(lb,"-$1").toLowerCase();e=a.ownerDocument.defaultView;if(!e)return null;if(a=e.getComputedStyle(a,null))f= +a.getPropertyValue(b);if(b==="opacity"&&f==="")f="1"}else if(a.currentStyle){d=b.replace(ia,ja);f=a.currentStyle[b]||a.currentStyle[d];if(!mb.test(f)&&nb.test(f)){b=e.left;var j=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;e.left=d==="fontSize"?"1em":f||0;f=e.pixelLeft+"px";e.left=b;a.runtimeStyle.left=j}}return f},swap:function(a,b,d){var f={};for(var e in b){f[e]=a.style[e];a.style[e]=b[e]}d.call(a);for(e in b)a.style[e]=f[e]}});if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b= +a.offsetWidth,d=a.offsetHeight,f=a.nodeName.toLowerCase()==="tr";return b===0&&d===0&&!f?true:b>0&&d>0&&!f?false:c.curCSS(a,"display")==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var sb=J(),tb=//gi,ub=/select|textarea/i,vb=/color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,N=/=\?(&|$)/,ka=/\?/,wb=/(\?|&)_=.*?(&|$)/,xb=/^(\w+:)?\/\/([^\/?#]+)/,yb=/%20/g,zb=c.fn.load;c.fn.extend({load:function(a,b,d){if(typeof a!== +"string")return zb.call(this,a);else if(!this.length)return this;var f=a.indexOf(" ");if(f>=0){var e=a.slice(f,a.length);a=a.slice(0,f)}f="GET";if(b)if(c.isFunction(b)){d=b;b=null}else if(typeof b==="object"){b=c.param(b,c.ajaxSettings.traditional);f="POST"}var j=this;c.ajax({url:a,type:f,dataType:"html",data:b,complete:function(i,o){if(o==="success"||o==="notmodified")j.html(e?c("
").append(i.responseText.replace(tb,"")).find(e):i.responseText);d&&j.each(d,[i.responseText,o,i])}});return this}, +serialize:function(){return c.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||ub.test(this.nodeName)||vb.test(this.type))}).map(function(a,b){a=c(this).val();return a==null?null:c.isArray(a)?c.map(a,function(d){return{name:b.name,value:d}}):{name:b.name,value:a}}).get()}});c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "), +function(a,b){c.fn[b]=function(d){return this.bind(b,d)}});c.extend({get:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b=null}return c.ajax({type:"GET",url:a,data:b,success:d,dataType:f})},getScript:function(a,b){return c.get(a,null,b,"script")},getJSON:function(a,b,d){return c.get(a,b,d,"json")},post:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b={}}return c.ajax({type:"POST",url:a,data:b,success:d,dataType:f})},ajaxSetup:function(a){c.extend(c.ajaxSettings,a)},ajaxSettings:{url:location.href, +global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:A.XMLHttpRequest&&(A.location.protocol!=="file:"||!A.ActiveXObject)?function(){return new A.XMLHttpRequest}:function(){try{return new A.ActiveXObject("Microsoft.XMLHTTP")}catch(a){}},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},etag:{},ajax:function(a){function b(){e.success&& +e.success.call(k,o,i,x);e.global&&f("ajaxSuccess",[x,e])}function d(){e.complete&&e.complete.call(k,x,i);e.global&&f("ajaxComplete",[x,e]);e.global&&!--c.active&&c.event.trigger("ajaxStop")}function f(q,p){(e.context?c(e.context):c.event).trigger(q,p)}var e=c.extend(true,{},c.ajaxSettings,a),j,i,o,k=a&&a.context||e,n=e.type.toUpperCase();if(e.data&&e.processData&&typeof e.data!=="string")e.data=c.param(e.data,e.traditional);if(e.dataType==="jsonp"){if(n==="GET")N.test(e.url)||(e.url+=(ka.test(e.url)? +"&":"?")+(e.jsonp||"callback")+"=?");else if(!e.data||!N.test(e.data))e.data=(e.data?e.data+"&":"")+(e.jsonp||"callback")+"=?";e.dataType="json"}if(e.dataType==="json"&&(e.data&&N.test(e.data)||N.test(e.url))){j=e.jsonpCallback||"jsonp"+sb++;if(e.data)e.data=(e.data+"").replace(N,"="+j+"$1");e.url=e.url.replace(N,"="+j+"$1");e.dataType="script";A[j]=A[j]||function(q){o=q;b();d();A[j]=w;try{delete A[j]}catch(p){}z&&z.removeChild(C)}}if(e.dataType==="script"&&e.cache===null)e.cache=false;if(e.cache=== +false&&n==="GET"){var r=J(),u=e.url.replace(wb,"$1_="+r+"$2");e.url=u+(u===e.url?(ka.test(e.url)?"&":"?")+"_="+r:"")}if(e.data&&n==="GET")e.url+=(ka.test(e.url)?"&":"?")+e.data;e.global&&!c.active++&&c.event.trigger("ajaxStart");r=(r=xb.exec(e.url))&&(r[1]&&r[1]!==location.protocol||r[2]!==location.host);if(e.dataType==="script"&&n==="GET"&&r){var z=s.getElementsByTagName("head")[0]||s.documentElement,C=s.createElement("script");C.src=e.url;if(e.scriptCharset)C.charset=e.scriptCharset;if(!j){var B= +false;C.onload=C.onreadystatechange=function(){if(!B&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){B=true;b();d();C.onload=C.onreadystatechange=null;z&&C.parentNode&&z.removeChild(C)}}}z.insertBefore(C,z.firstChild);return w}var E=false,x=e.xhr();if(x){e.username?x.open(n,e.url,e.async,e.username,e.password):x.open(n,e.url,e.async);try{if(e.data||a&&a.contentType)x.setRequestHeader("Content-Type",e.contentType);if(e.ifModified){c.lastModified[e.url]&&x.setRequestHeader("If-Modified-Since", +c.lastModified[e.url]);c.etag[e.url]&&x.setRequestHeader("If-None-Match",c.etag[e.url])}r||x.setRequestHeader("X-Requested-With","XMLHttpRequest");x.setRequestHeader("Accept",e.dataType&&e.accepts[e.dataType]?e.accepts[e.dataType]+", */*":e.accepts._default)}catch(ga){}if(e.beforeSend&&e.beforeSend.call(k,x,e)===false){e.global&&!--c.active&&c.event.trigger("ajaxStop");x.abort();return false}e.global&&f("ajaxSend",[x,e]);var g=x.onreadystatechange=function(q){if(!x||x.readyState===0||q==="abort"){E|| +d();E=true;if(x)x.onreadystatechange=c.noop}else if(!E&&x&&(x.readyState===4||q==="timeout")){E=true;x.onreadystatechange=c.noop;i=q==="timeout"?"timeout":!c.httpSuccess(x)?"error":e.ifModified&&c.httpNotModified(x,e.url)?"notmodified":"success";var p;if(i==="success")try{o=c.httpData(x,e.dataType,e)}catch(v){i="parsererror";p=v}if(i==="success"||i==="notmodified")j||b();else c.handleError(e,x,i,p);d();q==="timeout"&&x.abort();if(e.async)x=null}};try{var h=x.abort;x.abort=function(){x&&h.call(x); +g("abort")}}catch(l){}e.async&&e.timeout>0&&setTimeout(function(){x&&!E&&g("timeout")},e.timeout);try{x.send(n==="POST"||n==="PUT"||n==="DELETE"?e.data:null)}catch(m){c.handleError(e,x,null,m);d()}e.async||g();return x}},handleError:function(a,b,d,f){if(a.error)a.error.call(a.context||a,b,d,f);if(a.global)(a.context?c(a.context):c.event).trigger("ajaxError",[b,a,f])},active:0,httpSuccess:function(a){try{return!a.status&&location.protocol==="file:"||a.status>=200&&a.status<300||a.status===304||a.status=== +1223||a.status===0}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"),f=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(f)c.etag[b]=f;return a.status===304||a.status===0},httpData:function(a,b,d){var f=a.getResponseHeader("content-type")||"",e=b==="xml"||!b&&f.indexOf("xml")>=0;a=e?a.responseXML:a.responseText;e&&a.documentElement.nodeName==="parsererror"&&c.error("parsererror");if(d&&d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b=== +"json"||!b&&f.indexOf("json")>=0)a=c.parseJSON(a);else if(b==="script"||!b&&f.indexOf("javascript")>=0)c.globalEval(a);return a},param:function(a,b){function d(i,o){if(c.isArray(o))c.each(o,function(k,n){b||/\[\]$/.test(i)?f(i,n):d(i+"["+(typeof n==="object"||c.isArray(n)?k:"")+"]",n)});else!b&&o!=null&&typeof o==="object"?c.each(o,function(k,n){d(i+"["+k+"]",n)}):f(i,o)}function f(i,o){o=c.isFunction(o)?o():o;e[e.length]=encodeURIComponent(i)+"="+encodeURIComponent(o)}var e=[];if(b===w)b=c.ajaxSettings.traditional; +if(c.isArray(a)||a.jquery)c.each(a,function(){f(this.name,this.value)});else for(var j in a)d(j,a[j]);return e.join("&").replace(yb,"+")}});var la={},Ab=/toggle|show|hide/,Bb=/^([+-]=)?([\d+-.]+)(.*)$/,W,va=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];c.fn.extend({show:function(a,b){if(a||a===0)return this.animate(K("show",3),a,b);else{a=0;for(b=this.length;a").appendTo("body");f=e.css("display");if(f==="none")f="block";e.remove();la[d]=f}c.data(this[a],"olddisplay",f)}}a=0;for(b=this.length;a=0;f--)if(d[f].elem===this){b&&d[f](true);d.splice(f,1)}});b||this.dequeue();return this}});c.each({slideDown:K("show",1),slideUp:K("hide",1),slideToggle:K("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(a,b){c.fn[a]=function(d,f){return this.animate(b,d,f)}});c.extend({speed:function(a,b,d){var f=a&&typeof a==="object"?a:{complete:d||!d&&b||c.isFunction(a)&&a,duration:a,easing:d&&b||b&&!c.isFunction(b)&&b};f.duration=c.fx.off?0:typeof f.duration=== +"number"?f.duration:c.fx.speeds[f.duration]||c.fx.speeds._default;f.old=f.complete;f.complete=function(){f.queue!==false&&c(this).dequeue();c.isFunction(f.old)&&f.old.call(this)};return f},easing:{linear:function(a,b,d,f){return d+f*a},swing:function(a,b,d,f){return(-Math.cos(a*Math.PI)/2+0.5)*f+d}},timers:[],fx:function(a,b,d){this.options=b;this.elem=a;this.prop=d;if(!b.orig)b.orig={}}});c.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(c.fx.step[this.prop]|| +c.fx.step._default)(this);if((this.prop==="height"||this.prop==="width")&&this.elem.style)this.elem.style.display="block"},cur:function(a){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];return(a=parseFloat(c.css(this.elem,this.prop,a)))&&a>-10000?a:parseFloat(c.curCSS(this.elem,this.prop))||0},custom:function(a,b,d){function f(j){return e.step(j)}this.startTime=J();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start; +this.pos=this.state=0;var e=this;f.elem=this.elem;if(f()&&c.timers.push(f)&&!W)W=setInterval(c.fx.tick,13)},show:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());c(this.elem).show()},hide:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(a){var b=J(),d=true;if(a||b>=this.options.duration+this.startTime){this.now= +this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var f in this.options.curAnim)if(this.options.curAnim[f]!==true)d=false;if(d){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;a=c.data(this.elem,"olddisplay");this.elem.style.display=a?a:this.options.display;if(c.css(this.elem,"display")==="none")this.elem.style.display="block"}this.options.hide&&c(this.elem).hide();if(this.options.hide||this.options.show)for(var e in this.options.curAnim)c.style(this.elem, +e,this.options.orig[e]);this.options.complete.call(this.elem)}return false}else{e=b-this.startTime;this.state=e/this.options.duration;a=this.options.easing||(c.easing.swing?"swing":"linear");this.pos=c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||a](this.state,e,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};c.extend(c.fx,{tick:function(){for(var a=c.timers,b=0;b
"; +a.insertBefore(b,a.firstChild);d=b.firstChild;f=d.firstChild;e=d.nextSibling.firstChild.firstChild;this.doesNotAddBorder=f.offsetTop!==5;this.doesAddBorderForTableAndCells=e.offsetTop===5;f.style.position="fixed";f.style.top="20px";this.supportsFixedPosition=f.offsetTop===20||f.offsetTop===15;f.style.position=f.style.top="";d.style.overflow="hidden";d.style.position="relative";this.subtractsBorderForOverflowNotVisible=f.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==j;a.removeChild(b); +c.offset.initialize=c.noop},bodyOffset:function(a){var b=a.offsetTop,d=a.offsetLeft;c.offset.initialize();if(c.offset.doesNotIncludeMarginInBodyOffset){b+=parseFloat(c.curCSS(a,"marginTop",true))||0;d+=parseFloat(c.curCSS(a,"marginLeft",true))||0}return{top:b,left:d}},setOffset:function(a,b,d){if(/static/.test(c.curCSS(a,"position")))a.style.position="relative";var f=c(a),e=f.offset(),j=parseInt(c.curCSS(a,"top",true),10)||0,i=parseInt(c.curCSS(a,"left",true),10)||0;if(c.isFunction(b))b=b.call(a, +d,e);d={top:b.top-e.top+j,left:b.left-e.left+i};"using"in b?b.using.call(a,d):f.css(d)}};c.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),d=this.offset(),f=/^body|html$/i.test(b[0].nodeName)?{top:0,left:0}:b.offset();d.top-=parseFloat(c.curCSS(a,"marginTop",true))||0;d.left-=parseFloat(c.curCSS(a,"marginLeft",true))||0;f.top+=parseFloat(c.curCSS(b[0],"borderTopWidth",true))||0;f.left+=parseFloat(c.curCSS(b[0],"borderLeftWidth",true))||0;return{top:d.top- +f.top,left:d.left-f.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||s.body;a&&!/^body|html$/i.test(a.nodeName)&&c.css(a,"position")==="static";)a=a.offsetParent;return a})}});c.each(["Left","Top"],function(a,b){var d="scroll"+b;c.fn[d]=function(f){var e=this[0],j;if(!e)return null;if(f!==w)return this.each(function(){if(j=wa(this))j.scrollTo(!a?f:c(j).scrollLeft(),a?f:c(j).scrollTop());else this[d]=f});else return(j=wa(e))?"pageXOffset"in j?j[a?"pageYOffset": +"pageXOffset"]:c.support.boxModel&&j.document.documentElement[d]||j.document.body[d]:e[d]}});c.each(["Height","Width"],function(a,b){var d=b.toLowerCase();c.fn["inner"+b]=function(){return this[0]?c.css(this[0],d,false,"padding"):null};c.fn["outer"+b]=function(f){return this[0]?c.css(this[0],d,false,f?"margin":"border"):null};c.fn[d]=function(f){var e=this[0];if(!e)return f==null?null:this;if(c.isFunction(f))return this.each(function(j){var i=c(this);i[d](f.call(this,j,i[d]()))});return"scrollTo"in +e&&e.document?e.document.compatMode==="CSS1Compat"&&e.document.documentElement["client"+b]||e.document.body["client"+b]:e.nodeType===9?Math.max(e.documentElement["client"+b],e.body["scroll"+b],e.documentElement["scroll"+b],e.body["offset"+b],e.documentElement["offset"+b]):f===w?c.css(e,d):this.css(d,typeof f==="string"?f:f+"px")}});A.jQuery=A.$=c})(window); diff --git a/mathjax/docs/build/_static/mathjax_mathml.user.js b/mathjax/docs/build/_static/mathjax_mathml.user.js new file mode 100644 index 000000000..5a98950c1 --- /dev/null +++ b/mathjax/docs/build/_static/mathjax_mathml.user.js @@ -0,0 +1,22 @@ +// ==UserScript== +// @name MathJax MathML +// @namespace http://www.mathjax.org/ +// @description Insert MathJax into pages containing MathML +// @include * +// ==/UserScript== + +if ((window.unsafeWindow == null ? window : unsafeWindow).MathJax == null) { + if ((document.getElementsByTagName("math").length > 0) || + (document.getElementsByTagNameNS == null ? false : + (document.getElementsByTagNameNS("http://www.w3.org/1998/Math/MathML","math").length > 0))) { + var script = document.createElement("script"); + script.src = "http://www.yoursite.edu/MathJax/MathJax.js"; // put your URL here + var config = 'MathJax.Hub.Config({' + + 'extensions:["mml2jax.js"],' + + 'jax:["input/MathML","output/HTML-CSS"]' + + '});' + + 'MathJax.Hub.Startup.onload()'; + if (window.opera) {script.innerHTML = config} else {script.text = config} + document.getElementsByTagName("head")[0].appendChild(script); + } +} diff --git a/mathjax/docs/build/_static/mathjax_wikipedia.user.js b/mathjax/docs/build/_static/mathjax_wikipedia.user.js new file mode 100644 index 000000000..3c0e7bc3b --- /dev/null +++ b/mathjax/docs/build/_static/mathjax_wikipedia.user.js @@ -0,0 +1,35 @@ +// ==UserScript== +// @name MathJax in Wikipedia +// @namespace http://www.mathjax.org/ +// @description Insert MathJax into Wikipedia pages +// @include http://en.wikipedia.org/wiki/* +// ==/UserScript== + +if ((window.unsafeWindow == null ? window : unsafeWindow).MathJax == null) { + // + // Replace the images with MathJax scripts of type math/tex + // + var images = document.getElementsByTagName('img'); + for (var i = images.length - 1; i >= 0; i--) { + var img = images[i]; + if (img.className === "tex") { + var script = document.createElement("script"); script.type = "math/tex"; + if (window.opera) {script.innerHTML = img.alt} else {script.text = img.alt} + img.parentNode.replaceChild(script,img); + } + } + // + // Load MathJax and have it process the page + // + var script = document.createElement("script"); + script.src = "http://www.yoursite.edu/MathJax/MathJax.js"; // put your URL here + var config = 'MathJax.Hub.Config({' + + 'config: ["MMLorHTML.js"],' + + 'extensions:["TeX/noErrors.js","TeX/noUndefined.js",' + + '"TeX/AMSmath.js","TeX/AMSsymbols.js"],' + + 'jax:["input/TeX"]' + + '});' + + 'MathJax.Hub.Startup.onload()'; + if (window.opera) {script.innerHTML = config} else {script.text = config} + document.getElementsByTagName("head")[0].appendChild(script); +} diff --git a/mathjax/docs/build/_static/minus.png b/mathjax/docs/build/_static/minus.png new file mode 100644 index 000000000..da1c5620d Binary files /dev/null and b/mathjax/docs/build/_static/minus.png differ diff --git a/mathjax/docs/build/_static/mj.css b/mathjax/docs/build/_static/mj.css new file mode 100644 index 000000000..ffb3b8ee5 --- /dev/null +++ b/mathjax/docs/build/_static/mj.css @@ -0,0 +1,223 @@ +/** + * Sphinx stylesheet -- default theme + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + */ + +@import url("basic.css"); + +/* -- page layout ----------------------------------------------------------- */ + +body { + font-family: sans-serif; + font-size: 100%; + background-color: #11303d; + color: #000; + margin: 0; + padding: 0; +} + +div.document { + background-color: #d4e9f7; +} + +div.documentwrapper { + float: left; + width: 100%; +} + +div.bodywrapper { + margin: 0 0 0 230px; +} + +div.body { + background-color: #ffffff; + color: #222222; + padding: 0 20px 30px 20px; +} + +div.footer { + color: #ffffff; + width: 100%; + padding: 9px 0 9px 0; + text-align: center; + font-size: 75%; +} + +div.footer a { + color: #ffffff; + text-decoration: underline; +} + +div.related { + background-color: #191a19; + line-height: 30px; + color: #ffffff; +} + +div.related a { + color: #ffffff; +} + +div.sphinxsidebar { +} + +div.sphinxsidebar h3 { + font-family: 'Trebuchet MS', sans-serif; + color: #3a3a3a; + font-size: 1.4em; + font-weight: normal; + margin: 0; + padding: 0; +} + +div.sphinxsidebar h3 a { + color: #3a3a3a; +} + +div.sphinxsidebar h4 { + font-family: 'Trebuchet MS', sans-serif; + color: #3a3a3a; + font-size: 1.3em; + font-weight: normal; + margin: 5px 0 0 0; + padding: 0; +} + +div.sphinxsidebar p { + color: #3a3a3a; +} + +div.sphinxsidebar p.topless { + margin: 5px 10px 10px 10px; +} + +div.sphinxsidebar ul { + margin: 10px; + padding: 0; + color: #3a3a3a; +} + +div.sphinxsidebar ul li { + margin-top: .2em; +} + +div.sphinxsidebar a { + color: #3a8942; +} + +div.sphinxsidebar input { + border: 1px solid #3a8942; + font-family: sans-serif; + font-size: 1em; +} + +/* -- body styles ----------------------------------------------------------- */ + +a { + color: #355f7c; + 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: 'Trebuchet MS', sans-serif; + background-color: #f2f2f2; + font-weight: normal; + color: #20435c; + border-top: 1px solid #cccccc; + border-bottom: 2px solid #cccccc; + 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: #c60f0f; + font-size: 0.8em; + padding: 0 4px 0 4px; + text-decoration: none; +} + +a.headerlink:hover { + background-color: #c60f0f; + 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: #f1f8ff; + color: #333333; + line-height: 130%; + border: 2px solid #6799b3; + 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; +} \ No newline at end of file diff --git a/mathjax/docs/build/_static/plus.png b/mathjax/docs/build/_static/plus.png new file mode 100644 index 000000000..b3cb37425 Binary files /dev/null and b/mathjax/docs/build/_static/plus.png differ diff --git a/mathjax/docs/build/_static/pygments.css b/mathjax/docs/build/_static/pygments.css new file mode 100644 index 000000000..1f2d2b618 --- /dev/null +++ b/mathjax/docs/build/_static/pygments.css @@ -0,0 +1,61 @@ +.hll { background-color: #ffffcc } +.c { color: #408090; font-style: italic } /* Comment */ +.err { border: 1px solid #FF0000 } /* Error */ +.k { color: #007020; font-weight: bold } /* Keyword */ +.o { color: #666666 } /* Operator */ +.cm { color: #408090; font-style: italic } /* Comment.Multiline */ +.cp { color: #007020 } /* Comment.Preproc */ +.c1 { color: #408090; font-style: italic } /* Comment.Single */ +.cs { color: #408090; background-color: #fff0f0 } /* Comment.Special */ +.gd { color: #A00000 } /* Generic.Deleted */ +.ge { font-style: italic } /* Generic.Emph */ +.gr { color: #FF0000 } /* Generic.Error */ +.gh { color: #000080; font-weight: bold } /* Generic.Heading */ +.gi { color: #00A000 } /* Generic.Inserted */ +.go { color: #303030 } /* Generic.Output */ +.gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */ +.gs { font-weight: bold } /* Generic.Strong */ +.gu { color: #800080; font-weight: bold } /* Generic.Subheading */ +.gt { color: #0040D0 } /* Generic.Traceback */ +.kc { color: #007020; font-weight: bold } /* Keyword.Constant */ +.kd { color: #007020; font-weight: bold } /* Keyword.Declaration */ +.kn { color: #007020; font-weight: bold } /* Keyword.Namespace */ +.kp { color: #007020 } /* Keyword.Pseudo */ +.kr { color: #007020; font-weight: bold } /* Keyword.Reserved */ +.kt { color: #902000 } /* Keyword.Type */ +.m { color: #208050 } /* Literal.Number */ +.s { color: #4070a0 } /* Literal.String */ +.na { color: #4070a0 } /* Name.Attribute */ +.nb { color: #007020 } /* Name.Builtin */ +.nc { color: #0e84b5; font-weight: bold } /* Name.Class */ +.no { color: #60add5 } /* Name.Constant */ +.nd { color: #555555; font-weight: bold } /* Name.Decorator */ +.ni { color: #d55537; font-weight: bold } /* Name.Entity */ +.ne { color: #007020 } /* Name.Exception */ +.nf { color: #06287e } /* Name.Function */ +.nl { color: #002070; font-weight: bold } /* Name.Label */ +.nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */ +.nt { color: #062873; font-weight: bold } /* Name.Tag */ +.nv { color: #bb60d5 } /* Name.Variable */ +.ow { color: #007020; font-weight: bold } /* Operator.Word */ +.w { color: #bbbbbb } /* Text.Whitespace */ +.mf { color: #208050 } /* Literal.Number.Float */ +.mh { color: #208050 } /* Literal.Number.Hex */ +.mi { color: #208050 } /* Literal.Number.Integer */ +.mo { color: #208050 } /* Literal.Number.Oct */ +.sb { color: #4070a0 } /* Literal.String.Backtick */ +.sc { color: #4070a0 } /* Literal.String.Char */ +.sd { color: #4070a0; font-style: italic } /* Literal.String.Doc */ +.s2 { color: #4070a0 } /* Literal.String.Double */ +.se { color: #4070a0; font-weight: bold } /* Literal.String.Escape */ +.sh { color: #4070a0 } /* Literal.String.Heredoc */ +.si { color: #70a0d0; font-style: italic } /* Literal.String.Interpol */ +.sx { color: #c65d09 } /* Literal.String.Other */ +.sr { color: #235388 } /* Literal.String.Regex */ +.s1 { color: #4070a0 } /* Literal.String.Single */ +.ss { color: #517918 } /* Literal.String.Symbol */ +.bp { color: #007020 } /* Name.Builtin.Pseudo */ +.vc { color: #bb60d5 } /* Name.Variable.Class */ +.vg { color: #bb60d5 } /* Name.Variable.Global */ +.vi { color: #bb60d5 } /* Name.Variable.Instance */ +.il { color: #208050 } /* Literal.Number.Integer.Long */ \ No newline at end of file diff --git a/mathjax/docs/build/_static/searchtools.js b/mathjax/docs/build/_static/searchtools.js new file mode 100644 index 000000000..513a7bad3 --- /dev/null +++ b/mathjax/docs/build/_static/searchtools.js @@ -0,0 +1,505 @@ +/* + * searchtools.js + * ~~~~~~~~~~~~~~ + * + * Sphinx JavaScript utilties for the full-text search. + * + * :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + * :license: BSD, see LICENSE for details. + * + */ + +/** + * helper function to return a node containing the + * search summary for a given text. keywords is a list + * of stemmed words, hlwords is the list of normal, unstemmed + * words. the first one is used to find the occurance, the + * latter for highlighting it. + */ + +jQuery.makeSearchSummary = function(text, keywords, hlwords) { + var textLower = text.toLowerCase(); + var start = 0; + $.each(keywords, function() { + var i = textLower.indexOf(this.toLowerCase()); + if (i > -1) + start = i; + }); + start = Math.max(start - 120, 0); + var excerpt = ((start > 0) ? '...' : '') + + $.trim(text.substr(start, 240)) + + ((start + 240 - text.length) ? '...' : ''); + var rv = $('
').text(excerpt); + $.each(hlwords, function() { + rv = rv.highlightText(this, 'highlighted'); + }); + return rv; +} + +/** + * Porter Stemmer + */ +var PorterStemmer = function() { + + var step2list = { + ational: 'ate', + tional: 'tion', + enci: 'ence', + anci: 'ance', + izer: 'ize', + bli: 'ble', + alli: 'al', + entli: 'ent', + eli: 'e', + ousli: 'ous', + ization: 'ize', + ation: 'ate', + ator: 'ate', + alism: 'al', + iveness: 'ive', + fulness: 'ful', + ousness: 'ous', + aliti: 'al', + iviti: 'ive', + biliti: 'ble', + logi: 'log' + }; + + var step3list = { + icate: 'ic', + ative: '', + alize: 'al', + iciti: 'ic', + ical: 'ic', + ful: '', + ness: '' + }; + + var c = "[^aeiou]"; // consonant + var v = "[aeiouy]"; // vowel + var C = c + "[^aeiouy]*"; // consonant sequence + var V = v + "[aeiou]*"; // vowel sequence + + var mgr0 = "^(" + C + ")?" + V + C; // [C]VC... is m>0 + var meq1 = "^(" + C + ")?" + V + C + "(" + V + ")?$"; // [C]VC[V] is m=1 + var mgr1 = "^(" + C + ")?" + V + C + V + C; // [C]VCVC... is m>1 + var s_v = "^(" + C + ")?" + v; // vowel in stem + + this.stemWord = function (w) { + var stem; + var suffix; + var firstch; + var origword = w; + + if (w.length < 3) + return w; + + var re; + var re2; + var re3; + var re4; + + firstch = w.substr(0,1); + if (firstch == "y") + w = firstch.toUpperCase() + w.substr(1); + + // Step 1a + re = /^(.+?)(ss|i)es$/; + re2 = /^(.+?)([^s])s$/; + + if (re.test(w)) + w = w.replace(re,"$1$2"); + else if (re2.test(w)) + w = w.replace(re2,"$1$2"); + + // Step 1b + re = /^(.+?)eed$/; + re2 = /^(.+?)(ed|ing)$/; + if (re.test(w)) { + var fp = re.exec(w); + re = new RegExp(mgr0); + if (re.test(fp[1])) { + re = /.$/; + w = w.replace(re,""); + } + } + else if (re2.test(w)) { + var fp = re2.exec(w); + stem = fp[1]; + re2 = new RegExp(s_v); + if (re2.test(stem)) { + w = stem; + re2 = /(at|bl|iz)$/; + re3 = new RegExp("([^aeiouylsz])\\1$"); + re4 = new RegExp("^" + C + v + "[^aeiouwxy]$"); + if (re2.test(w)) + w = w + "e"; + else if (re3.test(w)) { + re = /.$/; + w = w.replace(re,""); + } + else if (re4.test(w)) + w = w + "e"; + } + } + + // Step 1c + re = /^(.+?)y$/; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + re = new RegExp(s_v); + if (re.test(stem)) + w = stem + "i"; + } + + // Step 2 + re = /^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + suffix = fp[2]; + re = new RegExp(mgr0); + if (re.test(stem)) + w = stem + step2list[suffix]; + } + + // Step 3 + re = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + suffix = fp[2]; + re = new RegExp(mgr0); + if (re.test(stem)) + w = stem + step3list[suffix]; + } + + // Step 4 + re = /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/; + re2 = /^(.+?)(s|t)(ion)$/; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + re = new RegExp(mgr1); + if (re.test(stem)) + w = stem; + } + else if (re2.test(w)) { + var fp = re2.exec(w); + stem = fp[1] + fp[2]; + re2 = new RegExp(mgr1); + if (re2.test(stem)) + w = stem; + } + + // Step 5 + re = /^(.+?)e$/; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + re = new RegExp(mgr1); + re2 = new RegExp(meq1); + re3 = new RegExp("^" + C + v + "[^aeiouwxy]$"); + if (re.test(stem) || (re2.test(stem) && !(re3.test(stem)))) + w = stem; + } + re = /ll$/; + re2 = new RegExp(mgr1); + if (re.test(w) && re2.test(w)) { + re = /.$/; + w = w.replace(re,""); + } + + // and turn initial Y back to y + if (firstch == "y") + w = firstch.toLowerCase() + w.substr(1); + return w; + } +} + + +/** + * Search Module + */ +var Search = { + + _index : null, + _queued_query : null, + _pulse_status : -1, + + init : function() { + var params = $.getQueryParameters(); + if (params.q) { + var query = params.q[0]; + $('input[name="q"]')[0].value = query; + this.performSearch(query); + } + }, + + loadIndex : function(url) { + $.ajax({type: "GET", url: url, data: null, success: null, + dataType: "script", cache: true}); + }, + + setIndex : function(index) { + var q; + this._index = index; + if ((q = this._queued_query) !== null) { + this._queued_query = null; + Search.query(q); + } + }, + + hasIndex : function() { + return this._index !== null; + }, + + deferQuery : function(query) { + this._queued_query = query; + }, + + stopPulse : function() { + this._pulse_status = 0; + }, + + startPulse : function() { + if (this._pulse_status >= 0) + return; + function pulse() { + Search._pulse_status = (Search._pulse_status + 1) % 4; + var dotString = ''; + for (var i = 0; i < Search._pulse_status; i++) + dotString += '.'; + Search.dots.text(dotString); + if (Search._pulse_status > -1) + window.setTimeout(pulse, 500); + }; + pulse(); + }, + + /** + * perform a search for something + */ + performSearch : function(query) { + // create the required interface elements + this.out = $('#search-results'); + this.title = $('

' + _('Searching') + '

').appendTo(this.out); + this.dots = $('').appendTo(this.title); + this.status = $('

').appendTo(this.out); + this.output = $('