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
Weekly downloads
58K
increased by0.33%
Maintainers
1
Install size
3.96 MB
Created
Weekly downloads
 

Changelog

Source

0.35.0 2020-03-24

New Features

  • Extensible (stretchy) symbols:

    #126 (\overgroup, \overrightarrow, \overleftrightarrow), #180 (\xrightarrow, \xrightleftharpoons), #292 (\widehat, \overbrace, \underbrace), #338 (\vec, \bar).

    This work has been made possible thanks to the financial support of a generous sponsor.

    It is now possible for a symbol with operands above or below, or for a decoration above or below an expression, to stretch (extend) so that its width will match the width of the operands or expression.

    These extensible symbols and decorations are important for some domains such as geometry and chemistry.

    This release introduces the following new commands:

    • \overrightarrow{base}
    • \overleftarrow{base}
    • \Overrightarrow{base}
    • \overleftharpoon{base}
    • \overrightharpoon{base}
    • \overleftrightarrow{base}
    • \overbrace{base}
    • \overlinesegment{base}
    • \overgroup{base}
    • \underrightarrow{base}
    • \underleftarrow{base}
    • \underleftrightarrow{base}
    • \underbrace{base}
    • \underlinesegment{base}
    • \undergroup{base}
    • \xrightarrow[below]{above}
    • \xleftarrow[below]{above}
    • \xRightarrow[below]{above}
    • \xLeftarrow[below]{above}
    • \xleftharpoonup[below]{above}
    • \xleftharpoondown[below]{above}
    • \xrightharpoonup[below]{above}
    • \xrightharpoondown[below]{above}
    • \xlongequal[below]{above}
    • \xtwoheadleftarrow[below]{above}
    • \xtwoheadrightarrow[below]{above}
    • \xleftrightarrow[below]{above}
    • \xLeftrightarrow[below]{above}
    • \xrightleftharpoons[below]{above}
    • \xleftrightharpoons[below]{above}
    • \xhookleftarrow[below]{above}
    • \xhookrightarrow[below]{above}
    • \xmapsto[below]{above}
    • \xtofrom[below]{above}
    • \xrightleftarrows[below]{above}
    • \xrightequilibrium[below]{above}
    • \xleftequilibrium[below]{above}

    In addition, the following commands can now be used to represent stretchy accents:

    • \widehat{base}
    • \widecheck{base}
    • \widetilde{base}
    • \utilde{base}
  • Improved rendering and layout of \enclose

  • Improved layout of overunder atoms

  • Improved layout of accent atoms

  • Improved fidelity of styling commands (\textup, \fontseries, etc...). They are now closer to what LaTeX does, in all its wonderful weirdness (see https://texfaq.org/FAQ-2letterfontcmd). Added \selectfont command.

Issues Resolved

  • #371: When clicking after the last element in the mathfield, always set the anchor to be the last element in the root, i.e. as if moveToMathFieldEnd had been performed. For example, if the content is "x^2", clicking after the end of the field will put the caret after the last element (not after the "2" in the superscript)

  • #372: Using an argument in a macro will result in the argument to be substituted without a group being inserted. Previously, #1 with ax as a value for the first argument would have resulted in {ax}. This was noticeable when using the x^2 key in the virtual keyboard: if the equation was ab, pressing that key resulted in {ab}^2. It now results in ab^2

  • Fixed an issue rendering some commands such as \boxed and others when in static mode. An over-agressive optimization would coalesce spans with no content, even though they may include important styling info.

  • Fixed the rendering of infix commands with arguments, e.g. \atopwithdelims and overwithdelims. The arguments of infix commands were incorrectly merged with the suffix.

  • Fixed inter-atom spacing of overunder atoms (they should space as mord)

Code Maintenance

  • Re-factored the definitions of functions, symbols and environments which are now split in multiple files instead of being all contained in core/definitions.js

  • Re-factored and isolated the metadata about LaTeX commands (frequency and category). This should reduce the amount of data carried by the core package. All the metadata is now in definitions-metadata.js. As a side effect, the examples displayed in the popover window might be less complete, but the removal of popover is on the roadmap.

  • Removal of default export for some modules. Need to complete it for all the remaining modules.

Readme

Source
math live

Maintenance GitHub license

Build Status David

Screenshot

MathLive: Math Input Made Easy

  • JavaScript library easy to integrate in your project
  • Beautiful, TeX-quality typesetting
  • Easy to use interface for formula editing
  • Designed for mobile devices with an extensive set of virtual keyboards
  • Accessility support: screen reader compatible, and includes custom math-to-speech support
  • Outputs LaTeX, MathML and MathJSON (Abstract Syntax Tree)
  • 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

Displaying Math

Render math equations by adding a few lines to your web page.

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

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

Editing Math

You can also incorporate a “mathfield” to edit math just like you would edit text. The MathLive APIs allow you to interact with the mathfield, 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/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

  • Using MathLive in your project? Want to support the project ongoing maintenance? Consider becoming a patron on Patreon or making a donation with PayPal
  • Something wrong? Got ideas for new features? Write up an issue. Read about Contributing and follow our Code of Conduct
  • Want to use MathLive in your web page? The Usage Guide has all the details.
  • Want to contribute some code for an issue or a feature? Read the Contributor Guide and the docs. Looking for inspiration? Pick one of the good first issues

More Questions?

License

This project is licensed under the MIT License.

Keywords

FAQs

Last updated on 24 Mar 2020

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