LaTeX to Typst Translation Guide
A comprehensive reference for converting LaTeX article-class documents to Typst.
When to Use This Skill
- User asks to convert, port, or translate a
.tex file to .typ
- User wants to know the Typst equivalent of a LaTeX command
- User is migrating an academic paper or report from LaTeX to Typst
- User needs help with specific LaTeX environments in Typst
Quick Navigation: Use What Reference
| Task |
Reference File |
| Overall document structure, preamble → set rules |
01-document-structure.md |
| Bold, italic, fonts, font sizes, colors |
02-text-formatting.md |
| Margins, page size, columns, headers/footers |
03-page-layout.md |
\section, \subsection, numbering |
04-headings-sections.md |
itemize, enumerate, description |
05-lists.md |
| Math mode, equations, aligned, matrices, operators |
06-math.md |
| Symbol table: arrows, Greek, operators, sets, logic |
07-math-symbols.md |
\includegraphics, figure environment, subfigures |
08-figures.md |
tabular, booktabs, tabularx, multirow/multicolumn |
09-tables.md |
BibTeX, biblatex, natbib → bibliography, cite |
10-bibliography.md |
\label, \ref, \eqref, \autoref |
11-cross-references.md |
| TikZ → CeTZ diagrams |
12-diagrams-cetz.md |
verbatim, lstlisting, minted; footnotes, links |
13-misc.md |
Key Conceptual Differences
Preamble → set and show Rules
LaTeX uses a \documentclass{article} preamble with \usepackage calls. Typst replaces this with set rules (for properties) and show rules (for transformations), placed at the top of the document.
% LaTeX
\documentclass[12pt,a4paper]{article}
\usepackage[margin=1in]{geometry}
\usepackage{fontenc}
\setmainfont{Times New Roman}
// Typst equivalent
#set page(paper: "a4", margin: 1in)
#set text(font: "Times New Roman", size: 12pt)
No \begin/\end Environments
Most LaTeX environments have direct Typst function equivalents. For example:
| LaTeX |
Typst |
\begin{equation}...\end{equation} |
$ ... $ (block, with space) |
\begin{figure}...\end{figure} |
#figure(...) |
\begin{tabular}...\end{tabular} |
#table(...) |
\begin{itemize}...\end{itemize} |
- item (markup) |
Content vs. Code Mode
In Typst, # switches from markup mode into code mode. Inside #{ } blocks or function arguments, you write code. Markup is the default.
Units
| LaTeX |
Typst |
Notes |
pt |
pt |
Same |
em |
em |
Same |
cm |
cm |
Same |
mm |
mm |
Same |
in |
in |
Same |
\textwidth |
100% (relative to container) |
— |
0.5\textwidth |
50% |
— |
Minimal Article Template
% LaTeX article
\documentclass[12pt]{article}
\usepackage[margin=1in]{geometry}
\usepackage{amsmath}
\title{My Paper}
\author{Jane Doe}
\date{\today}
\begin{document}
\maketitle
\begin{abstract}
This paper...
\end{abstract}
\section{Introduction}
Hello world.
\end{document}
// Typst equivalent
#set page(margin: 1in)
#set text(size: 12pt)
#align(center)[
= My Paper
Jane Doe \
#datetime.today().display()
]
#set par(justify: true)
*Abstract.* This paper...
= Introduction
Hello world.
For a more polished article template with abstract box, see 01-document-structure.md.
Workflow for Full Document Conversion
- Convert preamble →
#set page(), #set text(), #set par() (see 03-page-layout.md, 02-text-formatting.md)
- Convert sectioning →
=, ==, === (see 04-headings-sections.md)
- Convert math → inline
$...$, block $ ... $ (see 06-math.md, 07-math-symbols.md)
- Convert figures →
#figure(image(...), caption: [...]) (see 08-figures.md)
- Convert tables →
#table(...) or #figure(table(...), ...) (see 09-tables.md)
- Convert bibliography →
#bibliography("refs.bib") + @key citations (see 10-bibliography.md)
- Convert TikZ →
#canvas({...}) with CeTZ (see 12-diagrams-cetz.md)
- Fix cross-references →
<label> + @label (see 11-cross-references.md)
1---2name: latex-to-typst3description: Translates LaTeX documents (.tex) to Typst (.typ), focusing on article-class documents. Use when asked to convert, port, migrate, or translate LaTeX to Typst. Covers document structure, text formatting, page layout, math equations and symbols, figures, tables, TikZ-to-CeTZ diagrams, bibliography, cross-references, footnotes, and code blocks. Includes comprehensive symbol mapping tables.4---56# LaTeX to Typst Translation Guide78A comprehensive reference for converting LaTeX article-class documents to Typst.910## When to Use This Skill1112- User asks to convert, port, or translate a `.tex` file to `.typ`13- User wants to know the Typst equivalent of a LaTeX command14- User is migrating an academic paper or report from LaTeX to Typst15- User needs help with specific LaTeX environments in Typst1617## Quick Navigation: Use What Reference1819| Task | Reference File |20|------|---------------|21| Overall document structure, preamble → set rules | [01-document-structure.md](references/01-document-structure.md) |22| Bold, italic, fonts, font sizes, colors | [02-text-formatting.md](references/02-text-formatting.md) |23| Margins, page size, columns, headers/footers | [03-page-layout.md](references/03-page-layout.md) |24| `\section`, `\subsection`, numbering | [04-headings-sections.md](references/04-headings-sections.md) |25| `itemize`, `enumerate`, `description` | [05-lists.md](references/05-lists.md) |26| Math mode, equations, aligned, matrices, operators | [06-math.md](references/06-math.md) |27| Symbol table: arrows, Greek, operators, sets, logic | [07-math-symbols.md](references/07-math-symbols.md) |28| `\includegraphics`, `figure` environment, subfigures | [08-figures.md](references/08-figures.md) |29| `tabular`, `booktabs`, `tabularx`, multirow/multicolumn | [09-tables.md](references/09-tables.md) |30| BibTeX, biblatex, natbib → `bibliography`, `cite` | [10-bibliography.md](references/10-bibliography.md) |31| `\label`, `\ref`, `\eqref`, `\autoref` | [11-cross-references.md](references/11-cross-references.md) |32| TikZ → CeTZ diagrams | [12-diagrams-cetz.md](references/12-diagrams-cetz.md) |33| `verbatim`, `lstlisting`, `minted`; footnotes, links | [13-misc.md](references/13-misc.md) |3435## Key Conceptual Differences3637### Preamble → `set` and `show` Rules3839LaTeX uses a `\documentclass{article}` preamble with `\usepackage` calls. Typst replaces this with **`set` rules** (for properties) and **`show` rules** (for transformations), placed at the top of the document.4041```tex42% LaTeX43\documentclass[12pt,a4paper]{article}44\usepackage[margin=1in]{geometry}45\usepackage{fontenc}46\setmainfont{Times New Roman}47```4849```typst50// Typst equivalent51#set page(paper: "a4", margin: 1in)52#set text(font: "Times New Roman", size: 12pt)53```5455### No `\begin`/`\end` Environments5657Most LaTeX environments have direct Typst function equivalents. For example:5859| LaTeX | Typst |60|-------|-------|61| `\begin{equation}...\end{equation}` | `$ ... $` (block, with space) |62| `\begin{figure}...\end{figure}` | `#figure(...)` |63| `\begin{tabular}...\end{tabular}` | `#table(...)` |64| `\begin{itemize}...\end{itemize}` | `- item` (markup) |6566### Content vs. Code Mode6768In Typst, `#` switches from markup mode into code mode. Inside `#{ }` blocks or function arguments, you write code. Markup is the default.6970### Units7172| LaTeX | Typst | Notes |73|-------|-------|-------|74| `pt` | `pt` | Same |75| `em` | `em` | Same |76| `cm` | `cm` | Same |77| `mm` | `mm` | Same |78| `in` | `in` | Same |79| `\textwidth` | `100%` (relative to container) | — |80| `0.5\textwidth` | `50%` | — |8182## Minimal Article Template8384```tex85% LaTeX article86\documentclass[12pt]{article}87\usepackage[margin=1in]{geometry}88\usepackage{amsmath}89\title{My Paper}90\author{Jane Doe}91\date{\today}92\begin{document}93\maketitle94\begin{abstract}95This paper...96\end{abstract}97\section{Introduction}98Hello world.99\end{document}100```101102```typst103// Typst equivalent104#set page(margin: 1in)105#set text(size: 12pt)106107#align(center)[108 = My Paper109 Jane Doe \110 #datetime.today().display()111]112113#set par(justify: true)114115*Abstract.* This paper...116117= Introduction118119Hello world.120```121122For a more polished article template with abstract box, see [01-document-structure.md](references/01-document-structure.md).123124## Workflow for Full Document Conversion1251261. **Convert preamble** → `#set page()`, `#set text()`, `#set par()` (see [03-page-layout.md](references/03-page-layout.md), [02-text-formatting.md](references/02-text-formatting.md))1272. **Convert sectioning** → `=`, `==`, `===` (see [04-headings-sections.md](references/04-headings-sections.md))1283. **Convert math** → inline `$...$`, block `$ ... $` (see [06-math.md](references/06-math.md), [07-math-symbols.md](references/07-math-symbols.md))1294. **Convert figures** → `#figure(image(...), caption: [...])` (see [08-figures.md](references/08-figures.md))1305. **Convert tables** → `#table(...)` or `#figure(table(...), ...)` (see [09-tables.md](references/09-tables.md))1316. **Convert bibliography** → `#bibliography("refs.bib")` + `@key` citations (see [10-bibliography.md](references/10-bibliography.md))1327. **Convert TikZ** → `#canvas({...})` with CeTZ (see [12-diagrams-cetz.md](references/12-diagrams-cetz.md))1338. **Fix cross-references** → `<label>` + `@label` (see [11-cross-references.md](references/11-cross-references.md))