# XWUIMath

Native math rendering with **zero external libraries**. XWUIMath parses a
LaTeX subset and emits MathML Core, which every modern browser (Chrome 109+,
Firefox, Safari) lays out natively.

## Usage

```ts
import { XWUIMath } from '@exonware/xwui';

new XWUIMath(document.getElementById('app')!, {
  content: '\\frac{-b \\pm \\sqrt{b^2 - 4ac}}{2a}',
}, { display: 'block' });
```

## Supported subset

- Identifiers, numbers, operators; `^` superscript, `_` subscript
- `\frac{a}{b}`, `\sqrt{x}`, `\sqrt[n]{x}`, `\text{…}`
- Big operators with limits: `\sum`, `\prod`, `\int`, `\oint`, `\lim`
- Greek letters and common symbols (`\alpha`, `\infty`, `\leq`, `\to`, …)
- Accents: `\hat`, `\bar`, `\vec`, `\tilde`, `\dot`
- Sets: `\mathbb{R}`, `\in`, `\subset`, `\cup`, `\cap`, `\forall`, `\exists`
- Matrices: `\begin{pmatrix} a & b \\ c & d \end{pmatrix}`
- Fences: `\left( … \right)`; spacing `\, \; \quad \qquad`

## Configuration

- `display`: `'block'` (centered) | `'inline'` (flows with text)
- `showSource`: show the raw source under the output
- `scale`: font-size multiplier

The standalone parser is exported as `latexToMathML(src, display)` for reuse.

## Inline in Prose

Inline-mode math set inside a running sentence, the way a textbook reads.

```example
file: examples/InlineProse.ts
html: examples/InlineProse.html
title: Inline in Prose
description: Euler's identity rendered inline so it flows on the baseline mid-sentence.
```

## Calculus Reference Card

Core calculus identities enlarged via the scale option for a study card.

```example
file: examples/CalculusReference.ts
html: examples/CalculusReference.html
title: Calculus Reference Card
description: A stacked card of derivative and integral rules rendered at 1.4× scale.
```
