Skip to main content

Write the structure.
The page follows.

matex is a typesetting engine for documents whose structure is explicit. Author in an XML-like language, compile to a static display list, render to PDF — with no cascade, no manual positioning, and no silent surprises.

Source
XML-like .mtx
Output
PDF, one file
Engine
Rust
Page one of a paper rendered by matex, with a title, two columns of prose, display math and a figure.A4 · compiled and rendered by matex
No cascadeNo hidden layoutNo silent fallbackNo page invented at draw time

Three commands. One direction.

Every artefact is inspectable. Compile writes a static file you can read; render draws only what that file states.

  1. 01

    collect

    resolve → expand → number

    Counts every citable kind in document order and writes one store per kind. Labels are positional, so they survive a rebuild.

  2. 02

    compile

    resolve → expand → paginate → emit

    Breaks lines, splits pages, lowers floats and footnotes, and writes one static file with every layout decision already made.

  3. 03

    render

    static source → PDF

    Lays the static file out and draws it. No page is invented here: render accepts static source only.

dynamic ──compile──▶ static ──render──▶ PDF

A source language with a point of view.

matex is not a browser in disguise. It is a document compiler: the author writes meaning and relationship, the engine decides measure, break and page — and reports when it cannot.

  1. Structure is explicit

    A page, a section, a cell, a number — each is written down or computed from something written down. Nothing is inferred from appearance, and nothing is placed by a stylesheet.

  2. One origin per property

    A value comes from the tag, a project default keyed by tag, or the engine. There is no selector, no cascade, and no rule reaching into another element.

  3. Numbers before layout

    collect computes labels after expansion and before anything is laid out. A number never depends on where a line happens to land, so it is stable across rebuilds.

  4. Every loss is reported

    A clipped float is a warning. A glyph the face cannot draw is an error. The engine will not quietly substitute, stretch or drop content to make a page fit.

A table is a grid you can check.

Cells are flat, spans are stated on the cell, and rules are their own elements. check simulates the placement and reports overlap, holes, and any row that does not close exactly.

Nothing is styled by a selector. A cell looks the way element.cell says, and a cell’s own attributes win.

Read the table model
A rendered table with four columns: sites, time, bandwidth and speed-up, closed by rules above and below.
The same table, after compile and render.

One class is supported. Three are designed.

The engine is pre-1.0. It does not claim completeness; it claims that what it does, it does without guessing.

  1. Class 1

    Scientific papers

    Supported

    Figures, tables, equations, footnotes, internal links, citations, running heads and multi-column flow. The reference paper on this site is class 1.

  2. Class 2

    Theses and books

    Designed, not built

    Contents pages that print page numbers, chapter apparatus, and a bibliography shared across a long work. The design exists; the implementation does not.

  3. Class 3

    Presentation slides

    Designed, not built

    A slide is a fixed page with no flow, so the design is a reduction of the same source language rather than a second engine.

Start with the pipeline.

Build the CLI, write a page, and read the static file it produces. The source is the documentation.