Skip to content

Instantly share code, notes, and snippets.

@lawrencejones
Created June 3, 2016 15:33
Show Gist options
  • Save lawrencejones/34d7bfa546903d0219c91b3e455865e3 to your computer and use it in GitHub Desktop.
Save lawrencejones/34d7bfa546903d0219c91b3e455865e3 to your computer and use it in GitHub Desktop.
Example latex Makefile with bibtex support
.PHONY: clean
TEX_FILES:=$(shell find . -name "*.tex" -type f)
RESOURCE_FILES:=$(shell find ./res -type f)
report.pdf: $(TEX_FILES) $(RESOURCE_FILES) libtex/report.bbl
cd libtex && ( \
pdflatex -shell-escape report \
) && \
mv report.pdf ../
libtex/report.bbl: refs.bib
cd libtex && ( \
pdflatex -shell-escape report && \
bibtex report && \
pdflatex -shell-escape report \
)
clean:
rm -f report.pdf && git clean -f ./libtex
watch:
watch "make report.pdf" --wait 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment