All Projects → mehdisadeghi → react-mathjax-preview

mehdisadeghi / react-mathjax-preview

Licence: MIT license
The MathJax React component you were looking for.

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to react-mathjax-preview

mathconverter
Converts from AsciiMath, LaTeX, MathML to LaTeX, MathML
Stars: ✭ 35 (-23.91%)
Mutual labels:  mathjax, mathml, asciimath
Mathjax
Beautiful and accessible math in all browsers
Stars: ✭ 8,551 (+18489.13%)
Mutual labels:  mathjax, mathml
mathup
Easy MathML authoring tool with a quick to write syntax
Stars: ✭ 46 (+0%)
Mutual labels:  mathml, asciimath
react-native-math-view
Math view for react native! No WebView!
Stars: ✭ 49 (+6.52%)
Mutual labels:  mathjax, mathml
Asciidocfx
Asciidoc Editor and Toolchain written with JavaFX 16 (Build PDF, Epub, Mobi and HTML books, documents and slides)
Stars: ✭ 1,533 (+3232.61%)
Mutual labels:  mathjax, mathml
MathJax-dev
Build and release tools for the MathJax project
Stars: ✭ 34 (-26.09%)
Mutual labels:  mathjax, mathml
ckeditor5-math
Math feature for CKEditor 5.
Stars: ✭ 51 (+10.87%)
Mutual labels:  mathjax
react-ignore-rerender
🚀 Simple component for ignoring the re-rendering of a piece of React's render method.
Stars: ✭ 28 (-39.13%)
Mutual labels:  react-component
react-grid
react grid component
Stars: ✭ 17 (-63.04%)
Mutual labels:  react-component
react-mason
React Masonry grid
Stars: ✭ 13 (-71.74%)
Mutual labels:  react-component
mathjax-node-cli
CLI tools for mathjax-node
Stars: ✭ 27 (-41.3%)
Mutual labels:  mathjax
vscode-markdown-editor
A vscode extension to make your vscode become a full-featured WYSIWYG markdown editor
Stars: ✭ 249 (+441.3%)
Mutual labels:  mathjax
react-textarea-code-editor
A simple code editor with syntax highlighting.
Stars: ✭ 247 (+436.96%)
Mutual labels:  react-component
react-dates
An easily internationalizable, mobile-friendly datepicker library for the web
Stars: ✭ 12,032 (+26056.52%)
Mutual labels:  react-component
react-file-input
⚛️  A file Input, with drag'n'drop and image editor for React
Stars: ✭ 71 (+54.35%)
Mutual labels:  react-component
react-timer-wrapper
Composable React Timer component that passes status props to children, in addition to some basic callbacks. Can be used at a countdown timer ⏲ or as stopwatch ⏱ to track time while active.
Stars: ✭ 14 (-69.57%)
Mutual labels:  react-component
react-scale-text
A React library to keep an element's text scaled to fit it's container
Stars: ✭ 39 (-15.22%)
Mutual labels:  react-component
react-scroll-trigger
📜 React component that monitors scroll events to trigger callbacks when it enters, exits and progresses through the viewport. All callback include the progress and velocity of the scrolling, in the event you want to manipulate stuff based on those values.
Stars: ✭ 126 (+173.91%)
Mutual labels:  react-component
git-issue-react-electronjs
⚙️. ⚛️. A desktop application created with Electronjs and Reactjs to be cross-platform to manage and track GitHub issues.
Stars: ✭ 21 (-54.35%)
Mutual labels:  react-component
TextGraphic
TextGraphic is a framework for creating Textual Graphics. It provides layers, styling, rich color, text justification, layouts, tables, view-ports, transparency, etc.
Stars: ✭ 83 (+80.43%)
Mutual labels:  asciimath

react-mathjax-preview

Travis npm package

react-mathjax-preview provides one React component to render MathML, TeX or ASCIImath formulas. See demo.

Installation

Install react-mathjax-preview as a dependency:

yarn add react-mathjax-preview

Usage

Import the package and fill the math property with some text containing your formals. Wrap TeX in $ or $$ and ASCIImath in `. Paste MathML as is.

import React, {Component} from 'react'
import {render} from 'react-dom'
import MathJax from 'react-mathjax-preview'

const asciimath = '`sum_(i=1)^n i^3=((n(n+1))/2)^2`' # Because of the backtick
const math = String.raw`
  <math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
    <menclose notation="circle box">
      <mi> x </mi><mo> + </mo><mi> y </mi>
    </menclose>
  </math>

  $$\lim_{x \to \infty} \exp(-x) = 0$$

  ${asciimath}`

class Demo extends Component {
  constructor(props) {
    super(props);
    this.state = {
      math: tex
    }
  render() {
    return <MathJax math={this.state.math} />
  }
}

Props

className

Wrapper classname

id

Wrapper id

style

Style object

wrapperTag

Wrapper tag, "div" is default

math

MathJax content

msDelayDisplay

Milliseconds to delay display of div, 300 is default

onDisplay (Function)

Triggered after delay and div is shown, hopefully typeset has finished

config (Object)

MathJax configuration

onLoad (Function)

Triggered after MathJax script finishes loading before children are allowed to render.

onError (Function)

Triggered when any Math Processing Error occurs

sanitizeOptions

DOMPurify configuration object (optional). See https://github.com/cure53/DOMPurify#can-i-configure-dompurify

Development

Clone the repo and run yarn commands available in the package.json file.

$ git clone https://github.com/mehdisadeghi/react-mathjax-preview && cd react-mathjax-preview
$ yarn install // install dependencies
$ yarn start // start the development server which serves the demo page
$ yarn build // make a production build inside the dist folder
$ yarn build:demo // make a demo build inside the dist folder

And browse to localhost:3000.

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].