diff --git a/Justfile b/Justfile index 3e34766..d7468a0 100644 --- a/Justfile +++ b/Justfile @@ -2,10 +2,11 @@ LATEXMK := "latexmk -pdflatex=lualatex -pdf -shell-escape -interaction=nonstopmo build: #!/usr/bin/env bash + ROOT="$PWD" 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 & + 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"