
Research
/Security News
Critical Vulnerability in NestJS Devtools: Localhost RCE via Sandbox Escape
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
Plugin to convert mathematical expressions in Markdown (MDAST) to DOCX using LaTeX-style syntax. Integrates seamlessly with mdast2docx.
@m2d/math
A plugin that transforms LaTeX-style math (inline and block) into DOCX-compatible equations using docx.
This package expects that the math nodes have already been extracted using
remark-math
plugin.
npm install @m2d/math
pnpm add @m2d/math
yarn add @m2d/math
The @m2d/math
plugin for mdast2docx
enables support for LaTeX math rendering in DOCX exports. It parses inline and block-level math expressions written in LaTeX syntax and converts them into proper Word-compatible Math elements using the docx
library.
Supports superscripts, subscripts, fractions, radicals, summations, symbols, and more.
docx.MathRun
, docx.MathFraction
, docx.MathRadical
, etc.$...$
, $$...$$
)\frac
, \sqrt
, \sum
, \alpha
, and many others^
) and subscripts (_
) intelligently\left
, \right
, etc.import { toDocx } from "@m2d/core";
import { mathPlugin } from "@m2d/math";
const plugins = [mathPlugin()];
const buffer = await toDocx(mdastTree, {
plugins,
});
This is inline math: $E = mc^2$
$$
\frac{a^2 + b^2}{c^2} = 1
$$
$E = mc^2$
) → E = mc²
as a Word MathRun.latex-math
to parse LaTeX math AST.docx.MathRun[]
elements.@m2d/core
.Includes (but not limited to):
\frac, \sqrt, \sum, \int, \alpha, \beta, \theta, \leq, \geq, \neq, \infty, \cdot
\begin{align}
, etc.)\textcolor
, etc.)If you find this useful:
MIT © Mayank Chaudhari
Made with 💖 by Mayank Kumar Chaudhari
FAQs
Plugin to convert mathematical expressions in Markdown (MDAST) to DOCX using LaTeX-style syntax. Integrates seamlessly with mdast2docx.
We found that @m2d/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
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
Product
Customize license detection with Socket’s new license overlays: gain control, reduce noise, and handle edge cases with precision.
Product
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.