Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-katex

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-katex

Display math in TeX with KaTeX and ReactJS

  • 0.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
27K
decreased by-27.24%
Maintainers
1
Weekly downloads
 
Created
Source

react-katex

Display math with KaTeX and ReactJS !

Installation

You can install it with npm:

  $ npm install react-katex

With Bower:

  $ bower install react-katex

Or use one of the files inside the dist folder.

When using react-katex, don't forget to import KaTeX CSS file (see example/index.html).

If you open the example file on Firefox directly (i.e. without a server) the fonts won't load, open it on Chrome or put it on some server, like simplehttpserver.

Usage

react-katex has two types of math components, InlineMath and BlockMath.

InlineMath

Let's you display math in the middle of the text.

  var InlineMath = ReactKaTeX.InlineMath;

  React.render(<InlineMath math="\\int_0^\\infty x^2 dx"/>,
                document.getElementById('math'));

  // or

  React.render(<InlineMath>\int_0^\infty x^2 dx</InlineMath>,
                document.getElementById('math'));

It will be rendered like this:

Inline math

BlockMath

Let's you display math in a separated block, with larger font and symbols.

  var BlockMath = ReactKaTeX.BlockMath;

  React.render(<BlockMath math="\\int_0^\\infty x^2 dx"/>,
                document.getElementById('math'));

  // or

  React.render(<BlockMath>\int_0^\infty x^2 dx</BlockMath>,
                document.getElementById('math'));

It will be rendered like this:

Block math

Keywords

FAQs

Package last updated on 05 May 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc