React MathJax
React component to display math formulas written in AsciiMath or TeX.
Install
yarn add react-mathjax-ts
Usage
Inline display of AsciiMath wrapped in delimiters
;
Inline display of AsciiMath without delimiters
;
Block display of AsciiMath
;
Inline display of LaTeX
;
Block display of LaTeX
;
API
MJ.Context
props
script
(String)
- Loads specified link with MathJax library.
- Default:
https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MJ.js?config=TeX-MML-AM_CHTML
input
(String)
- Sets type of input.
- Options:
tex
|ascii
- Default:
ascii
delay
(Number)
- Sets delay between updates.
- Default: 0 (the main difference between this library and react-mathjax from SamyPesse)
options
(Object)
- Sets MathJax configuration.
- Default: Official MathJax configuration
onLoad
(Function)
- Triggered after MathJax script finishes loading (but BEFORE children are allowed to render if noGate is set to
false
)
onError
(Function)
- Triggered when any Math Processing Error occurs
noGate
(Boolean)
- Defaults to
false
, controls whether to disallow rendering of children components until the MathJax script has finished loading
Acknowledgements
- This project was forked from wko27 (react-mathjax).
License
This project is licensed under the MIT License - see the LICENSE.md file for details.