Permalink
Browse files

Divide book into parts

Also do not print table of contents as this takes too many pages. If you
use the pdf for the entire project, then hopefully you use a good pdf
reader which gives you the table of contents in the left pane.
  • Loading branch information...
aisejohan committed Jan 5, 2018
1 parent a89a45a commit f7f7d8aefc91076ec01f4b0ab5fe512462bdd14e
Showing with 21 additions and 1 deletion.
  1. +17 −0 scripts/functions.py
  2. +4 −1 scripts/make_book.py
View
@@ -151,6 +151,23 @@ def write_new_tags(path, new_tags):
tag_file.close()
return
def get_parts(path):
lijst = list_text_files(path)
lijst.append('index')
lijst.append('xxx')
parts = {}
chapters = open(path + "chapters.tex", 'r')
n = 0
name = lijst[n]
for line in chapters:
if line.find(name + '-section-phantom') >= 0:
n = n + 1
name = lijst[n]
if line.find('\\') < 0:
parts[name] = line.rstrip()
chapters.close()
return(parts)
########################################################################
#
#
View
@@ -98,13 +98,16 @@ def print_license_blurp(path):
print_list_contrib(path)
print "\\end{titlepage}"
print_license_blurp(path)
print "\\tableofcontents"
lijstje = list_text_files(path)
lijstje.append("index")
parts = get_parts(path)
ext = ".tex"
for name in lijstje:
if name in parts:
print "\\part{" + parts[name] + "}"
if name == "index":
filename = path + "tmp/index.tex"
else:

0 comments on commit f7f7d8a

Please sign in to comment.