-
Notifications
You must be signed in to change notification settings - Fork 10
/
Makefile
37 lines (25 loc) · 1.04 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
# --------------------------------------------------------------------------
# PANDOC Makefile
# "make all" - Creates pdf and tex
# "make pdf" - Creates pdf (Replace pdf tex to get that output)
# Jithin Jith - 2016-06-28
# --------------------------------------------------------------------------
SOURCE := paper1.md
BUILD_DIR := .
OUTPUT_PDF := $(BUILD_DIR)/$(SOURCE:.md=.pdf)
OUTPUT_TEX := $(BUILD_DIR)/$(SOURCE:.md=.tex)
PANDOC := pandoc
PANDOC_OPTIONS := --standalone --filter pandoc-citeproc
PANDOC_OPTIONS_PDF := --latex-engine=xelatex --default-image-extension=pdf --template=elsevier.latex
PANDOC_OPTIONS_TEX := --natbib --default-image-extension=eps --template=elsevier.latex --wrap=preserve
all: $(OUTPUT_PDF) $(OUTPUT_HTML) $(OUTPUT_TEX)
pdf: $(BUILD_DIR) $(OUTPUT_PDF)
tex: $(BUILD_DIR) $(OUTPUT_TEX)
$(OUTPUT_PDF) : $(SOURCE)
$(PANDOC) $(PANDOC_OPTIONS) $(PANDOC_OPTIONS_PDF) -o $@ $<
$(OUTPUT_TEX) : $(SOURCE)
$(PANDOC) $(PANDOC_OPTIONS) $(PANDOC_OPTIONS_TEX) -o $@ $<
$(BUILD_DIR):
mkdir -p $@
clean:
rm -f $(OUTPUT_PDF) $(OUTPUT_TEX)