Overview

About

MathInput wraps MathLive's <math-field> web component. LaTeX shortcuts auto-convert as you type (for example a/b renders as a fraction). Toggle Mode="MathInputMode.Source" to show raw LaTeX, or set ShowVirtualKeyboard="true" to surface the on-screen keyboard.

Basic

Basic

Type on the left; the LaTeX and MathML tabs update live on the right.

latex

Mode

Mode: Visual vs Source

Visual renders glyphs; Source exposes the raw LaTeX buffer.

Current: Visual

Virtual keyboard

Virtual keyboard

Focus either field to reveal the on-screen keyboard.

v1 note: MathLive only supports a floating keyboard. Both placement values currently resolve to "appears on focus, floats over content".

BelowField

Floating (focus-activated)

States

States

Forms

Form integration

Binds like any other field and participates in DataAnnotations validation.

Events

Events

Focus the editor, type, blur. The last 10 events appear below.

No events yet.

Dual output

Dual output (LaTeX + MathML)

Both outputs update live; store LaTeX as the canonical value.

LaTeX

latex

MathML

xml

Guidance

Do / Don't

Store LaTeX as the canonical form

Every major math library round-trips LaTeX. MathML is for accessibility and browser-native rendering contexts.

Validate formulas on save

MathLive renders whatever it can but does not block invalid syntax. Check string.IsNullOrWhiteSpace(Value) for Required fields, and consider server-side parsing if the formula must be mathematically valid.
An unhandled error has occurred. Reload 🗙

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please retry or reload the page.