Version: dev

This is the documentation for the development version. For the latest release, see v0.12.1.

The Typst printer writes only Typst tokens, in lexable order

Lean module Esm.Document.Math.TokTypst, formal/Esm/Document/Math/TokTypst.lean at 184aa13d35e5
Imports Esm.Document.Math.LexTypst, Esm.Document.Math.TokLatex

Every token of a printed well-formed expression is a Typst token (tokOK ), every call parenthesis follows a name-like token, and no unit block follows a unit block (Adj ), so the Typst lexer lemma applies to the printer’s output.

def Nice (ts : List Tok) : Prop

A list that may follow anything: it does not start with a call parenthesis or a unit block.

macro source
macro "gok" : tactic

Close Good, Nice and fact goals about a printed template from the pieces in the context.

Names

Printer pieces

macro source
macro "fixed" : tactic

The fixed tokens of a printed template.

Reductions

The induction

theorem print_ok proved source
theorem print_ok (S : Sym) (e : Json) (he : isE e = true) :
    (∀ t ∈ print .typst S e, tokOK t) ∧ Adj (print .typst S e) ∧ ∀ r, print .typst S e ≠ .kw .lp :: r

Every token the Typst printer writes for a well-formed expression is a Typst token, in an order the Typst lexer reads back.

This module also proves 41 lemmas without doc comments; they are in the source.