Simplify justfile by adding .latexmkrc

This commit is contained in:
2026-07-01 18:19:07 +02:00
parent 3fa872d922
commit e57f246904
2 changed files with 7 additions and 9 deletions
+5
View File
@@ -0,0 +1,5 @@
$pdf_mode = 1;
$pdflatex = "lualatex -shell-escape -interaction=nonstopmode %O %S";
$out_dir = "build";
$bibtex = "biber %O %S";
$pdf_previewer = "zathura %O %S";
+2 -9
View File
@@ -1,4 +1,4 @@
LATEXMK := "latexmk -pdflatex=lualatex -pdf -shell-escape -interaction=nonstopmode"
LATEXMK := "latexmk -pvc"
build:
#!/usr/bin/env bash
@@ -6,14 +6,7 @@ build:
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' && BIBINPUTS='$ROOT:' {{ 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 &
kitty -e sh -c "cd '$DIR' && BIBINPUTS='$ROOT:' {{ LATEXMK }} '$BASE.tex'" > /dev/null 2>&1 &
clean:
find . -type d \( -name build -o -name svg-inkscape \) -exec rm -rf {} +