-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
81 lines (70 loc) · 1.98 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# To use local instead of shared versions, replace the following and use the code in comments
DOCX_REFERENCE_DOC = --reference-doc ICIS2021.docx
# DOCX_REFERENCE_DOC = --reference-doc APA-7.docx
LATEX_REF_DOC = --template basic.tex
# LATEX_REF_DOC = --template basic.tex
CSL_FILE = --csl apa.csl
# CSL_FILE = --csl mis-quarterly.csl
BIBLIOGRAPHY_FILE = --bibliography references.bib
# The parameters should be in the same document (ideally in the YAML header of paper.md).
# We will keep them in the Makefile until template and reference-doc can be set in the YAML header.
# https://github.com/jgm/pandoc/issues/4627
.PHONY : run analyses pdf latex docx
help :
@echo "Usage: make [command]"
@echo " help"
@echo " Show this help description"
@echo " run"
@echo " Run analyses of the complete repository"
@echo " analyses"
@echo " Run all analyses"
@echo " pdf"
@echo " Generate paper pdf"
@echo " latex"
@echo " Generate paper tex"
@echo " docx"
@echo " Generate paper docx"
run : analyses pdf latex docx
build:
docker build -t pandoc_dockerfile .
analyses:
[ -f analysis/Makefile ] && $(MAKE) -C analysis run || true # Skip if no Makefile in analysis directory
PANDOC_CALL = docker run --rm \
--volume "`pwd`:/data" \
--user `id -u`:`id -g` \
pandoc_dockerfile
pdf:
$(PANDOC_CALL) \
paper.md \
--citeproc \
--filter pantable \
--filter pandoc-crossref \
$(BIBLIOGRAPHY_FILE) \
$(CSL_FILE) \
$(LATEX_REF_DOC) \
--pdf-engine xelatex \
--output paper.pdf
latex:
$(PANDOC_CALL) \
paper.md \
--filter pantable \
--filter pandoc-crossref \
--citeproc \
$(BIBLIOGRAPHY_FILE) \
$(CSL_FILE) \
$(LATEX_REF_DOC) \
--to latex \
--pdf-engine xelatex \
--output paper.tex
docx:
$(PANDOC_CALL) \
paper.md \
--filter pantable \
--filter pandoc-crossref \
--citeproc \
$(BIBLIOGRAPHY_FILE) \
$(CSL_FILE) \
$(DOCX_REFERENCE_DOC) \
--output paper.docx
docker:
docker build -t pandoc_dockerfile .