Quick Start¶
This guide will help you get started with typsphinx in just a few minutes.
Basic Setup¶
Install typsphinx (if you haven’t already):
pip install typsphinx
Add to your Sphinx project
Add
typsphinxto theextensionslist in yourconf.py:extensions = [ "typsphinx", ]
Note
Thanks to entry points, adding to
extensionsis optional. The builders are automatically discovered.Build Typst output:
# Generate Typst markup sphinx-build -b typst source/ build/typst # Or generate PDF directly sphinx-build -b typstpdf source/ build/pdf
Your First PDF¶
Here’s a minimal example to generate your first PDF:
Create a simple
index.rst:Welcome to My Documentation =========================== This is a sample document. Features -------- - Easy to use - Beautiful PDFs - Fast compilation
Build the PDF:
sphinx-build -b typstpdf source/ build/pdf
Find your PDF in
build/pdf/index.pdf!
Configuration Options¶
You can customize the output by adding options to conf.py:
# Project information
project = "My Project"
author = "Your Name"
release = "1.0.0"
# Typst configuration
typst_documents = [
("index", "myproject", project, author, "typst"),
]
# Use mitex for LaTeX math
typst_use_mitex = True
# Custom template (optional)
typst_template = "_templates/custom.typ"
What’s Next?¶
Learn about Configuration options
Explore Builders (typst vs typstpdf)
Customize with Templates
See Examples for more examples