Add justfile

This commit is contained in:
2026-06-29 20:19:53 +02:00
parent 0c14a1af00
commit 1f4249b7e9
+18
View File
@@ -0,0 +1,18 @@
LATEXMK := "latexmk -pdflatex=lualatex -pdf -shell-escape -interaction=nonstopmode"
build:
#!/usr/bin/env bash
FILE=$(find . -type f \( -path './chapters/*' -name '*.tex' ! -name 'template.tex' \) -o -name 'thesis.tex' | sed 's|^\./||' | sort | fzf)
DIR=$(dirname "$FILE")
BASE=$(basename "$FILE" .tex)
kitty -e sh -c "cd '$DIR' && {{ LATEXMK }} -outdir=build -pvc -view=none '$BASE.tex'" > /dev/null 2>&1 &
while [ ! -f "$DIR/build/$BASE.pdf" ]; do sleep 0.5; done
if command -v inotifywait > /dev/null; then
inotifywait -qq -e close_write "$DIR/build/$BASE.pdf"
else
sleep 2
fi
zathura "$DIR/build/$BASE.pdf" > /dev/null 2>&1 &
clean:
find . -type d \( -name build -o -name svg-inkscape \) -exec rm -rf {} +