pdf make updates, started py replace
This commit is contained in:
37
fixup-latex.py
Normal file
37
fixup-latex.py
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
import sys, os, re
|
||||||
|
#import sys, os, psutil, subprocess, time, signal, re, json, logging, datetime, argparse
|
||||||
|
#import numpy as np
|
||||||
|
|
||||||
|
# fix jupyter book latex output
|
||||||
|
|
||||||
|
#filter_mem = re.compile(r".+\|\s+(\d+)MiB\s+/\s+(\d+)MiB\s+\|")#')
|
||||||
|
ft2 = re.compile(r"tst")
|
||||||
|
ft3 = re.compile(r"’")
|
||||||
|
fte = re.compile(r"👋")
|
||||||
|
|
||||||
|
# TODO , replace phi symbol w text in phiflow
|
||||||
|
|
||||||
|
path = "tmp2.txt" # simple
|
||||||
|
path = "tmp.txt" # utf8
|
||||||
|
#path = "book.tex-in.bak" # full utf8
|
||||||
|
outf = "tmpOut.txt"
|
||||||
|
|
||||||
|
with open(outf, 'w') as fout:
|
||||||
|
with open(path, 'r') as f:
|
||||||
|
c = 0
|
||||||
|
for line in iter(f.readline, ''):
|
||||||
|
line = re.sub('’', '\'', str(line))
|
||||||
|
line = re.sub('[abz]', '.', str(line))
|
||||||
|
|
||||||
|
t = ft3.search(str(line))
|
||||||
|
if t is not None:
|
||||||
|
print("H " + format(t) +" "+ format(t.group(0)) )
|
||||||
|
|
||||||
|
t = fte.search(str(line))
|
||||||
|
if t is not None:
|
||||||
|
print("E " + format(t) + format(t.group(0)) )
|
||||||
|
|
||||||
|
fout.write(line)
|
||||||
|
print(line[:-1])
|
||||||
|
c = c+1
|
||||||
|
|
||||||
3
intro.md
3
intro.md
@@ -59,8 +59,9 @@ This project would not have been possible without the help of many people who co
|
|||||||
|
|
||||||
- [Philipp Holl](https://ge.in.tum.de/about/)
|
- [Philipp Holl](https://ge.in.tum.de/about/)
|
||||||
- [Georg Kohl](https://ge.in.tum.de/about/georg-kohl/)
|
- [Georg Kohl](https://ge.in.tum.de/about/georg-kohl/)
|
||||||
- [Maximilian Mueller](https://ge.in.tum.de/about/)
|
- [Maximilian Mueller](https://ge.in.tum.de/)
|
||||||
- [Patrick Schnell](https://ge.in.tum.de/about/patrick-schnell/)
|
- [Patrick Schnell](https://ge.in.tum.de/about/patrick-schnell/)
|
||||||
|
- [Felix Trost](https://ge.in.tum.de/)
|
||||||
- [Nils Thuerey](https://ge.in.tum.de/about/n-thuerey/)
|
- [Nils Thuerey](https://ge.in.tum.de/about/n-thuerey/)
|
||||||
- [Kiwon Um](https://ge.in.tum.de/about/kiwon/)
|
- [Kiwon Um](https://ge.in.tum.de/about/kiwon/)
|
||||||
|
|
||||||
|
|||||||
10
make-pdf.sh
Normal file → Executable file
10
make-pdf.sh
Normal file → Executable file
@@ -1,21 +1,26 @@
|
|||||||
# source this file with "." in a shell
|
# source this file with "." in a shell
|
||||||
|
|
||||||
echo
|
echo
|
||||||
|
echo Note: first comment out PG chapter in _toc
|
||||||
echo Note: manually quit first latex pass with shift-x
|
echo Note: manually quit first latex pass with shift-x
|
||||||
echo
|
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
|
/Users/thuerey/Library/Python/3.7/bin/jupyter-book build . --builder pdflatex
|
||||||
|
|
||||||
# fix up latex
|
# 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
|
export JPYFILENAME=book.tex
|
||||||
rm ${JPYFILENAME}-in.bak
|
rm ${JPYFILENAME}-in.bak
|
||||||
mv ${JPYFILENAME} ${JPYFILENAME}-in.bak
|
mv ${JPYFILENAME} ${JPYFILENAME}-in.bak
|
||||||
iconv -c -f utf-8 -t ascii ${JPYFILENAME}-in.bak > ${JPYFILENAME}
|
iconv -c -f utf-8 -t ascii ${JPYFILENAME}-in.bak > ${JPYFILENAME}
|
||||||
|
|
||||||
echo running SED
|
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/sphinxincludegraphics{{/sphinxincludegraphics{/g' ${JPYFILENAME}
|
||||||
sed -i '' -e 's/}.png}/.png}/g' ${JPYFILENAME}
|
sed -i '' -e 's/}.png}/.png}/g' ${JPYFILENAME}
|
||||||
sed -i '' -e 's/}.jpg}/.jpg}/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}
|
sed -i '' -e 's/sphinxpxdimen]{{/sphinxpxdimen]{/g' ${JPYFILENAME}
|
||||||
|
|
||||||
# dirty fix for chapters
|
# 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///g' ${JPYFILENAME}
|
||||||
sed -i '' -e 's/\\chapter{/\\chaXter{/g' ${JPYFILENAME}
|
sed -i '' -e 's/\\chapter{/\\chaXter{/g' ${JPYFILENAME}
|
||||||
sed -i '' -e 's/\\section{/\\chapter{/g' ${JPYFILENAME}
|
sed -i '' -e 's/\\section{/\\chapter{/g' ${JPYFILENAME}
|
||||||
|
|||||||
Reference in New Issue
Block a user