
Research
/Security News
Coruna Respawned: Compromised art-template npm Package Leads to iOS Browser Exploit Kit
Compromised npm package art-template delivered a Coruna-like iOS Safari exploit framework through a watering-hole attack.
@react-pdf/math
Advanced tools
Render LaTeX math expressions in react-pdf documents.
Uses MathJax to convert LaTeX into SVG paths, then maps them to react-pdf's built-in SVG primitives. No fonts or external assets needed — all glyphs are rendered as vector paths directly in the PDF.
npm install @react-pdf/math
# or
yarn add @react-pdf/math
Peer dependencies:
npm install @react-pdf/renderer react
import React from 'react';
import { Document, Page } from '@react-pdf/renderer';
import { Math } from '@react-pdf/math';
const MyDocument = () => (
<Document>
<Page size="A4" style={{ padding: 40 }}>
<Math>{"x = \\frac{-b \\pm \\sqrt{b^2 - 4ac}}{2a}"}</Math>
</Page>
</Document>
);
<Math>| Prop | Type | Default | Description |
|---|---|---|---|
children | string | — | LaTeX math expression to render |
inline | boolean | false | Inline mode (compact) vs display mode (centered, larger) |
width | number | string | — | Width of the SVG element |
height | number | string | — | Height of the SVG element |
color | string | "black" | Color for the math expression |
debug | boolean | false | Adds a visible border around the SVG element for debugging layout |
Display mode (default) renders the expression as a block, centered with larger operators — ideal for standalone equations:
<Math>{"\\int_0^\\infty e^{-x^2} dx = \\sqrt{\\pi}"}</Math>
Inline mode (inline) renders compact expressions suitable for embedding within text:
<View style={{ flexDirection: 'row', alignItems: 'center' }}>
<Text>The equation </Text>
<Math inline>{"E = mc^2"}</Math>
<Text> is famous.</Text>
</View>
<Math>{"\\frac{\\sqrt{3}}{2}"}</Math>
<Math>{"\\sum_{n=1}^{\\infty} \\frac{1}{n^2} = \\frac{\\pi^2}{6}"}</Math>
<Math>{"\\int_{-\\infty}^{\\infty} e^{-x^2} dx = \\sqrt{\\pi}"}</Math>
<Math>{"\\begin{pmatrix} a & b \\\\ c & d \\end{pmatrix}"}</Math>
<Math>{"\\nabla \\times \\vec{E} = -\\frac{\\partial \\vec{B}}{\\partial t}"}</Math>
<Math>{"\\lim_{x \\to 0} \\frac{\\sin x}{x} = 1"}</Math>
fontCache: 'none', ensuring all glyphs are inlined as <path> elements (no <use>/<defs> references).path, rect, g, etc.) to the corresponding react-pdf SVG component.All standard LaTeX math features supported by MathJax are available, including:
MIT
FAQs
Render LaTeX math expressions in react-pdf documents
The npm package @react-pdf/math receives a total of 152 weekly downloads. As such, @react-pdf/math popularity was classified as not popular.
We found that @react-pdf/math 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.

Research
/Security News
Compromised npm package art-template delivered a Coruna-like iOS Safari exploit framework through a watering-hole attack.

Company News
As AI accelerates how code is written and shipped, Socket is scaling to protect the software supply chain from the growing wave of attacks targeting open source dependencies.

Company News
Socket is scaling to defend open source against supply chain attacks as AI accelerates software development.