
Security News
152 Chrome Live Wallpaper Extensions Hid Ad Tracking and Faked Google Search Traffic
A network of 152 Chrome live wallpaper extensions hid ad tracking and made extension-driven traffic look like Google search clicks.
remark-math-inline
Advanced tools
A remark plugin for inline math using clean, unambiguous :math[...] syntax.
The standard $...$ syntax for inline math has problems:
$ conflicts with currency notation$ delimiters are hard to parse reliably$ wellThis plugin provides a cleaner alternative using explicit, directive-style syntax.
npm install remark-math-inline
import { unified } from 'unified'
import remarkParse from 'remark-parse'
import remarkMathInline from 'remark-math-inline'
import remarkRehype from 'remark-rehype'
import rehypeKatex from 'rehype-katex'
import rehypeStringify from 'rehype-stringify'
const html = await unified()
.use(remarkParse)
.use(remarkMathInline)
.use(remarkRehype)
.use(rehypeKatex)
.use(rehypeStringify)
.process('The formula :math[E = mc^2] is famous.')
console.log(String(html))
Inline math: :math[E = mc^2]
LaTeX commands work: :math[\alpha + \beta = \gamma]
Nested brackets are balanced: :math[f(x) = [a, b]]
For display-mode math, use fenced code blocks with math language:
```math
\int_0^1 x^2 dx = \frac{1}{3}
```
This works out of the box with rehype-katex — no additional plugin needed.
\] → literal ] (doesn't close the math)\\ → literal \\alpha stays \alpha)The plugin creates inlineMath nodes compatible with rehype-katex:
interface InlineMath {
type: 'inlineMath'
value: string
data: {
hName: 'code'
hProperties: { className: ['language-math', 'math-inline'] }
hChildren: [{ type: 'text', value: string }]
}
}
:math[...] must not be preceded by a word character. For adjacency without spaces, use parentheses:
mass(:math[m]) <!-- Works -->
mass:math[m] <!-- Does NOT parse -->
If you use both remark-math-inline and remark-directive, the plugin registered last takes precedence for :math[...] syntax.
// Math wins:
unified()
.use(remarkDirective)
.use(remarkMathInline) // registered last
// Directive wins:
unified()
.use(remarkMathInline)
.use(remarkDirective) // registered last
MIT
FAQs
Remark plugin for inline math syntax (:math[...])
The npm package remark-math-inline receives a total of 2 weekly downloads. As such, remark-math-inline popularity was classified as not popular.
We found that remark-math-inline demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Security News
A network of 152 Chrome live wallpaper extensions hid ad tracking and made extension-driven traffic look like Google search clicks.

Company News
Socket’s first CISO brings deep experience securing high-growth SaaS companies as open source supply chain threats accelerate.

Company News
Replit is integrating Socket Firewall into its AI-powered development experience to help protect builders from malicious open source packages.