Skip to content

Instantly share code, notes, and snippets.

@bagrow
Created March 12, 2011 16:41
Show Gist options
  • Save bagrow/867353 to your computer and use it in GitHub Desktop.
Save bagrow/867353 to your computer and use it in GitHub Desktop.
Compile and merge the latex cover letter, manuscript, and supporting info all at once
ENGINE = latexmk -pdf -silent -view=none
SOURCES = cover_letter paper paper_supp
MERGEFILE = paper_wCoverLetterSupp_$(shell date "+%Y%m%d").pdf
TEMPS = aux blg fdb_latexmk log out synctex.gz
MERGECMD=
ifneq ($(MERGEFILE),)
MERGECMD=gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=$(MERGEFILE) $(SOURCES:=.pdf)
endif
all:
$(ENGINE) $(SOURCES)
$(MERGECMD)
force:
@$(ENGINE) -gg $(SOURCES)
$(MERGECMD)
count:
@texcount -sub $(SOURCES:=.tex)
clean:
@for a in $(TEMPS); do \
rm -f $(SOURCES:=.$$a); \
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment