-
Notifications
You must be signed in to change notification settings - Fork 10
/
makefile
40 lines (28 loc) · 1.54 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
# Makefile for the scientific article in project-template
all: output/article_text.docx output/article_text.pdf output/table.pdf output/figures.pdf output/full_article.pdf
output/article_text.docx: article_text.md refs.bib
pandoc -H format.sty -V fontsize=12pt --bibliography refs.bib --csl=ecology.csl article_text.md -o output/article_text.docx
output/article_text.pdf: article_text.md refs.bib
# reset the starting page to 1
./rwstyle 1 > format.sty
pandoc -H format.sty -V fontsize=12pt --bibliography refs.bib --csl=ecology.csl article_text.md -o output/article_text.pdf
output/table.pdf: analysis/analysis.R analysis/iris.csv
# run analysis
R --slave --vanilla < analysis/analysis.R
# alter start page
./rwstyle $(shell ./nextpage output/article_text.pdf) > format.sty
# make the pdf
pandoc -H format.sty -V fontsize=12pt analysis/table.md -o output/table.pdf
# make temporary pdf that merges text with table
gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=temp.pdf output/article_text.pdf output/table.pdf
output/figures.pdf: analysis/analysis.R analysis/iris.csv
# alter start page
./rwstyle $(shell ./nextpage temp.pdf) > format.sty
rm temp.pdf
# make pdf of figures
pandoc -H format.sty -V fontsize=12pt analysis/figures.md -o output/figures.pdf
output/full_article.pdf: article_text.md refs.bib analysis/analysis.R
# merge pdfs
gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=output/full_article.pdf output/article_text.pdf output/table.pdf output/figures.pdf
# reset the starting page to 1
./rwstyle 1 > format.sty