]> code.communitydata.science - cdsc_tex.git/blob - paper_template/Makefile
make .tex files .PRECIOUS
[cdsc_tex.git] / paper_template / Makefile
1 #!/usr/bin/make
2
3 all: $(patsubst %.tex,%.pdf,$(wildcard *.tex)) 
4
5 # use the following section for Rnw/knitr documents
6 # all: $(patsubst %.Rnw,%.pdf,$(wildcard *.Rnw))
7 # %.tex: %.Rnw
8 #       Rscript -e "library(knitr); knit('$<')"
9
10 refs-processed.bib: 
11         perl -p -e 's/©//' refs.bib > refs-processed.bib
12         perl -0pe 's/,\s+(file|abstract) = \{.*?\}(,\n|\n)/\2/sg' refs-processed.bib |sponge refs-processed.bib
13         recode -d u8..ltex < refs-processed.bib | sponge refs-processed.bib
14
15 %.pdf: %.tex refs-processed.bib vc
16         latexmk -f -pdf $<
17
18 clean: 
19         latexmk -C *.tex
20         rm -f *.tmp
21         rm -f vc
22         rm -f refs-processed.bib
23         # the following lines are useful for Rnw/knitr
24         # rm -rf cache/ figure/
25         # rm -f *.tex
26
27 viewpdf: all
28         evince *.pdf
29
30 vc:
31         resources/vc-git
32
33 pdf: all
34
35 .PHONY: clean all
36 # .PRECIOUS: %.tex

Community Data Science Collective || Want to submit a patch?