2015-03-04 03:46:19 +01:00
|
|
|
from __future__ import print_function
|
|
|
|
import io
|
|
|
|
|
|
|
|
import IPython.nbconvert.exporters.pdf as pdf
|
|
|
|
import fileinput
|
|
|
|
|
2015-04-04 19:30:50 +02:00
|
|
|
for line in fileinput.input('book.tex', openhook=fileinput.hook_encoded("iso-8859-1")):
|
|
|
|
# print(line.replace('\chapter{Preface}', '\chapter*{Preface}'), end='')
|
|
|
|
line.replace('\chapter{Preface}', '\chapter*{Preface}')
|
2015-03-04 03:46:19 +01:00
|
|
|
|
|
|
|
|
|
|
|
p = pdf.PDFExporter()
|
2015-04-04 19:30:50 +02:00
|
|
|
p.run_latex('book.tex')
|
2015-03-04 03:46:19 +01:00
|
|
|
|