Skip to content

A Pluto.jl widget for WYSIWYG mathematical formula input, powered by MathLive.

License

Notifications You must be signed in to change notification settings

s-celles/PlutoMathInput.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PlutoMathInput.jl

A Pluto.jl widget for WYSIWYG mathematical formula input, powered by MathLive.

PlutoMathInput screenshot virtual keyboard 1 virtual keyboard 2 virtual keyboard 3 virtual keyboard 4

Features

  • 📝 WYSIWYG math editor — type formulas visually with TeX-quality rendering
  • 🔗 @bind compatible — 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 displayMathDisplay renders centered, read-only formulas from LaTeX or MathJSON

Installation

using Pkg
Pkg.add(url="https://github.com/s-celles/PlutoMathInput.jl")

Quick Start

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)

With MathJSON.jl

using PlutoMathInput, MathJSON

@bind formula MathInput()
expr = parse(MathJSONFormat, formula)

With Symbolics.jl

using PlutoMathInput, Symbolics

# Direct symbolic output
@bind sym_expr MathInput(format=:symbolics)

Options

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

Example Notebook

Open notebooks/example.jl in Pluto for an interactive demo.

Related Projects

License

MIT

About

A Pluto.jl widget for WYSIWYG mathematical formula input, powered by MathLive.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages