Socket
Socket
Sign inDemoInstall

denniske-algebra-latex

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

denniske-algebra-latex

Parse Latex math to a regular math string or algebra.js


Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

algebra-latex

Build Status npm version

An npm module, with no dependencies, for parsing LaTeX math to a regular math string (ascii math), that can be parsed to other algebra or math libraries like algebrite and algebra.js

Example

const AlgebraLatex = require('algebra-latex')

// Parse from LaTeX ...
const latexInput = '\\frac{1}{\\sqrt{2}}\\cdot x=10'
const algebraObj = new AlgebraLatex().parseLatex(latexInput)

// ... or parse from regular math string
const mathInput = '1/sqrt(2)*x=10'
const algebraObj = new AlgebraLatex().parseMath(mathInput)

console.log(algebraObj.toMath()) // output: 1/sqrt(2)*x=10
console.log(algebraObj.toLatex()) // output: \frac{1}{\sqrt{2}}\cdot x=10

Parse to other libraries

Supported libraries

NOTE: The above libraries are optional, and have to be installed before use

continuing from example above

...

var algebraJS = require('algebra.js')
var algebrite = require('algebrite')
var coffeequate = require('coffeequate')

// For algebra.js
algebraObj.toAlgebra(algebraJS) // Will either return an algebra.js expression or equation

// For algebrite
algebraObject.toAlgebrite(algebrite)

// For coffequate
algebraObject.toCoffeequate(coffeequate)

FAQs

Package last updated on 01 Nov 2018

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc