This repository has been archived by the owner on Aug 26, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathMakefile
executable file
·133 lines (113 loc) · 3.08 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
# constants for defining the author, title, etc.
FILENAME = thesis
TITLE = Diplomaterv sablon Markdown leírónyelven
AUTHOR = Szárnyas Gábor
ADVISOR = Konzulens Elemér
UNIVERSITY = Budapesti Műszaki és Gazdaságtudományi Egyetem
DEPARTMENT = Méréstechnika és Információs Rendszerek Tanszék
RESEARCH_GROUP = Hibatűrő Rendszerek Kutatócsoport
THESIS_TYPE = Diplomaterv
DOCUMENT_LANG = magyar
BEFORE_FILE = guideline.md
SOURCE_FILES = abstract.md chapter1.md chapter2.md chapter3.md chapter4.md summary.md acknowledgements.md bibliography.md
APPENDIX_FILE = appendix.md
# variables for the PDF/HTML compiler
ARGS = \
$(SOURCE_FILES) \
--from=markdown \
--variable=lang:"$(DOCUMENT_LANG)" \
--variable=title:"$(TITLE)" \
--variable=author:"$(AUTHOR)" \
--variable=advisor:"$(ADVISOR)" \
--variable=university:"$(UNIVERSITY)" \
--variable=department:"$(DEPARTMENT)" \
--variable=research-group:"$(RESEARCH_GROUP)" \
--variable=thesis-type:"$(THESIS_TYPE)" \
--variable=lof \
--variable=lot \
--standalone \
--table-of-contents \
--bibliography=bibliography.bib \
LATEX_ARGS = \
$(ARGS) \
--include-before-body=$(BEFORE_FILE).tex \
--include-after-body=$(APPENDIX_FILE).tex \
--template=template.latex \
--variable=documentclass:report \
--variable=fontsize:11pt \
--variable=papersize:a4paper \
--variable=sides:oneside \
--variable=numbersections \
--natbib \
--variable=biblio-files:"bibliography" \
--variable=biblio-style:"plain" \
HTML_ARGS = \
--mathjax \
--filter pandoc-citeproc \
# rules
## rules for compiling the document
pdf: latex build-latex
latex: compile-guideline-tex compile-appendix-tex
pandoc \
$(LATEX_ARGS) \
--to=latex \
--output=$(FILENAME).tex \
html: compile-guideline-html compile-appendix-html
pandoc \
$(FILES) \
$(ARGS) \
$(HTML_ARGS) \
--include-before-body=$(BEFORE_FILE).html \
--include-after-body=$(APPENDIX_FILE).html \
--to=html \
--output=$(FILENAME).html \
--css=buttondown.css \
epub: compile-guideline-html compile-appendix-html
pandoc \
$(FILES) \
$(ARGS) \
--include-before-body=$(BEFORE_FILE).html \
--include-after-body=$(APPENDIX_FILE).html \
--output=$(FILENAME).epub \
--css=buttondown.css \
--epub-metadata=metadata.xml \
build-latex:
pdflatex $(FILENAME).tex
bibtex $(FILENAME).aux
pdflatex $(FILENAME).tex
pdflatex $(FILENAME).tex
## rules for compiling the guideline
compile-guideline-tex:
pandoc \
$(BEFORE_FILE) \
--from=markdown \
--to=latex \
--variable=documentclass:report \
--output=$(BEFORE_FILE).tex \
compile-guideline-html:
pandoc \
$(BEFORE_FILE) \
--from=markdown \
--to=html \
--output=$(BEFORE_FILE).html \
## rules for compiling the appendix
compile-appendix-tex:
pandoc \
$(APPENDIX_FILE) \
--from=markdown \
--to=latex \
--variable=documentclass:report \
--output=$(APPENDIX_FILE).tex \
compile-appendix-html:
pandoc \
$(APPENDIX_FILE) \
$(HTML_ARGS) \
--from=markdown \
--to=html \
--output=$(APPENDIX_FILE).html \
## misc rules
open:
gnome-open \
$(FILENAME).pdf \
clean:
rm -f *.tex *.aux *.dvi *.log *.pdf *.html *.mobi *.out *.epub