Socket
Socket
Sign inDemoInstall

mathlive

Package Overview
Dependencies
0
Maintainers
1
Versions
170
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

mathlive


Version published
Maintainers
1
Install size
3.89 MB
Created

Readme

Source
math live

Maintenance GitHub license

Build Status Greenkeeper badge David

Screenshot

MathLive is a JavaScript library to render and edit math.

  • Tex-quality typesetting
  • Easy to use interface for math editing
  • Fast and small
  • Works great on desktop and on mobile devices thanks to an extensive set of virtual keyboards
  • Outputs LaTeX, MathML and JSON (Abstract Syntax Tree, MASTON)**
  • And it is easy to customize to your needs!

Try it at mathlive.io

The popover panel A Virtual Keyboard
The Loop Equation

How To Use MathLive

To display math

You can use MathLive to simply render math equations by adding a few lines to your web page.

<!doctype html><html lang="en-US">
<head>
    ...
    <link rel="stylesheet" href="https://unpkg.com/mathlive/dist/mathlive.core.css">
    <link rel="stylesheet" href="https://unpkg.com/mathlive/dist/mathlive.css">
    <script src="https://unpkg.com/mathlive"></script>
</head>
<body>
    <h1>Euler's Identity</h1>
    <p>$$e^{i\pi} + 1 = 0$$</p> 

    <script> 
        MathLive.renderMathInDocument();
    </script>
</body>
</html>

To edit math

You can also incorporate a “math field” to edit math just like you would edit text. The MathLive APIs allow you to interact with the math field, including extracting its content, inserting placeholders and more.

<!doctype html><html lang="en-US">
<head>
    ...
    <link rel="stylesheet" href="https://unpkg.com/mathlive/dist/mathlive.core.css">
    <link rel="stylesheet" href="https://unpkg.com/mathlive/dist/mathlive.css">
</head>
<body>
    <div id='mathfield'>f(x)=</div>

    <script type='module'> 
        import MathLive from 'https://unpkg.com/mathlive/dist/mathlive.mjs';
        MathLive.makeMathField('mathfield');
    </script>
</body>
</html>

More examples

More examples are available at https://mathlive.io/deploy/examples/

Installing MathLive

The examples above use a CDN, which is the fastest and easiest way to get started. However, if you:

  • want to contribute to MathLive
  • use your own CDN
  • make some other changes to MathLive you can also install it locally in your project.

To do so:

$ npm install -s mathlive
$ npm start

This will make a local build of MathLive, run a local HTTP server and open a page with the examples in your browser.

How You Can Help

More Questions?

License

This project is licensed under the MIT License.

Keywords

FAQs

Last updated on 10 May 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc