Why matex
matex exists to answer one question: what would a document engine look like if the document's structure were treated as the source of truth, rather than as a hint for a layout algorithm?
The answer is a small, one-way pipeline:
dynamic ──compile──▶ static ──render──▶ PDF
│ │
└─ check ────────────┴─ check
Two kinds of source
- Static source is fully resolved. Every page, number and reference is
already written down. It is the only thing
renderaccepts. - Dynamic source is the authoring form. It may refer to things it does not
spell out — a section number, a citation, an equation label. It must pass
through
compilefirst, which resolves those references and emits static source.
The pipeline is one-way per run. Across runs, a document that prints a page count may need a second pagination pass. Nothing in the pipeline runs backwards; the build may run more than once.
The two properties that shape the design
Nothing happens behind the author's back at render time. Pages are declared
or produced by an explicit edit, never invented mid-render. render cannot
expand a component, break a line or choose a page.
Every loss is reported. Clipped content is a warning; a glyph the face cannot draw is an error. The engine never silently substitutes, stretches or drops content to make a page fit.
Two further consequences follow:
- one origin per property, so there is no cascade to explain a value;
- numbers are computed before layout, so no number depends on where a line lands.
The three document classes
The engine is measured against three kinds of work, not against a feature list.
1. Scientific papers
Figures, tables, equations and links that resolve: a reference to an equation jumps to that equation; a citation jumps to its entry in the bibliography. Numbering is automatic and stable across rebuilds.
2. Theses and books
The same apparatus at long-form scale: chapters and sections, an outline, running heads, page numbers, a generated table of contents, and a bibliography shared across the work.
3. Presentation slides
The same source language laid out as discrete pages rather than flowing text. Because the static dialect is already a display list of positioned lines, rects, images and links, slides are a reduction of the same source language, not a second engine.
What “done” means
All three classes can be authored in dynamic source, compiled, and rendered to a PDF a reader would accept — with no manual positioning, no hand-written page numbers and no broken links. The engine's other promises hold throughout: no silent fallback, no unexplained layout, one vocabulary.
Progress, measured honestly
Two numbers answer two different questions. Both are snapshots.
How much of the proposed architecture exists: about 13%, by scoring each of 25 decision records against its own stated scope and averaging. The denominator grows every time a proposal is written, so the numerator is the number to watch, not the ratio.
How much of the goal the architecture covers: about 65%, by asking whether a design exists for each goal area. Papers and long-form work are designed; slides now have a design; none of that is the same as implemented.
These figures come from the design record in the repository, not from a test suite. Read Status for what is actually built.
Reading order
- The pipeline — what each command owns.
- Architecture — the shape of the engine.
- Decisions — the choices behind the shape.
- Status — what works, and what does not.
- The specimen: source and PDF.