MathJax3 with XyJaX-v3 for server side rendering
npm install mathxyjax3


MathJax3 with XyJaX-v3 for server-side rendering of mathematical expressions and xy-pic diagrams.
- MathJax 3 Integration: MathJax for high-quality mathematical typesetting
- XyJax-v3 Support: Full support for xy-pic diagrams and commutative diagrams
- Server-Side Rendering: Optimized for Node.js server environments
- ESM Module: Modern ES module support
- SVG Output: Clean, scalable vector graphics output
``bash`
npm install mathxyjax3
`javascript
import mathjax from 'mathxyjax3';
// Render a simple math expression
const mathSvg = mathjax.tex2svgHtml('E = mc^2');
console.log(mathSvg.outerHTML);
// Render xy-pic diagram
const xyDiagram = mathjax.tex2svgHtml('\\xymatrix{A \\ar[r] & B}');
console.log(xyDiagram.outerHTML);
`
Converts TeX/LaTeX input to SVG output wrapped in HTML.
#### Parameters:
- input (string): The TeX/LaTeX expression to renderoptions
- (object, optional): Rendering options
#### Returns:
- HTML string containing SVG
#### Example:
`javascript`
const svg = mathjax.tex2svgHtml('\\frac{1}{2}', {
display: true,
em: 16,
ex: 8
});
https://mathxyjax3.pages.dev/
javascript
// Fractions
mathjax.tex2svgHtml('\\frac{a}{b}');// Integrals
mathjax.tex2svgHtml('\\int_{-\\infty}^{\\infty} e^{-x^2} dx');
// Matrices
mathjax.tex2svgHtml('\\begin{pmatrix} a & b \\\\ c & d \\end{pmatrix}');
`$3
`javascript
// Simple commutative diagram
mathjax.tex2svgHtml('\\xymatrix{A \\ar[r]^f \\ar[d]_g & B \\ar[d]^h \\\\ C \\ar[r]_k & D}');// Category theory
mathjax.tex2svgHtml('\\xymatrix@1{\\bullet \\ar@/^/[rr]^{f} \\ar@/_/[rr]_{g} && \\bullet}');
``- MathJax 3: Core mathematical rendering engine
- XyJax-v3: XY-pic extension for diagram rendering
- esbuild: Fast JavaScript bundler
- xmldom-sre: XML DOM implementation
- wicked-good-xpath: XPath support
- MathJax - The core rendering engine
- XyJax - XY-pic extension
- xy-pic - Original xy-pic package
MIT License - see LICENSE file for details.
TANIGUCHI Masaya