react-latex
DefinitelyTyped icon, indicating that this package has TypeScript declarations provided by the separate @types/react-latex package

2.0.0 • Public • Published

react-latex NPM version

React component to render latex strings, based on Katex

Install

$ npm install --save react-latex

Usage

In javascript

Before using Latex

Include in your html Katex CSS

<html>
    <head>
        <link
            href="//cdnjs.cloudflare.com/ajax/libs/KaTeX/0.9.0/katex.min.css"
            rel="stylesheet"
        />
    </head>
</html>

Inline Latex

var Latex = require('react-latex');
 
...
    render(){
        return (
            <h3>
                <Latex>What is $(3\times 4) \div (5-3)$</Latex>
            </h3>
        );
    }
...

Block Latex

var Latex = require('react-latex');
 
...
    render(){
        return (
            <h3>
                <Latex displayMode={true}>$$(3\times 4) \div (5-3)$$</Latex>
            </h3>
        );
    }
...

Options for Katex

A number of options are now supported. For a comprehensive list please visit: here

License

MIT © Zzish

Dependents (8)

Package Sidebar

Install

npm i react-latex

Weekly Downloads

2,729

Version

2.0.0

License

MIT

Unpacked Size

11.5 kB

Total Files

5

Last publish

Collaborators

  • zzish-stu
  • georgezzish
  • aledmakingthings
  • arthurzzish
  • tjallen
  • edcarr
  • charlesatzzish
  • blaiprat