
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
The core LaTeX parsing and rendering engine for LaTeX2JS. This package provides the fundamental LaTeX-to-HTML conversion functionality with support for mathematical notation, environments, and PSTricks graphics.
npm install latex2js
The main parser class for converting LaTeX to HTML:
import { LaTeX2HTML5 } from 'latex2js';
const parser = new LaTeX2HTML5();
const html = parser.parse(latexContent);
// Parse LaTeX content to HTML
parse(latex: string): string
// Add custom macros
addMacros(macros: string): void
// Parse specific environments
parseEnvironment(envName: string, content: string): string
// Process headers and metadata
processHeaders(latex: string): HeaderInfo
import { LaTeX2HTML5 } from 'latex2js';
const parser = new LaTeX2HTML5();
const latexDocument = `
The quadratic formula is:
$$x = \\frac{-b \\pm \\sqrt{b^2-4ac}}{2a}$$
\\begin{pspicture}(-1,-1)(1,1)
\\pscircle(0,0){0.8}
\\rput(0,0){Circle}
\\end{pspicture}
`;
const parsed = parser.parse(latexDocument);
import { LaTeX2HTML5 } from 'latex2js';
import macros from '@latex2js/macros';
const parser = new LaTeX2HTML5();
// Add predefined macros
parser.addMacros(macros);
// Add custom macros
const customMacros = `
\\newcommand{\\R}{\\mathbb{R}}
\\newcommand{\\norm}[1]{\\left\\|#1\\right\\|}
\\newcommand{\\abs}[1]{\\left|#1\\right|}
`;
parser.addMacros(customMacros);
const content = `
For any vector $\\vec{v} \\in \\R^n$, we have:
$$\\norm{\\vec{v}} = \\sqrt{\\sum_{i=1}^n v_i^2}$$
And for any real number $x \\in \\R$:
$$\\abs{x} = \\begin{cases}
x & \\text{if } x \\geq 0 \\\\
-x & \\text{if } x < 0
\\end{cases}$$
`;
const result = parser.parse(content);
FAQs
LaTeX and PSTricks rendering & components for the Web
We found that latex2js demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.