Typesetting LaTeX equations locally with self-hosted KaTeX
Academic authors, educators, and engineers often rely on remote TeX APIs that log unpublished equations or return blurry low-resolution bitmaps. This browser converter preloads self-hosted KaTeX assets on mount so every formula renders locally inside your tab with zero network requests.
Quick symbol pills, Display mode vs Inline, and typo hints
Seven quick-insert pills (Fraction, Sum, Integral, Root, Matrix, Cases, and Greek) insert common templates at your cursor inside the LaTeX expression box. Under Typesetting mode, Display mode sets tall limits above and below integrals and sums, while Inline keeps expressions compact.
Built-in validation runs with throwOnError: true and trust: false against the KaTeX Supported Functions Documentation, catching misspelled macros like \frca or \srqt with closest-match suggestions. If you want to turn full Markdown documentation rather than isolated math into graphics, turn Markdown & READMEs into crisp PNG or JPG cards.
Batch extracting equations from .tex and .md files
Dropping a .tex, .latex, .md, or .markdown file scans for equation, align, gather, multline, and $$...$$ math blocks automatically. When two or more formulas are detected, numbered tabs (Formula 1, Formula 2, and so on) let you review each expression before clicking Export all as ZIP to download <stem>-formulas.zip.
Even plain .tex documents without a \documentclass preamble split cleanly across blank-line boundaries while stripping % comments, so lecture notes and homework sets convert in one batch.
When should you export a math formula as SVG vs PNG or WebP?
Export as SVG when you need infinite vector zoom in web docs or vector editors, and choose 4x or 6x PNG when pasting into slides, Notion, or Word documents that do not accept SVG <foreignObject> markup. Under the W3C PNG Third Edition Specification, lossless 8-bit alpha preserves sharp subscripts and fraction bars on any backdrop.
Raster exports scale from the 28 px base font size at 2x, 4x, or 6x resolution, while JPG and WebP encode at 0.94 quality by default to keep edges crisp.
| Format | Scaling behavior | Alpha transparency | Best equation workflow |
|---|---|---|---|
| PNG | 2x, 4x, or 6x raster |
Full 8-bit alpha | Keynote, PowerPoint, Google Slides, Word, Notion |
| SVG | Infinite vector zoom | Full alpha | Web documentation, modern browsers, scalable embeds |
| WebP | 2x, 4x, or 6x raster |
Full 8-bit alpha (0.94 quality) |
Lightweight web articles and documentation pages |
| JPG | 2x, 4x, or 6x raster |
Opaque solid fill (0.94 quality) |
Flat white or dark cards where alpha is not needed |
When you want to build composite educational cards combining HTML callouts and custom CSS grids around an equation, pair your workflow with the HTML to PNG converter.
How standalone SVGs use WOFF2 font embedding
Most browser SVG exporters fail on another computer because they link to external CSS files or assume local TeX fonts are installed. This tool detects which Computer Modern fonts your formula actually uses and embeds only those subsets inside the SVG.
Subset font detection from the 20-file KaTeX catalog
The self-hosted font catalog contains 20 .woff2 files covering KaTeX_Main, KaTeX_Math, KaTeX_AMS, KaTeX_Caligraphic, KaTeX_Fraktur, KaTeX_SansSerif, KaTeX_Script, KaTeX_Typewriter, and KaTeX_Size1 through KaTeX_Size4.
Before building the SVG, the exporter inspects the rendered KaTeX classes and embeds only the referenced @font-face rules as Base64 data URIs. Following the W3C WOFF File Format 2.0 Specification keeps standalone SVG files compact and portable across devices.
Bounding-box measurement inside SVG foreignObject
Tall radicals, stacked fractions, and matrix brackets often clip if an exporter measures only the outer container box. To prevent cutoffs, the live DOM probe unions the bounding boxes of every visible non-spacer <span> inside .katex-html and adds 0 to 160 px of configurable padding.
Once exported, you can trim redundant metadata from standalone vector assets with the SVG optimizer.
Styling white equations for dark slides and troubleshooting
Dark presentation decks and technical blogs require high-contrast white or custom-colored ink on transparent backdrops. Selecting White under Ink color automatically switches Background from White to Dark if needed, or lets you pick Transparent with a dark checkerboard preview.
Ink color, transparent backdrops, and JPG fallback rules
You can choose Black, White, or Custom hex ink alongside Transparent, White, Dark (#111111), or Custom backgrounds. Because JPEG does not support alpha transparency, Transparent is hidden when Format is JPG and falls back to #FFFFFF.
Under the W3C SVG 2 Embedded Content Specification, each formula is wrapped inside an SVG <foreignObject> container with BASE_FONT_PX (28 px) and centered flex alignment before rasterizing to PNG, JPG, or WebP.
Fixing unknown macro errors and delimiter wrappers
If KaTeX reports an undefined control sequence, unclosed braces, or mismatched delimiters, the live preview displays the exact syntax error instead of exporting a broken image. Outer $...$ and $$...$$ delimiters strip automatically on paste.
Check that every \begin{...} environment has a matching \end{...} tag and that \frac{a}{b} includes both numerator and denominator brace groups before exporting.
Tip: Use Copy PNG with Transparent background and 4x scale to paste sharp equations straight into Keynote or Google Slides without saving temporary files.
When preparing full academic manuscripts alongside your equation figures, you can also generate editable Word drafts from Markdown notes locally in your browser.