Skip to content

Instantly share code, notes, and snippets.

@adigitoleo
Created April 28, 2022 12:10
Show Gist options
  • Save adigitoleo/ec37afca7cb27e2455e217dffde2b39e to your computer and use it in GitHub Desktop.
Save adigitoleo/ec37afca7cb27e2455e217dffde2b39e to your computer and use it in GitHub Desktop.
Makefile for LuaLaTeX documents with Biber for references
src := $(wildcard *.tex)
bib := $(wildcard *.bib)
all: $(src:%.tex=%.pdf)
%.pdf: $(src) out/%.bbl
@ 1>/dev/null lualatex --output-directory=out --interaction=batchmode --halt-on-error --file-line-error $< \
|| echo "LuaLaTeX run 2/3 failed, check log files in out/ for details"
@ lualatex --output-directory=out --halt-on-error --file-line-error $<|rg -v '/usr/share/'
@ mv out/$@ $@
out/%.bbl: out/%.bcf
@ biber --input-directory=out --output-directory=out $(<F)
out/%.bcf: $(src) $(bib) | out
@ 1>/dev/null lualatex --output-directory=out --interaction=batchmode --halt-on-error --file-line-error $< \
|| echo "LuaLaTeX run 1/3 failed, check log files in out/ for details"
out:
@ mkdir -p out
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment