pdf make updates, started py replace

This commit is contained in:
NT
2021-04-26 14:12:34 +08:00
parent d9f6c73a68
commit a477fea4e5
3 changed files with 47 additions and 3 deletions

10
make-pdf.sh Normal file → Executable file
View File

@@ -1,21 +1,26 @@
# source this file with "." in a shell
echo
echo Note: first comment out PG chapter in _toc
echo Note: manually quit first latex pass with shift-x
echo
cd /Users/thuerey/Dropbox/mbaDevelSelected/pbdl-book/
#cd /Users/thuerey/Dropbox/mbaDevelSelected/pbdl-book/
/Users/thuerey/Library/Python/3.7/bin/jupyter-book build . --builder pdflatex
# fix up latex
cd /Users/thuerey/Dropbox/mbaDevelSelected/pbdl-book/_build/latex
#cd /Users/thuerey/Dropbox/mbaDevelSelected/pbdl-book/
cd _build/latex
export JPYFILENAME=book.tex
rm ${JPYFILENAME}-in.bak
mv ${JPYFILENAME} ${JPYFILENAME}-in.bak
iconv -c -f utf-8 -t ascii ${JPYFILENAME}-in.bak > ${JPYFILENAME}
echo running SED
# ugly fix for double {{name}.jpg} includes, eg
# \sphinxincludegraphics{{physics-based-deep-learning-overview}.jpg}
# \sphinxincludegraphics[height=240\sphinxpxdimen]{{overview-pano}.jpg}
sed -i '' -e 's/sphinxincludegraphics{{/sphinxincludegraphics{/g' ${JPYFILENAME}
sed -i '' -e 's/}.png}/.png}/g' ${JPYFILENAME}
sed -i '' -e 's/}.jpg}/.jpg}/g' ${JPYFILENAME}
@@ -23,6 +28,7 @@ sed -i '' -e 's/}.jpeg}/.jpeg}/g' ${JPYFILENAME}
sed -i '' -e 's/sphinxpxdimen]{{/sphinxpxdimen]{/g' ${JPYFILENAME}
# dirty fix for chapters
# note, keep chapters? (chaXter) only move all other sections one level "up"?
# sed -i '' -e 's///g' ${JPYFILENAME}
sed -i '' -e 's/\\chapter{/\\chaXter{/g' ${JPYFILENAME}
sed -i '' -e 's/\\section{/\\chapter{/g' ${JPYFILENAME}