Skip to content

Instantly share code, notes, and snippets.

@manoelcampos
Last active April 21, 2017 20:51
Show Gist options
  • Save manoelcampos/30425a7397813cf2cd003420c07930f9 to your computer and use it in GitHub Desktop.
Save manoelcampos/30425a7397813cf2cd003420c07930f9 to your computer and use it in GitHub Desktop.
A Makefile to compile tex documents (using pdf latex) which filters the overwhelming amount of logs and just shows error messages instead. Change the name of the tex file to compile at the first line of the script.
FILE=NAME-OF-THE-TEX-FILE-WITHOUT-EXTENSION-HERE
TEMP_FILE_EXTENSIONS=log aux lol lof loc soc lot bit idx glo bbl brf nlo nls ilg toc ind out blg synctex.gz snm nav dvi tdo spl
all: clean build
build:
make pdf
make bib
make pdf
make pdf
pdf:
pdflatex -file-line-error -synctex=1 -interaction=nonstopmode "$(FILE).tex" | grep -e ".*:[0-9]*:.*" || true
bib:
bibtex "$(FILE).aux"
clean:
$(foreach ext,$(TEMP_FILE_EXTENSIONS),rm -rf *.$(ext);)
wordcount:
texcount -sum -total *.tex
#aliases for the "wordcount" target
wordscount: wordcount
wc: wordcount
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment