Fix bib file lookup for subfiles

This commit is contained in:
2026-07-01 15:36:51 +02:00
parent e8891233d8
commit 5d1c2d1eef
+2 -1
View File
@@ -2,10 +2,11 @@ LATEXMK := "latexmk -pdflatex=lualatex -pdf -shell-escape -interaction=nonstopmo
build: build:
#!/usr/bin/env bash #!/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) FILE=$(find . -type f \( -path './chapters/*' -name '*.tex' ! -name 'template.tex' \) -o -name 'thesis.tex' | sed 's|^\./||' | sort | fzf)
DIR=$(dirname "$FILE") DIR=$(dirname "$FILE")
BASE=$(basename "$FILE" .tex) 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 while [ ! -f "$DIR/build/$BASE.pdf" ]; do sleep 0.5; done
if command -v inotifywait > /dev/null; then if command -v inotifywait > /dev/null; then
inotifywait -qq -e close_write "$DIR/build/$BASE.pdf" inotifywait -qq -e close_write "$DIR/build/$BASE.pdf"