React component to render Latex strings
Branch: master
Clone or download
Latest commit fc49ab8 Mar 23, 2018

README.md

react-latex NPM versionDependency StatusBuild Status

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>
        );
    }
...

License

MIT © Zzish