-
Notifications
You must be signed in to change notification settings - Fork 21
/
make_pres.sh
executable file
·25 lines (20 loc) · 1004 Bytes
/
make_pres.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
#!/bin/bash
PRESNAME="hdf5-is-for-lovers"
# save existing matplotlibrc
if [ -f ${HOME}/.matplotlib/matplotlibrc -a ! -f ${HOME}/.matplotlib/matplotlibrc.presbak ]; then
mv ${HOME}/.matplotlib/matplotlibrc ${HOME}/.matplotlib/matplotlibrc.presbak
fi
# make slides with swapped matplotlibrc and filters
cp tools/matplotlibrc ${HOME}/.matplotlib/matplotlibrc
cp ${PRESNAME}.rst ${PRESNAME}.tmp.rst
python tools/pagenum_filter.py ${PRESNAME}.tmp.rst -o ${PRESNAME}.tmp.rst
python tools/slidebreak_filter.py ${PRESNAME}.tmp.rst -o ${PRESNAME}.tmp.rst
rst2pdf ${PRESNAME}.tmp.rst -b1 -s tools/slides.style,tango -o ${PRESNAME}.pdf --fit-background-mode=center
rm ${PRESNAME}.tmp.rst
rm ${HOME}/.matplotlib/matplotlibrc
# replace blue links with another color
sed -i 's/0 0 .501961 [Rr][Gg]/.8671875 .188235 .188235 rg/' ${PRESNAME}.pdf
# replace matplotlibrc
if [ -f ${HOME}/.matplotlib/matplotlibrc.presbak ]; then
mv ${HOME}/.matplotlib/matplotlibrc.presbak ${HOME}/.matplotlib/matplotlibrc
fi