From e57f2469043523e179c498359507c0a3b4c8d3d0 Mon Sep 17 00:00:00 2001 From: Christoph Urlacher Date: Wed, 1 Jul 2026 18:19:07 +0200 Subject: [PATCH] Simplify justfile by adding .latexmkrc --- .latexmkrc | 5 +++++ Justfile | 11 ++--------- 2 files changed, 7 insertions(+), 9 deletions(-) create mode 100644 .latexmkrc diff --git a/.latexmkrc b/.latexmkrc new file mode 100644 index 0000000..189ddf4 --- /dev/null +++ b/.latexmkrc @@ -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"; diff --git a/Justfile b/Justfile index d7468a0..fb1a26a 100644 --- a/Justfile +++ b/Justfile @@ -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 {} +