forked from anharmonic/anharmonic.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun.sh
executable file
·39 lines (32 loc) · 850 Bytes
/
run.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
#!/bin/bash
PANDOC=pandoc
if test $# -gt 0; then
INPUT=$1
shift
else
echo "Missing filename"
exit 1
fi
if test $# -gt 0; then
FORMAT=$1
else
FORMAT=pdf
fi
OUTPUT=${INPUT/md/$FORMAT}
echo $INPUT '->' $OUTPUT
#sed -e '1 i# Thermal2 user manual ' -e '/[[_TOC_]]/d' -e 's/\$$`/$$/g' -e 's/`\$$/$$/g' -e 's/\.svg/.png/g' $INPUT |\
sed -e '/[[_TOC_]]/d' -e 's/\$$`/$$/g' -e 's/`\$$/$$/g' -e 's/\.svg/.png/g' $INPUT |\
$PANDOC -N \
--toc \
--metadata title='Thermal2 user manual' \
--metadata customtitlepage='tp' \
--metadata graphics \
--metadata geometry='top=3cm' \
--metadata geometry='left=3cm' \
--metadata geometry='right=3cm' \
--metadata geometry='bottom=3cm' \
--metadata hyperrefoptions='linktoc=all' \
--metadata csquotes=yes \
--pdf-engine=xelatex -o $@ \
--template template.tex \
-o $OUTPUT