You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP

remark-math

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

remark-math

remark plugin to parse and stringify math

6.0.0
latest
Version published
Weekly downloads
972K
8.13%
Maintainers
2
Weekly downloads
 
Created

What is remark-math?

The remark-math package is a plugin for the remark markdown processor that allows you to parse and render mathematical expressions written in LaTeX. It supports both inline and block math expressions, making it useful for documents that require mathematical notation.

What are remark-math's main functionalities?

Inline Math

This feature allows you to include inline mathematical expressions within your markdown text. The example demonstrates how to use the remark-math plugin to parse and render an inline math expression.

const remark = require('remark');
const remarkMath = require('remark-math');
const html = require('remark-html');

remark()
  .use(remarkMath)
  .use(html)
  .process('Here is some inline math: $E=mc^2$', function (err, file) {
    if (err) throw err;
    console.log(String(file));
  });

Block Math

This feature allows you to include block mathematical expressions in your markdown text. The example demonstrates how to use the remark-math plugin to parse and render a block math expression.

const remark = require('remark');
const remarkMath = require('remark-math');
const html = require('remark-html');

remark()
  .use(remarkMath)
  .use(html)
  .process('$$\int_0^\infty e^{-x} \, dx = 1$$', function (err, file) {
    if (err) throw err;
    console.log(String(file));
  });

Other packages similar to remark-math

FAQs

Package last updated on 19 Sep 2023

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