TL;DR: A new Documenter.jl backend that generates professional PDFs 10x faster than LaTeX, with zero setup required.
Two years ago, I shared an early experiment with using Typst as a backend for Documenter.jl. Today, I’m excited to announce that DocumenterTypst.jl v0.1 is ready for production use!
Speed Comparison
Building the complete Julia documentation (2000+ pages, see here):
- Typst backend (2 years ago): ~13 minutes (on Intel i9-9900K)
- DocumenterTypst.jl today: < 60 seconds (on Apple M4 Max)
┌ Info: TypstWriter: AST conversion completed.
└ time = "0.97s"
[ Info: TypstWriter: compiling Typst to PDF (Typst_jll)...
┌ Info: TypstWriter: Typst compilation completed.
└ time = "47.06s"
┌ Info: TypstWriter: optimizing PDF with pdfcpu...
└ size_before = "61.28 MB"
┌ Info: TypstWriter: PDF optimization completed.
│ size_after = "21.12 MB"
│ reduction = "65.5%"
└ time = "5.82s"
Want to try it yourself? Check out our step-by-step guide for building the Julia documentation with the Typst backend. It’s as simple as:
julia scripts/build_julia_docs.jl
What’s New Since the Prototype
The package is now feature-complete and ready for production:
Full Markdown support: All Documenter features work out of the box
- Code blocks with syntax highlighting (Julia fully supported!)
- Tables, images, cross-references
- Admonitions, footnotes, block quotes
- Nested lists and complex layouts
- NEW: Pure Typst files (
.typ) can be mixed with Markdown sources
Math rendering: Two options for maximum compatibility
- LaTeX math via mitex (backward compatible)
- Native Typst math syntax (for new projects)
Zero setup required: Uses Typst_jll for automatic installation
- No LaTeX distribution needed
- Works on Windows, macOS, and Linux
- Perfect for CI/CD pipelines
Optimized output: Automatic PDF compression
- NEW: Built-in PDF optimization using pdfcpu (65%+ size reduction for large docs)
- System font control to avoid emoji font bloat
- Detailed timing for performance monitoring
Customizable styling: Easy template system
- Override colors, fonts, and layouts
- Create custom title pages
- See styling guide
Installation & Usage
Note: DocumenterTypst.jl is not yet registered in the General Julia Registry. Install from source:
using Pkg
Pkg.add(url="https://github.com/lucifer1004/DocumenterTypst.jl")
using Documenter
using DocumenterTypst
makedocs(
sitename = "MyPackage",
authors = "Your Name",
format = DocumenterTypst.Typst(), # That's it!
pages = [
"Home" => "index.md",
"Guide" => "guide.md",
]
)
Why Typst?
Compared to LaTeX:
- Faster: Compilation in seconds, not minutes
- Simpler: No TeX distribution installation
- Modern: Clean syntax, better error messages
- Reliable: Reproducible builds with Typst_jll
Resources
- Documentation: https://lucifer1004.github.io/DocumenterTypst.jl/
- Repository: GitHub - lucifer1004/DocumenterTypst.jl
- Build Julia Docs Yourself: Step-by-step guide
- Example Output: Julia Documentation PDF (2000+ pages, built in < 60s)
Acknowledgments
Built on top of Documenter.jl and powered by Typst. LaTeX math rendering via mitex.
Special thanks to the Documenter.jl team for their excellent plugin architecture, and the Typst team for creating such a fast and reliable typesetting system.
Future Plans
- Julia General Registry registration (coming soon!)
- Template gallery with pre-made styles
- Additional Typst-native features
- Performance optimizations for very large documents
- Your suggestions!
Try it out and let me know what you think! Bug reports, feature requests, and contributions are all welcome at GitHub - lucifer1004/DocumenterTypst.jl