TeXst is a Typst package for LaTeX-like academic paper formatting.
#import "@preview/texst:0.1.1": paperor use all the helpers:
#import "@preview/texst:0.1.1": paper, nneq, caption-note, table-note, theorem, proof, prop, lem, rem, asp, cmain, csub, caption-with-noteCopy this into your main.typ:
#import "@preview/texst:0.1.1": paper, nneq, caption-note, table-note, theorem, proof, prop, lem, rem, asp, cmain, csub, caption-with-note
#show: doc => paper(
title: [Paper Title],
subtitle: [Optional Subtitle],
authors: (
(name: [Author One]),
(name: [Author Two]),
),
date: datetime.today().display("[month repr:long] [day], [year]"),
abstract: [Write a concise abstract here.],
doc,
)
#outline(title: [Contents])
#heading(level: 1)[Introduction]
Start writing your paper.
#heading(level: 1)[Appendix]
#heading(level: 2)[Additional Material]
Add supplementary details here.typst init @preview/texst:0.1.1This generates a starter project from template/main.typ.
Example prompt for an LLM agent:
Migrate this Typst file to use the texst package.
Requirements:
- Use: #import "@preview/texst:0.1.1": paper
- Wrap document with:
#show: doc => paper(
title: [...],
subtitle: [...],
authors: (...),
date: ...,
abstract: [...],
doc,
)
- Preserve all existing section content and citations.
- Remove or refactor conflicting layout/title macros.
- Return a complete updated .typ file.
paper(...) applies:
- page layout and numbering
- typography defaults
- heading style and spacing
- table/figure alignment and numbering
- equation and reference behavior
- title block and abstract formatting
Your document content is passed through doc.
paper(title:, subtitle:, authors:, date:, abstract:, style:, doc)nneq(eq)(unnumbered display equation)caption_note(body)caption_with_note(title, note)table_note(body)cmain(body, color:),csub(body, color:)theorem,proof,prop,lem,rem,asp
Pass a style dictionary to override defaults:
#show: doc => paper(
title: [Styled Paper],
style: (
body_font: "Libertinus Serif",
font_size: 11pt,
line_spacing: 1.05em,
page_margin: (x: 1in, y: 1in),
heading_numbering: "1.",
cmain_color: rgb(20, 40, 120),
csub_color: rgb(70, 90, 130),
accent_link: rgb(20, 40, 120),
accent_ref: rgb(20, 40, 120),
accent_cite: rgb(20, 40, 120),
accent_footnote: rgb(20, 40, 120),
),
doc,
)Common keys include:
page_margin,page_numberingbody_font,body_size,font_size,body_colorparagraph_leading,line_spacing,paragraph_indentheading_numbering,heading_size,heading_weight,heading_colortitle_size,subtitle_size,title_leading,abstract_size,abstract_leadingcmain_color,csub_coloraccent_main(legacy global accent fallback)accent_link,accent_ref,accent_cite,accent_footnote
examples/minimal.typis the local smoke test.template/main.typis the package template entrypoint.- Compile locally:
typst compile --root . examples/minimal.typ /tmp/minimal.pdf