Get the latest tech news

Tensor Notation in Mathup


Installation npm npm install mathup import mathup from "mathup"; Client Download one of the following: - Module (full, min) - Script (full, min) - Custom element as module (full, min) - Custom element as script (full, min) - Stylesheet (full; not needed for custom element) …and include the module: <script type="module" src="mathup.js"></script> <link rel="stylesheet" href="mathup.css" /> …the custom element: <script type="module" src="math-up-element.js"></script> …or the script: <script src="mathup.iife.js"></script> <link rel="stylesheet" href="mathup.css" /> Usage const expression = "1+1 = 2"; const options = {}; // optional const mathml = mathup(expression, options); mathml.toString(); // => "<math><mrow><mn>1</mn><mo>+</mo><mn>1</mn></mrow><mo>=</mo><mn>2</mn></math>" const mathNode = mathml.toDOM(); // => [object MathMLElement] // Update existing <math> node in place mathup("3-2 = 1", { bare: true }).updateDOM(mathNode); Custom Element <math-up display="inline" dir="ltr" decimal-mark="," col-sep=";" row-sep=";;" > 1+1 = 2 </math-up> Command line npm install -g mathup mathup [options] -- <expression> # or from stdin echo <expression> | mathup [options] Options (with defaults) const options = { decimalMark: ".", // -m --decimal-mark="." colSep: ",", // -c --col-sep="," rowSep: ";", // -r --row-sep=";" display: "inline", // -d --display="inline" dir: "ltr", // --rtl bare: false, // -b --bare }; Note: If you pick , as your decimal mark then ; becomes the new default column separator. And if ; is your column separator then the new default row separator becomes ;;.

None

Get the Android app

Or read this on Hacker News

Read more on:

Photo of Mathup

Mathup

Photo of Tensor Notation

Tensor Notation

Related news:

News photo

Mathup: Easy MathML authoring tool with a quick to write syntax