This configuration makes a Typst project look like a LaTeX project.
Specifically, you call latexmk and typst will generate main.pdf.
Configuration
latexmkrc:
# See https://mirror.ctan.org/support/latexmk/example_rcfiles/tex4ht-latexmkrc
$dvi_mode = 1;
$pdf_mode = 0;
# Prevent lulatex from producing PDF, and allow to call typst
# To preserve PDF bookmarks and cross-links, we let typst produce main.pdf directly, instead of using LaTeX pdfpages \includepdf
$latex = 'lualatex --output-format=dvi --shell-escape';
main.tex:
\documentclass{article}
\usepackage{shellesc}
\begin{document}
\ShellEscape{typst compile main.typ main.pdf}
If you see this line in the PDF, you should recompile with latexmk. Refer to README.txt for details.
% That line also prevents _No pages of output_, so latexmk will treat the compilation as successful.
\end{document}
README.txt:
# How to compile
tlmgr install scheme-minimal collection-latex luatex latexmk
curl -fsSL https://install.typst.community/install.sh | sh -s 0.15.1
latexmk
Related projects
I guess in 99% cases, you would want one of the following projects instead of the above latexmk configuration…
-
Embed Typst in LaTeX.
-
A Typst plugin that adds LaTeX support, powered by Rust and WASM.
-
JavaScript library for conversion between TeX/LaTeX and Typst math code, with a web app and a cheat sheet.
You can also find more tex🡘typ projects in
Math | Best of Typst (TCDM).