Languages & compilers

Typst & Office

Write in Typst. Share editable Word documents and PowerPoint decks. Bring Office and LaTeX back into source.

Recorded result

Explore the example
main.typ∑ xᵢ / n Word / DOCXPowerPoint / PPTX Source + structure
Project illustration.

Why I’m interested

A document is more useful when its structure survives the trip. I want to write with the control of a programming language, reuse the same content and layout rules, and still give someone a Word file they can edit. That puts compiler design right next to an everyday problem: keeping equations, tables, references, and review edits meaningful across formats.

Progress

My Typst fork includes native DOCX and PPTX export, Office import, fidelity reports, and a Word review workflow that returns text edits to the original source. The browser exporter handles complete local projects. My local Typst Studio adds visual edits, reusable briefs, native charts, and shared data with source evidence. My Tylax fork covers LaTeX conversion and its artifact contracts. The examples below put that work beside its recorded validation.

A document people can work with

Typst combines a typesetter with a programming language. Functions and templates make the layout reusable. The Office work extends that control to the files people exchange: briefs, papers, tables, and slide decks.

Try the browser exporter
Follow a document through the system

Keep the document’s meaning in Word

Word lays out a stream of paragraphs. The exporter reads Typst’s document structure and creates native headings, lists, table cells, references, footnotes, and equations. Word can then edit those objects.

  1. Resolve the pageCompile the reference layout to resolve page sizes, counters, and citations.
  2. Read the structureRealize the document for DOCX and build typed Word objects.
  3. Write the packageEmit Office Open XML with styles, relationships, and a fidelity report.

The sample includes 13 native paragraphs, one Word table, and one OMML equation. The preview shows Typst’s reference page. The download is the actual Office export.

Typst reference brief with headings, a two-column table, an equation, and a footnote
Real Typst render. The DOCX contains editable Office objects.

Use the finished page as a slide canvas

PowerPoint starts with coordinates. The exporter walks Typst’s laid-out page and places text, shapes, images, tables, and equations on the slide. Compiler tags recover the structure inside that geometry.

  1. Lay out the sourceTypst resolves the page before the exporter reads it.
  2. Walk the canvasRead objects in paint order and recover semantic regions from layout tags.
  3. Build editable slidesWrite DrawingML objects, slide relationships, and supported speaker notes.

This 16:9 sample reuses the brief’s content. Its PPTX contains six native text shapes, 13 text runs, one DrawingML table, and one OMML equation. Recipients can edit the text and table.

Typst reference slide with the same headings, table, and equation as the brief
One Typst page becomes one slide. This preview is the Typst reference.

Bring existing Office files into source

The importers read arbitrary DOCX and PPTX packages. They resolve styles, numbering, media, slide masters, and theme colors before they produce Typst source and extracted assets.

DOCX import recovers a flowing document. PPTX import preserves authored coordinates by default and produces Touying slides. A second mode promotes recognized placeholders into source that follows the slide’s content flow.

The loss report names each known approximation or dropped object. Charts can become data tables or plots. Comments and revisions survive as metadata. EMF/WMF media, animations, transitions, and embedded OLE objects remain gaps.

Read the import support and commands
Word
.docx
PowerPoint
.pptx
Resolve the Office modelStyles / numbering / masters / themes
Editable source
.typ + assets
Recorded losses
report.json
Two document models, with a shared package reader and explicit loss reports.

Let someone edit in Word, then return to Typst

The review exporter tags source regions and keeps a separate baseline. After a reviewer edits the DOCX, a three-way comparison finds the Word change, the original text, and any local source edits.

Plain source text in headings, paragraphs, lists, table cells, headers, footers, and footnotes can return to its original location. Existing style wrappers stay intact. Repeated review cycles retain the same workflow.

Formatting changes, structural changes, and ambiguous source matches produce conflicts. The importer escapes literal text before it writes Typst. Word comments stay review annotations.

Read the review workflow
Source baselineThe estimate is 0.20.
Word editThe estimate is 0.20 0.24.
Local Typst sourceThe estimate is 0.20.
Apply the matched text editThe estimate is 0.24.Retain surrounding Typst structure
Illustrative conflict-free text edit. A conflict requires an explicit decision.
See the source and export evidence

Both samples include the same content.typ. Their entrypoints set the page geometry and type. Rust/WASM produced the DOCX and PPTX on October 10, 2026. XML and internal relationship checks passed.

#set page(width: 420pt, height: 580pt)
#include "content.typ"

// The slide entrypoint uses the same content.
#set page(width: 720pt, height: 405pt)
#include "content.typ"

Typst 0.15.0 produced the SVG and PDF references. These renders show the source layout. Office render, edit, and reopen checks remain separate.

Edit the page without losing the source

My local Typst Studio connects visual annotations to source edits. A selection retains the document revision and component identity. A change compiles before it becomes the new document. Undo restores the edit and its data together.

Company briefs and tearsheets use reusable components. Shared datasets bind metrics, charts, and tables to the same values. Source records retain dates, excerpts, and evidence. A manual override remains visible.

Native Lilaq charts compile inside Typst. The small example here shows why shared data matters: one value changes the metric, bar, and table cell together.

Change the final sample value

These are two recorded Typst builds with illustrative data. The Studio service uses Python, a Rust parser, and a web viewer. Typst renders the native charts.

Inspect the chart source
Lilaq render with metric 8, final bar at 8, and final table cell 8Lilaq render with metric 11, final bar at 11, and final table cell 11
Actual native Lilaq 0.6.0 renders. One source value feeds all three views.

The rest of the Office work

Research documents

Headings and styles, equations, tables, citations, bibliographies, cross-references, contents, notes, page sections, headers, and footers. These are the structures that make a brief or paper useful after export.

Decks and graphics

Native text, shapes, gradients, images, tables, equations, placeholders, and speaker notes. SVG carries a PNG compatibility fallback. Complex diagrams and transforms use positioned images.

Local browser export

Rust runs as WebAssembly. A source file, project folder, or ZIP stays in browser memory. Relative imports, binary assets, bundled fonts, and vendored packages keep their paths. The hosted demo exports DOCX and PPTX.

Reports and acceptance limits

Reports distinguish native, approximate, rasterized, and dropped content. CLI limits can reject an export with too many recorded losses. Native paragraph reflow and font substitution still require a check in Office.

Pandoc and compiler performance branches

The fork also contains a typed Pandoc JSON target. It evaluates Typst before export, but remains incomplete and unsupported. The HarfRust and line-break performance work lives on a separate branch. This page makes no speed claim for that branch.

Read the Pandoc status

Progress, with the evidence attached

Each result belongs to the revision and date in its record.
WorkRecorded resultNext gap
Office samples
October 10, 2026
Fresh DOCX and PPTX exports. Editable text and OMML math appear in the package. XML and internal relationships pass.Render, edit, save, and reopen these files in Word and PowerPoint.
Compiler integration
October 2, 2026
Upstream merge, 91/91 Office construct cases, and schema checks for two DOCX fixtures and one PPTX fixture.Refresh corpus and native Office results. Package checks do not measure visual fidelity.
Package and CLI coverage
October 2 audit
343 DOCX export, 77 PPTX export, 95 DOCX import, and 18 PPTX import cases retained. Review tests cover two complete edit cycles.PowerPoint text-box baselines and native table rendering remain specific fidelity issues.
Typst Studio
Local working project
Source-owned annotations, reusable components, native Lilaq charts, guarded data edits, provenance, and Undo.The website shows two recorded renders. The live authoring controls run in the local Studio tool.
LaTeX conversion
October 2 review
Tylax’s typed compiler, complete output bundles, bounded native verification, and worker-based browser conversion. 1,745 Rust tests passed in that record.Full-document source/target visual acceptance. The three older examples below retain their Degraded grade.

Follow the mathematics into Typst

Choose a fraction, matrix, or sum and compare its LaTeX source, converted Typst, and preview.

Choose an example

From LaTeX source to Typst output

The source becomes a Typst document with a rendered preview. Tylax reports Degraded because amsmath has no active handler, even though the converted math compiles.

From LaTeX source to Typst output
Converter
Tylax 0.3.6
Artifact grade
Degraded
Preview compiler
Typst 0.15.1

Input

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\[\frac{a}{b} + \sqrt{x}\]
\end{document}

Result

#set text(font: "New Computer Modern", size: 10pt)
#set par(leading: 2pt)

$ frac(a, b)+sqrt(x) $

From LaTeX source to Typst output

The source becomes a Typst document with a rendered preview. Tylax reports Degraded because amsmath has no active handler, even though the converted math compiles.

From LaTeX source to Typst output
Converter
Tylax 0.3.6
Artifact grade
Degraded
Preview compiler
Typst 0.15.1

Input

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\[\begin{pmatrix}1 & 2 \\ 3 & 4\end{pmatrix}\]
\end{document}

Result

#set text(font: "New Computer Modern", size: 10pt)
#set par(leading: 2pt)

$ mat(delim: "(", 1, 2; 3, 4) $

From LaTeX source to Typst output

The source becomes a Typst document with a rendered preview. Tylax reports Degraded because amsmath has no active handler, even though the converted math compiles.

From LaTeX source to Typst output
Converter
Tylax 0.3.6
Artifact grade
Degraded
Preview compiler
Typst 0.15.1

Input

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\[\sum_{i=1}^{n} i = \frac{n(n+1)}{2}\]
\end{document}

Result

#set text(font: "New Computer Modern", size: 10pt)
#set par(leading: 2pt)

$ sum_(i = 1)^(n)i=frac(n ( n + 1 ) , 2) $

These retained examples record Tylax 0.3.6 output and Typst 0.15.1 previews. Their Degraded grade preserves the missing amsmath-handler diagnostic from that recording. The October architecture work above has a separate evidence record. SciPenAI authors Tylax.

Sources and reference notes

Upstream converter

Reference: Tylax by SciPenAI. The examples record output from the native Rust converter and preserve its artifact grades.
Read the original source

What comes next

Rerun the document corpus and native Office render, edit, and reopen checks against the current fork. Fix the remaining PowerPoint text baselines and table rendering cases. Complete the browser import and review paths, and verify Tylax output with its target compiler.

Implementation and credits

What survives when a document moves between source, a printed page, and an editable Office file?

Typst Office export and import, Word review, document tooling, and Tylax conversion share this page. Public samples contain original demonstration content.

Explore Word, PowerPoint, Office import, and source review. Download the generated files and compare the LaTeX examples.

Rust implements the compiler, Office exporters, importers, and converter. The browser exporter runs Rust as WebAssembly. This page uses native HTML controls and Typst-rendered SVG previews.

Typst is the upstream compiler. My community fork adds Office interoperability. SciPenAI authors Tylax. My Tylax fork covers semantic conversion and validation.

Back to the collection