Enter LaTeX code:

Introduction:

LaTeX is a plain-text markup system that encodes mathematical notation, allowing scholars and engineers to describe complex equations with keyboard characters instead of graphical editors. Its terse commands map directly to symbols, operators, and layout directives.

This tool decodes your LaTeX input into a structured math model, renders the notation in a high-fidelity SVG preview, and re-encodes it to multiple media formats. A reactive engine updates the preview as you type, while an export layer packages the graphic or MathML source for download.

Use it to drop polished formulas into slide decks, technical reports, or learning platforms without installing desktop typesetting suites. *Check that downstream platforms support the chosen format to avoid rasterisation artefacts.*

Technical Details:

Concept Overview

On each keystroke, the decoder parses LaTeX tokens into an abstract syntax tree, resolves macros, and maps glyphs to Unicode code-points. A rendering layer transforms this tree into Scalable Vector Graphics (SVG) and parallel MathML, ensuring both print-quality output and accessibility for assistive technologies.

Core Process

  1. Tokenise input string into commands, groups, and text nodes (ti).
  2. Build a syntax tree T from t with box-model dimensions.
  3. Generate SVG paths and baseline metrics from T.
  4. Optionally rasterise the SVG to PNG / JPEG at scale factor s ≥ 1.
  5. Package SVG into PDF or emit MathML source.

Export Semantics

FormatMIME TypeTypical Use
SVGimage/svg+xmlWeb embedding; infinite scaling
PNGimage/pngSlide decks; transparent background
JPEGimage/jpegDocs requiring lossy compression
PDFapplication/pdfPrint workflows; vector preserved
MathMLapplication/xmlScreen-reader compliance

Worked Example

Input:

\displaystyle x=\frac{-b\pm\sqrt{b^{2}-4ac}}{2a} parse → AST AST → SVG (vector) SVG × 3 → PNG 1200 × 400 px

Assumptions & Limitations

  • Unicode math fonts must be available locally otherwise glyph fallback occurs.
  • Very long equations may exceed browser canvas size on low-memory devices.
  • Raster outputs inherit a white background to maximise contrast.
  • Custom LaTeX packages are unsupported; stick to core math commands.

Edge Cases & Error Sources

  • Unbalanced braces halt parsing.
  • Undefined commands render as plain text.
  • Nested fractions deeper than five levels may clip.
  • Emoji or non-Latin characters do not map to math fonts.

Scientific Validity & References

Concepts align with TeXbook principles, W3C MathML 4 draft, and ISO 32000-2 PDF specification for embedded SVG streams.

Privacy & Compliance

No input leaves your browser, satisfying GDPR data-minimisation guidelines.

Step-by-Step Guide:

Follow these steps to transform LaTeX into reusable graphics.

  1. Paste or type your LaTeX code in the editor.
  2. (Optional) Click a toolbar snippet to insert common symbols.
  3. Review the live SVG preview under the editor.
  4. Select an export button for SVG, PNG, JPEG, PDF, or MathML.
  5. Save the downloaded file to your project folder.
  6. Verify readability on dark backgrounds when using raster formats.

FAQ:

Is my data stored?

All processing occurs locally; the application never transmits or saves your LaTeX code beyond the current session.

Why does the preview look pixelated?

The on-screen SVG is scaled to fit your viewport. Export to SVG or high-resolution PNG for sharp output.

Can I change the font?

The renderer selects the first available Unicode math font. Installing STIX Two or Latin Modern improves consistency.

How large can my equation be?

Equations wider than 5000 px may exceed canvas limits on older devices. Break expressions or export vector formats.

Does MathML work in all browsers?

Full native support remains limited; however, assistive technologies and modern reader engines increasingly recognise MathML.

Glossary:

LaTeX
Markup language for scientific typesetting.
MathML
XML dialect describing mathematical content.
SVG
Vector graphic format rendered by browsers.
Rasterisation
Conversion of vector paths into bitmap pixels.
Glyph
Visual representation of a character symbol.