Code Monkey home page Code Monkey logo

mathjax-docs's Introduction

MathJax

Beautiful math in all browsers

GitHub release version GitHub release version (v2) NPM version powered by NumFOCUS
jsdelivr rank jsDelivr hits (npm) npm monthly downloads (full) npm total downloads

MathJax is an open-source JavaScript display engine for LaTeX, MathML, and AsciiMath notation that works in all modern browsers. It was designed with the goal of consolidating the recent advances in web technologies into a single, definitive, math-on-the-web platform supporting the major browsers and operating systems. It requires no setup on the part of the user (no plugins to download or software to install), so the page author can write web documents that include mathematics and be confident that users will be able to view it naturally and easily. Simply include MathJax and some mathematics in a web page, and MathJax does the rest.

Some of the main features of MathJax include:

  • High-quality display of LaTeX, MathML, and AsciiMath notation in HTML pages

  • Supported in most browsers with no plug-ins, extra fonts, or special setup for the reader

  • Easy for authors, flexible for publishers, extensible for developers

  • Supports math accessibility, cut-and-paste interoperability, and other advanced functionality

  • Powerful API for integration with other web applications

See http://www.mathjax.org/ for additional details about MathJax, and https://docs.mathjax.org for the MathJax documentation.

MathJax Components

MathJax version 3 uses files called components that contain the various MathJax modules that you can include in your web pages or access on a server through NodeJS. Some components combine all the pieces you need to run MathJax with one or more input formats and a particular output format, while other components are pieces that can be loaded on demand when needed, or by a configuration that specifies the pieces you want to combine in a custom way. For usage instructions, see the MathJax documentation.

Components provide a convenient packaging of MathJax's modules, but it is possible for you to form your own custom components, or to use MathJax's modules directly in a node application on a server. There are web examples showing how to use MathJax in web pages and how to build your own components, and node examples illustrating how to use components in node applications or call MathJax modules directly.

What's in this Repository

This repository contains only the component files for MathJax, not the source code for MathJax (which are available in a separate MathJax source repository). These component files are the ones served by the CDNs that offer MathJax to the web. In version 2, the files used on the web were also the source files for MathJax, but in version 3, the source files are no longer on the CDN, as they are not what are run in the browser.

The components are stored in the es5 directory, and are in ES5 format for the widest possible compatibility. In the future, we may make an es6 directory containing ES6 versions of the components.

Installation and Use

Using MathJax components from a CDN on the web

If you are loading MathJax from a CDN into a web page, there is no need to install anything. Simply use a script tag that loads MathJax from the CDN. E.g.,

<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>

See the MathJax documentation, the MathJax Web Demos, and the MathJax Component Repository for more information.

Hosting your own copy of the MathJax Components

If you want to host MathJax from your own server, you can do so by installing the mathjax package using npm and moving the es5 directory to an appropriate location on your server:

npm install mathjax@3
mv node_modules/mathjax/es5 <path-to-server-location>/mathjax

Note that we are still making updates to version 2, so include @3 when you install, since the latest chronological version may not be version 3.

Alternatively, you can get the files via GitHub:

git clone https://github.com/mathjax/MathJax.git mj-tmp
mv mj-tmp/es5 <path-to-server-location>/mathjax
rm -rf mj-tmp

Then (in either case) you can use a script tag like the following:

<script id="MathJax-script" async src="<url-to-your-site>/mathjax/tex-chtml.js"></script>

where <url-to-your-site> is replaced by the URL to the location where you moved the MathJax files above.

See the documentation for details.

Using MathJax components in a node application

To use MathJax components in a node application, install the mathjax package:

npm install mathjax@3

(we are still making updates to version 2, so you should include @3 since the latest chronological version may not be version 3).

Then require mathjax within your application:

require('mathjax').init({ ... }).then((MathJax) => { ... });

where the first { ... } is a MathJax configuration, and the second { ... } is the code to run after MathJax has been loaded. E.g.

require('mathjax').init({
  loader: {load: ['input/tex', 'output/svg']}
}).then((MathJax) => {
  const svg = MathJax.tex2svg('\\frac{1}{x^2-1}', {display: true});
  console.log(MathJax.startup.adaptor.outerHTML(svg));
}).catch((err) => console.log(err.message));

Note: this technique is for node-based application only, not for browser applications. This method sets up an alternative DOM implementation, which you don't need in the browser, and tells MathJax to use node's require() command to load external modules. This setup will not work properly in the browser, even if you webpack it or bundle it in other ways.

See the documentation and the MathJax Node Repository for more details.

Reducing the Size of the Components Directory

Since the es5 directory contains all the component files, so if you are only planning one use one configuration, you can reduce the size of the MathJax directory by removing unused components. For example, if you are using the tex-chtml.js component, then you can remove the tex-mml-chtml.js, tex-svg.js, tex-mml-svg.js, tex-chtml-full.js, and tex-svg-full.js configurations, which will save considerable space. Indeed, you should be able to remove everything other than tex-chtml.js, and the input/tex/extensions, output/chtml/fonts/woff-v2, adaptors, a11y, and sre directories. If you are using the results only on the web, you can remove adaptors as well.

If you are not using A11Y support (e.g., speech generation, or semantic enrichment), then you can remove a11y and sre as well (though in this case you may need to disable the assistive tools in the MathJax contextual menu in order to avoid MathJax trying to load them when they aren't there).

If you are using SVG rather than CommonHTML output (e.g., tex-svg.js rather than tex-chtml.js), you can remove the output/chtml/fonts/woff-v2 directory. If you are using MathML input rather than TeX (e.g., mml-chtml.js rather than tex-chtml.js), then you can remove input/tex/extensions as well.

The Component Files and Pull Requests

The es5 directory is generated automatically from the contents of the MathJax source repository. You can rebuild the components using the command

npm run make-es5 --silent

Note that since the contents of this repository are generated automatically, you should not submit pull requests that modify the contents of the es5 directory. If you wish to submit a modification to MathJax, you should make a pull request in the MathJax source repository.

MathJax Community

The main MathJax website is http://www.mathjax.org, and it includes announcements and other important information. A MathJax user forum for asking questions and getting assistance is hosted at Google, and the MathJax bug tracker is hosted at GitHub.

Before reporting a bug, please check that it has not already been reported. Also, please use the bug tracker (rather than the help forum) for reporting bugs, and use the user's forum (rather than the bug tracker) for questions about how to use MathJax.

MathJax Resources

mathjax-docs's People

Contributors

adereth avatar appius avatar arthur-milchior avatar bgeron avatar cclauss avatar charlesanifowose avatar christianp avatar chrisyeh96 avatar dainiak avatar debenben avatar dpvc avatar fred-wang avatar jfinkels avatar jimmygilles avatar klortho avatar marcelbolten avatar mark-wiemer avatar mhchem avatar mitya57 avatar nathancarter avatar oskartom avatar peterdavehello avatar pkra avatar richardmorris avatar rnwst avatar shaunix avatar sirivasv avatar therzka avatar thomascamminady avatar zorkow avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mathjax-docs's Issues

Add an overview over font options

The supported fonts are listed in both output processors. Users want to find this information easily when they run into font issues (missing glyphs, etc). Let's create a page in the "Basic Usage" section.

Document toMathML.js

It's mentioned in the combined configurations section but there's no documentation (except on the wiki, I suppose)

2.5 release work

  • Update the https://github.com/mathjax/MathJax/wiki/Documentation-update-process
    • create 2.5 branch
    • merge 2.5 branch into master -- #83
    • Create What's New page
  • CommomHTML work
    • document new CommonHTML output
    • document CHTML-Preview extension
    • update combined configuration page.
  • document MathML extensions
    • Content MathML extension (in particular, customization)
    • mml3 extension
    • update MathML.rst -- #69
  • Tweak Getting Started
  • document handle-floats -- #84
  • document attribute preservation -- mathjax/MathJax#860
  • update whats-new with bugs that came in during the beta run
  • document clearing listeners -- mathjax/MathJax#693 =>pushing this out of the release.

middle-button on doc pages

Latest chrome. By pressing the middle mouse button on a link opens the target page "in place". For browsers default behavior - in a new tab.

Unclear documentation organized. My case is simple - looking for code examples for the substitution in a web page.To find the information is necessary to read and view unnecessary things.

Indicate where MathJax's LaTeX is stricter

I remember that some of our commands are stricter. I think \mod is one of them (\mod{} works but \mod does not).

I would like to markup the TeX documentation to indicate those commands. @dpvc could you list them here?

fix asciimath link in start

http://docs.mathjax.org/en/latest/start.html uses a relative link for the asciimathml example. (I wasn't sure about the repository structure right now, so I didn't want to edit this in master. Will check before v2.4 comes out)

Fix FAQ on IE compatibility

As per #53 (comment)

This is outdated and is now contra-indicated (this makes IE9+ slower). The current suggestion is IE=Edge. The text probably needs to be adjusted as well.

Suggest <script async> everywhere

HTML5 async attribute is probably the right recommendation to make in the docs (and on mathjax.org). Non-HTML5 browser apparently ignore it so there's no risk.

Not a huge save but still worth it.

References.

Documentation for MathJax signals

I did not find any exhaustive list of signals that MathJax can send, except those mentioned in the MathJax startup sequence. We should probably add such a list in the user documentation.

Adjustements to the start page

I would like to have http://docs.mathjax.org/en/latest/options/index.html#configuration-options-by-component on the front page. Here's a proposal

Basic Usage

  • What is MathJax?
  • Getting Started with MathJax
  • Installing and Testing MathJax
  • Loading and Configuring MathJax
  • Common MathJax Configurations
  • Using MathJax in Web Platforms
  • MathJax TeX and LaTeX Support
  • MathJax MathML Support
  • MathJax AsciiMath Support
  • MathJax Output Formats
  • MathJax Localization
  • MathJax Safe-mode
  • The MathJax Community

MathJax Configuration Options

  • Configuration Objects (http://docs.mathjax.org/en/latest/options/index.html)
  • The core options
  • The tex2jax preprocessor options
  • The mml2jax preprocessor options
  • The asciimath2jax preprocessor options
  • The jsMath2jax preprocessor options
  • The TeX input processor options
  • The MathML input processor options
  • The AsciiMath input processor options
  • The HTML-CSS output processor options
  • The NativeMML output processor options
  • The SVG output processor options
  • The MMLorHTML configuration options
  • The MathMenu options
  • The MathZoom options
  • The MathEvents options
  • The FontWarnings options
  • The Safe options

...

Document noReflows option for HTML-CSS

noReflows:true is the default. Tells HTML-CSS to not make certain measurements (which cause reflows), thereby gaining speed. Can lead to minor issues in rendering quality.

some restructuring

I finally figured out how to redirect latest to any branch (dark and hidden corner of the readthedocs dashboard...).

This means we can get rid of the complications of keeping the latest version branch in sync with master -- we'll configure readthedocs to present 2.3-latest at latest (and part of the release process will be to switch this at readthedocs).

For the above, we should get rid of the version warning for the latest version. But we may as well do that in general since we include canonical links to latest now which has cleared up the page rank (no more people coming from Google to the wrong version). (And while we're at it, we could switch to the new readthdocs theme.)

Fix dead links to mathjax.org

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.