Project

EarthSciAST

The EarthSciML Abstract Syntax Tree format: schema, operators, coupling, and five language bindings.

Contents

This is the documentation for the older version v0.15.1. For the latest release, see v0.17.0.

The Typst math round trip, at the string level

Lean module Esm.Document.Math.RoundTripTypst, formal/Esm/Document/Math/RoundTripTypst.lean at 86bed77c797f
Imports Esm.Document.Math.TokTypst

def printTypst (S : Sym) (e : Json) : String

The Typst math spelling of an expression under the symbol table S.

def parseTypst (S : Sym) (s : String) : Option Json

Read Typst math under the symbol table S.

theorem parseTypst_printTypst (S : Sym) (e : Json) (he : isE e = true) :
    parseTypst S (printTypst S e) = some e

The Typst round trip: every well-formed expression reads back from its Typst spelling, under every symbol table (collisions included: the printer switches the names involved to the explicit form).