---
title: "LaTeX with Mermaid, Graphviz and D2 diagrams — TeXForge"
source: "https://univerlab.org/texforge/"
---

[UniverLab · open laboratory](/)EXP-002

# TeXForge

Movable type once took a workshop. Now it takes one binary.

A single Rust binary that scaffolds, lints, formats, proofreads and compiles your document, then lets you inspect what came out — the text a reader sees, the fonts, the metadata, and which section opens each page. The LaTeX engine arrives by itself on first build, and Mermaid, Graphviz or D2 diagrams render inside your `.tex` files with no browser and no Node.js. Code blocks come out highlighted the same way: the highlighter is compiled into the binary, so no Pygments and no shell-escape.

LaTeX → one self-contained toolchain → reproducible documents

[Star on GitHub ↗](https://github.com/UniverLab/texforge)[Documentation →](/texforge/docs/)

Install

macOS / LinuxWindows

`curl -fsSL https://install.univerlab.org/texforge | sh``irm https://install.univerlab.org/texforge.ps1 | iex`⧉✓

![](/bench/machines/texforge-day-450.webp)

EXP-002 · active · Sol 87 (2026-03-28) · [release v0.10.1 · 3 weeks ago](https://github.com/UniverLab/texforge/releases/tag/v0.10.1) · roadmap: · · Built with [Canopy](/canopy/) · Repository set up with [ghScaff](/ghscaff/) · Demo recorded with [DemoStage](/demostage/) · Commits checked by [GitKit](/gitkit/)

Latest release: v0.10.1 (2026-10-06)

Genesis · 2026 · Sol 87 (2026-03-28)

## Born from a thesis.

A master’s thesis, written with AI in the loop. Overleaf charged, TeXstudio was too heavy, VSCode wanted an extension for everything. All I wanted was Mermaid diagrams in my LaTeX — which of course meant Node and a pile of `.mmd` files. I duct-taped a latexmake to render the missing ones. It held the way duct tape holds. And every error sent the model scrolling a thousand-line build log to find one bad line. TeXForge condenses all of that into a binary and a skill.

Fig. 1TeXForge — recorded with DemoStage

> Writing LaTeX should not require installing four gigabytes of toolchain.

The whole press

    \begin{mermaid}
    flowchart LR
      tex[.tex] --> lint --> typeset
      typeset --> pdf[(PDF)]
      lint -.->|error| log
    \end{mermaid}

Fig. 1 · build pipeline · mermaid

*   01**Compose** — templates with placeholders that already know your name.
*   02**Proof** — a linter that catches broken refs, missing files and unclosed environments before the press runs.
*   03**Proofread** — spell-checking that reads the language from the document — Babel, polyglossia, or your configured default — and checks prose against the right dictionary.
*   04**Set** — one canonical format, like rustfmt for .tex. Clean diffs forever.
*   05**Illustrate** — Mermaid, Graphviz and D2 blocks become figures at build time, rendered in pure Rust.
*   06**Highlight** — code blocks become framed listings with line numbers and captions, coloured at build time — light, dark or mono for print.
*   07**Inspect** — the compiled PDF — text, fonts, metadata, page diffs and whether every source word survived.
*   08**Print** — Tectonic compiles deterministically; watch mode reprints as you write.

![A Python code block typeset by texforge: a light frame, line numbers in the margin, keywords, strings and numbers in colour.](/demos/texforge-listing.webp)

Fig. 5 · listing as printed · python

Templates

### 13 templates in the open registry

| name | description | version |
| --- | --- | --- |
| apa-generalCopy | Academic report or thesis with chapters, and APA 7 tables, figures and references | 0.3.0 |
| apa-unisalleCopy | APA 7 thesis proposal for Universidad de La Salle | 0.3.0 |
| apa7-studentCopy | APA 7 student paper with student title page, double spacing, headings, tables and references | 0.1.0 |
| articleCopy | Single-column academic article with running heads and author affiliations | 0.3.0 |
| bookCopy | Long-form book layout with epigraphs and front matter | 0.2.0 |
| cvCopy | Clean, ATS-friendly curriculum vitae | 0.1.0 |
| generalCopy | Editorial foundation for essays and other documents, with serif type and spaced paragraphs | 0.3.0 |
| ieeeCopy | IEEE journal format for technical papers | 0.2.0 |
| letterCopy | Formal letter template for professional correspondence | 0.2.0 |
| reportCopy | Structured university report with front matter, contents and appendices | 0.3.0 |
| slidesCopy | 16:9 presentation slides with code and diagrams | 0.1.0 |
| technical-briefCopy | Concise technical update with callouts, diagrams, code and results | 0.2.0 |
| workshopCopy | Workshop handout with a cover page, workflow, code and test table | 0.3.0 |

Every row copies the command; my-doc is your project name: `texforge new my-doc -t apa-general`

The `general` template ships embedded in the binary so creating a document works even offline.

[texforge-templates ↗](https://github.com/UniverLab/texforge-templates)

FAQ

## FAQ

What problem does TeXForge solve?

Compiling LaTeX normally requires installing TeX Live (4+ GB), then separate tools for Mermaid, Graphviz, and D2 diagrams — each with its own setup. TeXForge is a single ~15 MB binary that handles everything: scaffolding, linting, formatting, diagrams, and compilation.

Can AI agents use TeXForge to work with LaTeX?

Yes. An agent can run texforge build without installing anything — the LaTeX engine downloads on first use. Errors are concise (not 1000-line logs), and diagrams render inside .tex files without Node.js or external tools.

Does TeXForge support Mermaid and D2 diagrams in LaTeX?

Yes. Write a Mermaid, Graphviz, or D2 block directly in your .tex file. TeXForge renders it to a figure at build time, in pure Rust, with no browser or Node.js required.

How does spell-checking work in languages other than English?

The language comes from the document itself — \\usepackage\[spanish\]{babel} or polyglossia — and falls back to your configured default when nothing is declared. Spanish is checked against a Hunspell dictionary with affix rules, so soluciones is recognised from the stem solución without being stored as its own entry. Dictionaries download on first use into ~/.texforge/dicts/.

Field notes