remark-math

A unified remark plugin that adds LaTeX math syntax to markdown, ready to render with KaTeX or MathJax.

Library
npm
v6.0.0
520 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
44 /100 Fair
Development Activity 0
Maintenance 32
Community 64
Maturity 60
Momentum 20

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
86 /100 Excellent
Architecture 85
Code Quality 88
Innovation 88
Learning Curve 82

remark-math is a plugin for the unified/remark ecosystem that teaches markdown to understand math. It parses inline math wrapped in single dollar signs and block equations wrapped in double dollars, adding the syntax extension and the mdast nodes needed to carry LaTeX through the processing pipeline.

Because it only annotates the syntax tree, remark-math pairs cleanly with a rendering plugin such as rehype-katex or rehype-mathjax, which turn the parsed math into HTML at compile time. This keeps client bundles free of runtime math libraries and makes it a natural fit for static sites, documentation, and scientific writing.

What You Get

  • A remark plugin that parses inline ($...$) and block ($$...$$) math in markdown
  • mdast inlineMath and math nodes that flow through the unified pipeline
  • Seamless pairing with rehype-katex and rehype-mathjax for compile-time HTML rendering
  • Configurable options (such as singleDollarTextMath) passed through to the underlying math extension
  • Full TypeScript type definitions shipped via JSDoc and generated .d.ts files

Common Use Cases

  • Rendering LaTeX equations in documentation sites built on Astro, Next.js, or Gatsby
  • Adding math support to markdown-driven blogs and scientific writing
  • Producing static HTML math with no client-side JavaScript by rendering at build time
  • Feeding parsed math nodes into custom remark/rehype transforms

Under The Hood

Architecture - remark-math is a thin, delegation-first plugin. The published entry index.js simply re-exports lib/index.js, whose default remarkMath(options) function attaches three extension arrays to the unified processor’s shared data(): micromarkExtensions, fromMarkdownExtensions, and toMarkdownExtensions. It pushes math() from micromark-extension-math for tokenizing, and mathFromMarkdown()/mathToMarkdown() from mdast-util-math for building and serializing the math and inlineMath mdast nodes. All real parsing lives in those sibling packages, so remark-math itself is essentially wiring.

Tech Stack - The package is pure ES-module JavaScript (type: module, single exports entry) targeting unified 11. Its runtime dependencies are mdast-util-math, micromark-extension-math, unified, and @types/mdast. Types are authored as JSDoc annotations and emitted to .d.ts; tooling is xo plus prettier, and it declares sideEffects: false for tree-shaking.

Code Quality - Quality is high for its size. The core lib/index.js is a few dozen well-commented lines with careful null-handling of the options object and defensive initialization of the extension arrays. The package ships a substantial test.js (~24KB) exercising parsing and stringifying across inline and block cases, and every export is fully typed. Naming follows unified conventions consistently.

API Design - The developer experience is idiomatic unified: a single default-exported plugin registered with .use(remarkMath, options) and one optional configuration object. There is no boilerplate beyond composing it into a processor alongside a rehype renderer, and the readme documents installation, usage, options, syntax, security, and related plugins thoroughly, making it approachable for anyone already using remark.

Used by 68 apps in this directory

TypeScript
91%
Other

FastGPT

AI Agents · AI Development

29,900

Build, debug, and deploy knowledge-based AI agents with a visual workflow editor, RAG retrieval, and support for any OpenAI-compatible LLM.

View details
93
Repo Health
84
Technical
66
Dependency
Built with
TypeScript 91%
Updated 6 days ago
TypeScript
74%
Apache 2.0

Fern

Developer Tools

3,822

Fern turns a single OpenAPI, AsyncAPI, or Protobuf definition into type-safe SDKs for nine languages and a hosted API documentation site, all from one CLI and one source of truth.

View details
90
Repo Health
86
Technical
66
Dependency
Built with
TypeScript 74%
Updated 6 days ago
TypeScript
74%
Apache 2.0

Fern

Developer Tools

3,822

Fern turns a single OpenAPI, AsyncAPI, or Protobuf definition into type-safe SDKs for nine languages and a hosted API documentation site, all from one CLI and one source of truth.

View details
90
Repo Health
86
Technical
66
Dependency
Built with
TypeScript 74%
Updated 6 days ago
TypeScript
62%
Other

Flowise

AI Development · Automation · Developer Tools

55,521

Drag-and-drop visual builder for AI agents, RAG pipelines, and multi-agent systems—deploy anywhere in minutes.

View details
75
Repo Health
77
Technical
63
Dependency
Built with
TypeScript 62%
JavaScript 27%
Updated 2 months ago
TypeScript
62%
Other

Flowise

AI Development · Automation · Developer Tools

55,521

Drag-and-drop visual builder for AI agents, RAG pipelines, and multi-agent systems—deploy anywhere in minutes.

View details
75
Repo Health
77
Technical
63
Dependency
Built with
TypeScript 62%
JavaScript 27%
Updated 2 months ago
TypeScript
99%
AGPL 3.0

fountain-ink

Blogging

64

A self-hostable, decentralized blogging platform built on Lens Protocol — own your content, audience, and distribution forever.

View details
26
Repo Health
66
Technical
63
Dependency
Built with
TypeScript 99%
Updated 8 months ago
Python
71%
Apache 2.0

GPT Researcher

AI Assistants · Productivity

30,269

The pioneering open-source autonomous AI agent that conducts deep, multi-source research and produces citation-backed reports exceeding 2,000 words — faster and more reliably than any human researcher.

View details
90
Repo Health
91
Technical
64
Dependency
Built with
Python 71%
TypeScript 18%
Updated 2 weeks ago
Python
71%
Apache 2.0

GPT Researcher

AI Assistants · Productivity

30,269

The pioneering open-source autonomous AI agent that conducts deep, multi-source research and produces citation-backed reports exceeding 2,000 words — faster and more reliably than any human researcher.

View details
90
Repo Health
91
Technical
64
Dependency
Built with
Python 71%
TypeScript 18%
Updated 2 weeks ago
TypeScript
98%
Other

GrowthBook

Ab Testing Experimentation · Analytics · Developer Tools

8,527

Open source feature flags, A/B testing, and warehouse-native experimentation that queries your existing data infrastructure—no data movement required.

View details
92
Repo Health
85
Technical
63
Dependency
Built with
TypeScript 98%
Updated 6 days ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers