A Pluto.jl widget for WYSIWYG mathematical formula input, powered by MathLive.
- 📝 WYSIWYG math editor — type formulas visually with TeX-quality rendering
- 🔗
@bindcompatible — works seamlessly with Pluto's reactivity - 📦 MathJSON output — interoperable with MathJSON.jl
- 🧮 Symbolics.jl integration — optional conversion to symbolic expressions
- ⌨️ Virtual keyboard — touch-friendly math keyboard on mobile devices
- 🔄 Multiple output formats — MathJSON, LaTeX, or Symbolics.Num
- 🖥️ Read-only display —
MathDisplayrenders centered, read-only formulas from LaTeX or MathJSON
using Pkg
Pkg.add(url="https://github.com/s-celles/PlutoMathInput.jl")using PlutoMathInput
# Basic input — returns MathJSON string
@bind formula MathInput()
# With MathJSON default value
@bind formula MathInput(default="""["Add", "x", 1]""")
# With LaTeX default
@bind formula MathInput(latex="\\frac{x^2+1}{2}")
# Read-only display (centered, no editing)
MathDisplay(latex="E = mc^2")
# Read-only display from MathJSON
MathDisplay(default="""["Add", "x", 1]""")
# LaTeX output format
@bind tex MathInput(format=:latex)using PlutoMathInput, MathJSON
@bind formula MathInput()
expr = parse(MathJSONFormat, formula)using PlutoMathInput, Symbolics
# Direct symbolic output
@bind sym_expr MathInput(format=:symbolics)| Parameter | Type | Default | Description |
|---|---|---|---|
default |
String |
"" |
Default value as MathJSON |
latex |
String |
"" |
Default value as LaTeX |
format |
Symbol |
:mathjson |
Output: :mathjson, :latex, :symbolics |
disabled |
Bool |
false |
Read-only mode |
style |
String |
"" |
CSS style for container |
options |
Dict |
Dict() |
MathLive options (e.g., "smartFence" => true) — see docs |
macros |
Dict |
Dict() |
Custom LaTeX macros (e.g., "\\R" => "\\mathbb{R}") — see docs |
Open notebooks/example.jl in Pluto for an interactive demo.
- MathLive — the math editing library powering this widget (GitHub)
<math-field>— the web component (custom element) providing the interactive math input field- MathJSON — a JSON representation for mathematical expressions (specification)
- MathJSON.jl — Julia package to parse and manipulate MathJSON expressions
- Compute Engine — JavaScript symbolic computation engine by CortexJS
MIT




