Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mathlive

Package Overview
Dependencies
Maintainers
1
Versions
173
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mathlive - npm Package Versions

1
18

0.73.4

Diff

Changelog

Source

0.73.4 2022-05-27

Issues Resolved

  • Correctly export the Typescript declaration for some static functions.
  • When editing a formula that contains a matrix, the formatting of the matrix could change, for example when pasting some content.
  • #1465 The bounds of large operators (integral, sum) would not accept any content.
  • When setting the background color of an entire equation, the color command would not be generated.
  • #1445 Improve the \colorbox command, and other text mode commands, to be more interoperable when they contain math content (use $ and $$ rather than \\( and \\[))
  • #1443 On mobile, prevent the focus from changing while the alternate key panel is up
arnog
published 0.73.3 •

arnog
published 0.73.2 •

arnog
published 0.73.1 •

Changelog

Source

0.73.1 2022-05-24

Issues Resolved

  • Using macros without arguments (e.g. \RR) could result in incorrect LaTeX
  • The virtual keyboard could become invisible when re-focusing a mathfield
  • Typing a , (comma) would be rendered as a . (dot)
arnog
published 0.73.0 •

Changelog

Source

0.73.0 2022-05-23

Breaking Changes

  • The following attributes of the <math-field> element that were previously boolean attributes are now enumerated attributes.

    A boolean attribute has a value of true if present and false if absent (it's an HTML standard thing).

    An enumerated attribute has an explicit value, usually a string.

    As a result of this change the default value of some mathfield attributes have changed from false to true.

    • keypress-vibration: "on" | "off" | "" (default "on")
    • remove-extraneous-parentheses: "on" | "off" | "" (default "on")
    • smart-fence: "on" | "off" | "" (default "on")
    • smart-superscript: "on" | "off" | "" (default "on")
    • smart-mode: "on" | "off" | "" (default"off")

If you previously used:

<math-field></math-field>

in order to preserve the same settings, you would now use:

<math-field
  keypress-vibration="off"
  remove-extraneous-parentheses="off"
  smart-fence="off"
  smart-superscript="off"
></math-field>
  • The commands \mleft and \mright are no longer generated automatically.

    Previously, when using smart-fence mode, () or \left(...\right), could be replaced with a \mleft(...\mright) command. This was done to ensure the proper spacing of delimiters after a function, e.g. \sin(x). Without it, there is excessive space between the function and the delimiter.

    Now the \left...\right command automatically adjust its left spacing based on the symbol to its left. If the symbol to its left is a function, the spacing will be tighter. Therefore, \mleft...\mright are no longer required, although they are still recognized as valid commands.

    This change was made because not every LaTeX environment recognize the \mleft...\mright commands, and this caused interoperability issues.

New Features

  • Comma , as a decimal separator

    The options.decimalSeparator option can be set to . or ,. The default value is . which corresponds to the current behavior.

    When set to ,, pressing the , key on the keyboard will insert a {,} LaTeX string, if in math mode and if before a digit. The LaTeX sequence {,} is traditionally used to correctly typeset the comma and ensure the correct amount of space around it. Without the {}, the , is interpreted as a delimiter and has excessive amount of space around it.

    The virtual keyboard is also changed so that the . key is , instead and also contextually insert a {,} when appropriate.

    A new command insertDecimalSeparator has also been added, which inserts either {,} if in math mode, right after a digit, and when decimalSeparator is set to ",". Otherwise, it inserts a "."

  • Multi character symbols

    The onMulticharSymbol() hook provides an opportunity to recognize multi character symbols and wrap them in an appropriate command.

    For example typing speed [\ \to ] \mathrm{speed}

    While conventionally \mathrm{} is frequently used to denote multicharacter symbols in LaTeX, in some contexts \mathit can also be used, for example using \mathrm to indicate multicharacter function names, but \mathit for multicharacter variable names.

    By default, the hook does nothing and multicharacter symbols are not recognized.

  • Support for the \mathnormal{} command, which displays text in italic and includes italic correction. As opposed to \mathit{} which displays text in italic, but without italic correction.

  • Correctly handle double-clicking words styled with \mathrm or \mathit

  • The appearance of the placeholder symbol has changed to stand out more. Also, the LaTeX generated for the default placeholder is now simply \placeholder{}. The argument of \placeholder{} was always optional, and is still supported. Only the default serialization of the \placeholder{} has changed.

Improvements

  • The MathJSON which is exported to the clipboard during copy/cut operations now include the verbatim LaTeX from the mathfield.

Issues Resolved

  • When extending the selection backwards over a captureSelection group, do not extend more than necessary
  • #1354 Correctly render {,}, which is used for French decimal point. Also correctly handle navigating with the keyboard, that is, handle it as a single character, not a group. Also correctly render it to MathML (as a .).
  • The "contains highlight" and selection rectangles would not always account for the children of the expression, for example with \sqrt{\frac12}
  • The LaTeX output of subscript or superscripts was incorrect when no value for the superscript/subscript was provided. For example, typing x, ^, right arrow, 2, would incorrectly serialize x^2. It now serializes x^{}2
  • Improved parsing and layout of functions with arguments, i.e. \sin\left(x\right). Previously, there would be an excessive amount of white space between the \sin and (. The expression is now correctly interpreted as a function.
  • #1459 When using a non-QWERTY physical keyboard layout, creating multiple mathfields could result in the keyboard layout being erroneously reset to QWERTY. This would manifest itself for example by the / keybinding no longer inserting a fraction.
  • #1462 When copying and pasting an expression that could not be parsed with the Compute Engine, the resulting pasted content was displayed as an error.
arnog
published 0.72.3 •

arnog
published 0.72.2 •

Changelog

Source

0.72.2 2022-04-30

Issues Resolved

  • #1427 An issue introduced in the previous release: the serialization to LaTeX of some functions (e.g. \log) failed.
  • Serialization to MathML of subscripts/superscripts was incorrect in some cases
  • In Chrome, setting the readonly attribute on mathfield caused the content of the mathfield to be set to empty.
  • #1431 AutoRender of static math expressions would not render correctly when using <script type='math/tex; mode=text'>. Auto-render could also fail catastrophically in some cases.
  • Cortexjs.io #15 When loading the fonts (and sounds), the origin of the library needs to be resolved to determine the relative location of those files. This was done with a http GET for each font file, which caused the entire library to be redownloaded multiple times. The base URL resolution is now only done once, and with a HEAD request to avoid the download. As a result, getting the MathLive library ready, especially when using a CDN and a slow network, is an order of magnitude faster.
arnog
published 0.72.1 •

arnog
published 0.72.0 •

Changelog

Source

0.72.0 2022-04-18

Issues Resolved

  • #1017 Display tooltip over buttons of virtual keyboard button bar
  • #1356 In inline mode, the fraction bar appeared too close to the numerator
  • #1222, #1024 When multiple \ne commands were entered, older ones would disappear.
  • #1013 Cutting the content of the matfield would not work in some cases
  • #1149 Improved placement of the horizontal bar above square roots = #1070 The \mod command (and \pmod and \bmod) no longer captures the cursor or allow its content to be selected
  • When navigating with the arrow keys backward, if landing on a group atom (e.g. a macro), allow the cursor to be positioned right after the atom.
  • In some rare cases (if no keys but keybinding were entered in a mathfield), some keybindings would stop functioning
  • #1327 Selecting the expression under a square root also selected the squared root.
  • Extending the selection forward when including some atoms such as \operatorname jumped to the end of the expression.
  • #1422 Turning off macros would still fallback to default macros.
  • #1037 Correctly serialize \mathord, \mathbin, etc...
  • #1425 Using the up/down keys to navigate could produce an error in some cases

Improvements

  • Use more standard \mathbb{N}, etc... for NN shortcut
  • Improved display of command popover when editing raw LaTeX
arnog
published 0.71.0 •

Changelog

Source

0.71.0 2022-04-12

Breaking Changes

  • Removed the find and replace methods. These methods were difficult to use, since they were based on LaTeX serialization and the mapping from atom to LaTeX is not always intuitive. To replace them it is recommended to extract the MathJSON representation of the value, and manipulate it using the CortexJS Compute Engine.

New Features

  • "math-json" can be used as a format for setValue()

Improvements

  • #1415 Atoms inside parentheses are now considered as implicit arguments, for example when inserting a fraction.
  • #1389 Keyboard navigation inside tabular data (matrices, etc...)
  • Documentation: some of the data structures were not publicly exported and did not appear in the documentation (https://cortexjs.io/docs/mathlive/)
  • When pasting content that included a double-backslash (e.g. as a row separator) immediately followed by a character, all double-backslash would be interpreted as a single backslash (this allowed pasting LaTeX that had been escaped in JavaScript). However, this caused some legitimate LaTeX to not be interpreted correctly. The double-backslash are no longer "simplified".

Issues Resolved

  • A style applied to a an atom using applyStyle() was not propagated to its children
  • #1387 A matrix with an empty cell would result in error messages in the console in some cases
SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc