🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@dotit/math

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dotit/math

Math/equation rendering for IntentText (.it) — a dependency-free lightweight LaTeX→MathML renderer for common business/science math, with optional KaTeX for full LaTeX. Renders the math placeholders @dotit/core emits.

latest
npmnpm
Version
0.1.0
Version published
Weekly downloads
3
Maintainers
1
Weekly downloads
 
Created
Source

@dotit/math

Math/equation rendering for IntentText. @dotit/core stays dependency-free and only marks math — emitting placeholders <span class="it-math" data-tex="…"> (inline) and <div class="it-math-block" data-tex="…"> (display). This package turns those into real math.

Author math in .it:

math: E = mc^2                          # a display equation
text: mass-energy [E = mc^2]{math: tex} # inline

Render it:

import { mathToMathML, renderMath, renderMathInHtml, hydrateMath } from "@dotit/math";

mathToMathML("\\frac{a}{b}");           // dependency-free LITE MathML (sync)
await renderMath("\\sum_{i=0}^n x_i");  // KaTeX if installed, else lite MathML

// server / print: replace core's placeholders in an HTML string
const html2 = await renderMathInHtml(coreHtml);

// editor (browser): upgrade placeholders in a live DOM
await hydrateMath(document.querySelector(".intent-document")!);

Lite vs KaTeX

  • Lite (built in, zero deps): fractions, powers/subscripts, roots, Greek, big operators (∑ ∏ ∫) and common relations — the math business and most science documents use. Always available, sync, → MathML.
  • KaTeX (optional peer — npm i katex): full LaTeX. renderMath uses it automatically when installed; otherwise falls back to lite, never throwing.

Install KaTeX only if you need full LaTeX; otherwise lite keeps your bundle lean.

Keywords

intenttext

FAQs

Package last updated on 16 Jun 2026

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