SOPHIA XT
Open source · MIT · version 0.1.0

Documents your agent can write, check and typeset without TeX.

texwright turns Markdown, LaTeX or a JSON document tree into PDF or HTML with its own TeX-style engine. Equations, cross-references, citations, footnotes and figures come out the way LaTeX sets them. There is no TeX installation and no browser: it is one Node.js package with no dependencies, and a check that answers in milliseconds tells the agent what to fix and where.

zip · 1.7 MB Node.js 20+ No dependencies Tested on Windows and Linux
A page set by texwright: a theorem and proof, a numbered display equation, a plotted SVG figure with its caption, a tip callout and the start of a code listing.

Page 2 of the showcase, as texwright set it

For agents

Give it to your agent in one line.

Paste this into any coding agent. The guide it points to is written for models: the syntax, the check-fix-render loop and what each diagnostic means.

Read https://sophiaxt.com/texwright/AGENTS.md and use texwright to make PDFs from Markdown or LaTeX.
01

Install from this page

npm installs straight from the tarball here. Nothing to register, nothing else to download.

npm install -g https://sophiaxt.com/texwright/texwright-latest.tgz
texwright doc.md -o doc.pdf
02

Or unzip and run

The zip is the same package. Unzip it anywhere with Node.js 20 or later and run it in place.

node texwright/dist/src/cli.js doc.md -o doc.pdf
03

As an MCP server

Eight tools: render, check, fix, outline, preview a page as PNG, the schema, the guide, and new documents from templates.

{
  "mcpServers": {
    "texwright": { "command": "texwright", "args": ["mcp"] }
  }
}
New in 0.1.0

SVG figures, drawn the way a browser draws them.

Agents make their figures as SVG: charts, diagrams, Mermaid and draw.io exports. texwright now draws gradients, transparency, masks, blend modes, filters, text on paths, HTML labels and full CSS selectors. Each pair below is Chrome on the left and texwright's PDF on the right, the PDF drawn by poppler.

0.7
Average difference from Chrome
levels of 255 per pixel, page previews
0.9
The PDF itself
drawn by poppler, same 30 figures
30
Test figures
gradients, masks, filters, text, diagram tools
Radial gradients, as Chrome draws it

Chrome

Radial gradients, as texwright's PDF shows it

texwright PDF

Radial gradients. Focal points and every spread method, as PDF shadings.
Fading stops, as Chrome draws it

Chrome

Fading stops, as texwright's PDF shows it

texwright PDF

Fading stops. Stops that differ in opacity, drawn through a soft mask.
Masks, as Chrome draws it

Chrome

Masks, as texwright's PDF shows it

texwright PDF

Masks. Luminance and alpha masks, in object or user units.
Drop shadows, as Chrome draws it

Chrome

Drop shadows, as texwright's PDF shows it

texwright PDF

Drop shadows. The shadow becomes an image; the shape stays vector.
Text on a path, as Chrome draws it

Chrome

Text on a path, as texwright's PDF shows it

texwright PDF

Text on a path. Each glyph placed and turned along the curve.
HTML labels, as Chrome draws it

Chrome

HTML labels, as texwright's PDF shows it

texwright PDF

HTML labels. Mermaid's foreignObject labels, wrapped and centred.
Blend modes, as Chrome draws it

Chrome

Blend modes, as texwright's PDF shows it

texwright PDF

Blend modes. mix-blend-mode as the PDF's own blend modes.
draw.io diagrams, as Chrome draws it

Chrome

draw.io diagrams, as texwright's PDF shows it

texwright PDF

draw.io diagrams. Shapes, arrows, labels and the shadow filter.
The loop

Problems come back as data, with the fix attached.

doc.md:3:5 E REF001 Reference to undefined label "sec:intr" | Did you mean "sec:intro"? | fix "sec:intr" -> "sec:intro" safe

01 · Check

Every stage but page layout, in milliseconds. One line per problem, with a code, a position and a hint.

texwright check doc.md --diagnostics compact

02 · Fix

Most diagnostics carry their fix as an edit. The unambiguous ones apply in one go.

texwright check doc.md --fix

03 · Render

The result says which page each heading, figure and table landed on.

texwright doc.md -o doc.pdf

04 · Look

The page as a PNG from texwright's own rasterizer, so the agent can see what it made.

texwright preview doc.md --page 2

What it sets

A paper, a homework set or a report, from plain text.

Page 1 of a texwright showcase: title, authors, abstract, a table of contents with page numbers, and numbered equations.
Page 1 of a LaTeX article typeset by texwright.

Mathematics by TeX's rules

amsmath and amssymb, numbered rows in align and gather, siunitx, mhchem and physics commands without loading anything.

References that resolve

Sections, figures, tables, equations, theorems and listings numbered, with @fig:x, \ref, \eqref, \cref and exact page references.

Citations

BibTeX or CSL-JSON, numeric or author-year.

Pages like LaTeX's

Knuth-Plass line breaking, TeX hyphenation, footnotes at the foot of the page, floating figures, Latin Modern type.

Three inputs, mixed freely

Markdown with pandoc's extensions, a LaTeX article subset, or a JSON document tree. LaTeX works inside Markdown.

Layout from the document

Paper, margins, size, theme, running heads and authors as pandoc's front-matter keys. No template to edit.

Measured

Tested on what models actually write.

79/80
Documents that render clean
written by models for a PDF, unchanged
1,513
Tests
passing on Windows and Linux
0
Runtime dependencies
Node.js built-ins only

We asked models for 80 documents (papers, homework, lecture notes, lab reports, CVs, letters, exams) written for pandoc or an ordinary LaTeX installation, then rendered them as they came. 79 render with no errors and no warnings. The one that does not draws its figure in TikZ. The method and the held-out results are in the paper.

What it does not do yet. TikZ and pgfplots drawings are reported rather than drawn: export those figures as SVG. Hyphenation is English only. Arabic, the Indic scripts and right-to-left text are not supported, the PDF is not tagged for screen readers, and PDF files cannot be used as figures.

Downloads

Everything, at addresses that do not move.

texwright-latest.zip and texwright-latest.tgz always hold the newest version, so an agent can keep one address.

FileWhat it isSizeSHA-256
texwright-0.1.0.zipThe package as a zip. Unzip and run with Node.js.1.7 MB179123c08fbd7351…
texwright-0.1.0.tgzThe same package for npm install.1.5 MB276ee255fc24f60d…
AGENTS.mdThe guide for agents: syntax, the loop, diagnostics.
CHEATSHEET.mdOne page of syntax.
texwright-paper.pdfThe paper: design, engine, benchmark, security.189 KB
release.jsonVersion, install line, sizes and full SHA-256 hashes.
llms.txtThis page for language models.

texwright is written by Thomas Garren at SOPHIA XT and released under the MIT licence. Its text is set in Latin Modern (GUST Font License) and its mathematics in the KaTeX fonts (SIL Open Font License); both ship inside the package.