-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmake-paper.sh
executable file
·50 lines (43 loc) · 1.21 KB
/
make-paper.sh
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
usage="$(basename "$0") [-h] [-o outputFile] -- Builds Motif Paper"
while getopts ':hdos:' option; do
case "$option" in
h) echo "$usage"
exit
;;
d) debug=true ;;
o) shift
OUTPUT=$1
;;
esac
done
# input files
read -r -d '' INPUT << EOM
./sections/paper-titlepage.md
./sections/paper-abstract.md
./sections/paper-intro.md
./sections/paper-dip.md
./sections/paper-methodology.md
./sections/paper-evaluation.md
./sections/paper-conclusion.md
./sections/paper-references.md
EOM
# output file
[[ $OUTPUT ]] || OUTPUT="BenjaminDoranMotifPaper.docx"
# flags and style
read -r -d '' FLAGS << EOM
--standalone -f markdown -V geometry:margin=1in
--mathjax
--css=./template/custom.css
--reference-doc=./template/custom-reference
EOM
[[ $(echo $OUTPUT | grep -o '[^\.]\+$') == 'tex' ]] && FLAGS=$FLAGS.tex
[[ $(echo $OUTPUT | grep -o '[^\.]\+$') == 'docx' ]] && FLAGS=$FLAGS.docx
# Citation settings
read -r -d '' REFERENCE << EOM
--bibliography ./reference/Motif.bib
--filter pandoc-citeproc
--csl=./reference/ieee.csl
EOM
# make paper
[[ $debug ]] && echo "/usr/bin/pandoc $REFERENCE $INPUT $FLAGS -o $OUTPUT"
/usr/bin/pandoc $REFERENCE $INPUT $FLAGS -o $OUTPUT