### Run the eval development server Source: https://github.com/asnunes/mathml-to-latex/blob/main/eval/README.md Install dependencies and start the dev server. Then open the printed URL (default http://localhost:5173). ```bash cd eval npm install npm run dev ``` -------------------------------- ### Install mathml-to-latex with NPM or Yarn Source: https://github.com/asnunes/mathml-to-latex/blob/main/README.md Installation commands for the mathml-to-latex package using NPM or Yarn. Use the appropriate command for your package manager. ```bash npm install mathml-to-latex --save ``` ```bash yarn add mathml-to-latex ``` -------------------------------- ### Convert MathML to LaTeX with MathMLToLaTeX.convert Source: https://github.com/asnunes/mathml-to-latex/blob/main/AGENTS.md Shows the complete public API: a single static method that converts a MathML string to a LaTeX string. The example demonstrates converting a simple expression with addition. Ensure the package is installed and the import path is correct. ```ts import { MathMLToLaTeX } from 'mathml-to-latex'; MathMLToLaTeX.convert('a+b'); // => 'a + b' ``` -------------------------------- ### Browser usage example with CDN and button Source: https://github.com/asnunes/mathml-to-latex/blob/main/README.md Complete HTML page for browser usage via CDN. Includes Tailwind CSS for styling and the mathml-to-latex UMD bundle. It sets a default MathML value and converts it to LaTeX on button click, displaying the result. ```html MathML to LaTeX Converter

MathML to LaTeX Converter

``` -------------------------------- ### Convert simple MathML addition to LaTeX Source: https://github.com/asnunes/mathml-to-latex/blob/main/README.md Basic usage example: converts a simple MathML expression (a + b) to LaTeX. Demonstrates the import syntax and the convert method. The expected output is 'a + b'. ```javascript import { MathMLToLaTeX } from 'mathml-to-latex'; // const { MathMLToLaTeX } = require('mathml-to-latex'); const mathml = ` a + b `; MathMLToLaTeX.convert(mathml); // => a + b ``` -------------------------------- ### Convert matrix MathML to LaTeX bmatrix Source: https://github.com/asnunes/mathml-to-latex/blob/main/README.md Converts a MathML matrix wrapped in square brackets to a LaTeX bmatrix. Shows conversion of mtable to a matrix. Expected output: A = \begin{bmatrix} x & y \\ z & w \end{bmatrix}. ```javascript import { MathMLToLaTeX } from 'mathml-to-latex'; // const { MathMLToLaTeX } = require('mathml-to-latex'); const mathml = ` A = x y z w `; MathMLToLaTeX.convert(mathml); // => A = \begin{bmatrix} x & y \\ z & w \end{bmatrix} ``` -------------------------------- ### Import mathml-to-latex in ES Modules and CommonJS Source: https://github.com/asnunes/mathml-to-latex/blob/main/README.md Shows the two module format import styles: ES Modules (import) and CommonJS (require). The package automatically selects the correct format via its exports map. ```javascript import { MathMLToLaTeX } from 'mathml-to-latex'; ``` ```javascript const { MathMLToLaTeX } = require('mathml-to-latex'); ```