Giter Club home page Giter Club logo

mathjax-third-party-extensions'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-third-party-extensions's People

Contributors

burnpanck avatar dainiak avatar dpvc avatar drlippman avatar evgenystan avatar ickc avatar mhchem avatar nabijaczleweli avatar omarithawi avatar pkra 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

Watchers

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

mathjax-third-party-extensions's Issues

Line integral rendering

I found a cosmetic difference when a line integrals are rendered:
image

In every math book all the integrals are never straight (vertically). I would expect the \ointctrclockwise and \varointclockwise would render like \oint.

What do you think?

[IMPORTANT] MathJax CDN end-of-life & suggested changes to third-party extensions

As you may have heard, will be shutting down the CDN hosting at cdn.mathjax.org on April 30, cf. https://www.mathjax.org/cdn-shutting-down/.

As part of this, we need to migrate the third party extensions to a different setup.

We decided that the current repository structure will be retired in favor of separate repositories (one per extensions).

This repository will continue to provide documentation on existing third party extensions.

Suggested changes for maintainers

  • Create a separate repository for your extension
    • If you're worknig on a fork of this repository, you can trim your fork, e.g., using this guide.
  • Update the loadComplete calls to individual prefixes,
    • Please don't use [Contrib] but use unique prefixes such as [MyExtension]
    • Note: a clash of your prefix with another extension's prefix will usually mean that people can't use both extensions at the same time.
  • Tag individual releases to allow version specific loading.
  • Submit your extensions to a free CDN such as cdnjs or jsdelivr
    • alternatively extensions can be loaded from rawgit.com

actuarialsymbol - MathJax Third party extension

Hi!

I'm trying to create a MathJax extension to mimic the actuarialsymbol and actuarialangle LaTex package. Here is a demonstration of some of the implemented features. I am a little confused on how to publish my work in MathJax 3.1 since all extensions seem to have been created in earlier versions.

Can someone give me some cues on how I should do it?

Thanks!

Actuarial Symbol extension

simple stmaryrd extension

I once started this (thanks to some helpful data from @AmerMathSoc), containing macros for those St Mary Rd glyphs that have Unicode positions.

Maybe somebody wants to take this further.

Post mathod or Get mathod sending value twice

when i am trying to use this extension it working but when user fill form and click submit button on target page when we seeing GET values i am seeing 2 GET value of same name 1 is null and another is typed value so that is why PHP or JAVASCRIPT is unable to see value
please fix it

[siunitx] Typesetting uncertainties in scientific notation

The following works just fine in LaTeX:

\SI{1}{\electronvolt} = \SI{1.602176621(98)e-19}{\joule}

However, when rendered using MathJax I have

1 eV = 1.602176621(98)e - 19 J

Where e - 19 shows up instead of the \times usual scientific notation. The package works fine when using regular decimals though.

To render properly I had to use the following workaround:

\SI{1}{\electronvolt} = \num{1.602176621(98)}\times 10^{-19}\,\si{\joule}

Is there a way to typeset this properly? I couldn't find anything similar in the package reference.

[siunitx] \percent not working

I just noticed that the \percent command doesn't work properly in this MathJax extension, while it perfectly works in the "true" LaTeX package.

Here is my command and it's error:

\SI{95}{/percent}

Error: undefined is not an object (evaluating 'n.apply')
file: https://cdn.mathjax.org/mathjax/2.7-latest/jax/input/TeX/jax.js?V=2.7.0
line: 19
Debugging tips: use 'unpacked/MathJax.js', inspect 'MathJax.Hub.lastError' in the browser console

I hope it helps in resolving the bug. For any more details, you can contact me.

[siunitx] Support for sisetup and DeclareSIUnit

Just wondering if sisetup and DeclareSIUnit are supported. Because I cannot figure out how to make them work.

Specifically in my case:

#+latex_header: \DeclareSIUnit\Molar{\textsc{m}}
#+latex_header: \sisetup{per-mode=symbol}

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.