forked from eric-pedersen/mixed-effect-gams
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
40 lines (31 loc) · 2.43 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
all: main example_data md fig tex compare makezip
main: example_data md fig tex
compare: main
makezip: main
run_comparison = false
example_data: data/bird_move.csv data/zooplankton_example.csv
R --vanilla --slave -e "source('code/bird_example_data.R')"
R --vanilla --slave -e "source('code/cleaning_zooplankton_data.R')"
md: paper_sections/01-intro.Rmd paper_sections/02-gams.Rmd paper_sections/03-hierarchical_gams.Rmd paper_sections/04-examples.Rmd paper_sections/05-computational_and_statistical_issues.Rmd
fig: figures/Fig1.pdf code/alternate_models.R
R --vanilla --slave -e "source('code/alternate_models.R')"
tex: paper_sections/bibliography.bib paper_sections/peerj.csl paper_sections/preamble.sty
main: paper_sections/full_document.Rmd
R --vanilla --slave -e "library(knitr); purl('paper_sections/full_document.Rmd',documentation =0, output = 'compiled_paper/supplemental_code.R')"
R --vanilla --slave -e "library(rmarkdown); render('paper_sections/full_document.Rmd',output_file = 'full_document.tex',knit_root_dir='../')"
sed -i.bak '/xcolor/d' paper_sections/full_document.tex
R --vanilla --slave -e "setwd('paper_sections'); library(tools); texi2pdf('full_document.tex',clean = TRUE)"
mv paper_sections/full_document.pdf compiled_paper/full_document.pdf
mv paper_sections/full_document.tex compiled_paper/full_document.tex
makezip: compiled_paper/supplemental_code.R code/bird_example_data.R data/bird_move.csv data/zooplankton_example.csv data/bird_move_global.csv mixed-effect-gams.Rproj
zip compiled_paper/supplemental_info.zip data/bird_move.csv data/zooplankton_example.csv data/bird_move_global.csv code/bird_example_data.R mixed-effect-gams.Rproj
cp compiled_paper/supplemental_code.R code/supplemental_code.R
zip -ur compiled_paper/supplemental_info.zip code/supplemental_code.R
rm -f code/supplemental_code.R
compare: compiled_paper/full_document.tex compiled_paper/prior_submission.tex
ifeq ($(run_comparison),true)
latexdiff --config="PICTUREENV=(?:picture|DIFnomarkup|table)[\w\d*@]*" compiled_paper/prior_submission.tex compiled_paper/full_document.tex > compiled_paper/diff.tex
-pdflatex -interaction=nonstopmode compiled_paper/diff.tex -output-directory compiled_paper
-pdflatex -interaction=nonstopmode compiled_paper/diff.tex -output-directory compiled_paper
rm compiled_paper/diff.log compiled_paper/diff.aux compiled_paper/diff.out
endif