6092e06459
There is more than that here. I had a bad commit of a bunch of temporary files, I had to reset back in time, and now I am doing a massive commit. Sorry.
22 lines
422 B
Python
22 lines
422 B
Python
import IPython.nbconvert.exporters.pdf as pdf
|
|
import sys
|
|
|
|
if len(sys.argv) == 2:
|
|
name = sys.argv[1]
|
|
else:
|
|
name = 'book.tex'
|
|
|
|
f = open(name, 'r', encoding="iso-8859-1")
|
|
filedata = f.read()
|
|
f.close()
|
|
|
|
newdata = filedata.replace('\chapter{Preface}', '\chapter*{Preface}')
|
|
|
|
f = open('book.tex', 'w', encoding="iso-8859-1")
|
|
f.write(newdata)
|
|
f.close()
|
|
|
|
p = pdf.PDFExporter()
|
|
p.run_latex(name)
|
|
|