Add MPI Typst template

This commit is contained in:
iacore
2026-06-28 12:18:05 +08:00
parent ff2eb8539c
commit 6907657090
5 changed files with 190 additions and 72 deletions
+20
View File
@@ -0,0 +1,20 @@
#!/usr/bin/env fish
# Compile a Typst file to PDF.
# Usage: compile-typst <path-to-file.typ> [output.pdf]
# Output defaults to /tmp/<basename>.pdf
# The Typst project root is set to the parent of the file's directory
# (so imports like ../lib/... resolve correctly).
set src (realpath $argv[1])
set src_dir (dirname $src)
set root (dirname $src_dir)
if set -q argv[2]
set out "$argv[2]"
else
set base (basename $src .typ)
set out "/tmp/$base.pdf"
end
typst compile --root $root $src $out
echo $out