-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
39 lines (36 loc) · 860 Bytes
/
Copy pathbuild.sh
File metadata and controls
39 lines (36 loc) · 860 Bytes
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
#!/bin/sh
PRETEXT=/mnt/data/Dropbox/Script/TeX/pretext
BASENAME=`basename $1`
set -eu
xsltproc \
-o references.xml.ptx \
bibtexml2ptx.xsl \
references.bibtexml
xsltproc \
--xinclude \
-o $BASENAME.ptx \
$PRETEXT/xsl/pretext-preprocess.xsl \
$BASENAME
INPUTXML=$BASENAME.ptx
for format in html epub latex; do
echo "Output format: $format"
mkdir -p $format
cp -a image $format/
cd $format
xsltproc \
--xinclude \
--stringparam numbering.theorems.level '1' \
--stringparam latex.geometry 'a4paper,total={195mm,270mm},centering' \
--stringparam html.css.extra 'image/style.css' \
--stringparam tmpdir $PWD \
--stringparam debug.datedfiles 'no' \
-o $BASENAME.$format \
$PRETEXT/xsl/pretext-$format.xsl \
../$INPUTXML
if [ $format = latex ] ; then
lualatex $BASENAME.$format
fi
# if [ $format = epub ] ; then
# fi
cd ..
done