0.2.7 • Published 5 years ago

simple-react-mathjax v0.2.7

Weekly downloads
43
License
-
Repository
github
Last release
5 years ago

simple-react-mathjax

simple-react-mathjax provides React component to render MathML, TeX or ASCIImath formulas.

Installation

Install simple-react-mathjax as a dependency:

npm install simple-react-mathjax

Usage

Add your MathJax configuration in index.html

<script type="text/x-mathjax-config">
        MathJax.Hub.Config({
          tex2jax: {
            inlineMath: [["$", "$"], ["\\(", "\\)"]],
            displayMath: [["$$", "$$"], ["\\[", "\\]"]]
          },
          showMathMenu: false,
          messageStyle: "none"
        });      
</script>
<script type="text/javascript" async src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-MML-AM_CHTML"></script>

Import the package and Wrap your components with Mathjax.

import React, {Component} from 'react'
import MathJax from 'simple-react-mathjax'

class Demo extends Component {
  render() {
    return <MathJax><div>$sec \\theta / cosec \\theta$</div></MathJax>
  }
}
0.2.7

5 years ago

0.2.6

6 years ago

0.2.5

6 years ago

0.2.4

6 years ago

0.2.2

6 years ago

0.2.1

6 years ago

0.2.0

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago