-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathmake-pdf.sh
executable file
·49 lines (48 loc) · 2.96 KB
/
make-pdf.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# First, clone https://github.com/btj/jlearner and set JLEARNERPATH
set -x -e
cp $JLEARNERPATH/language.md $JLEARNERPATH/*.png .
pandoc -o course-notes.html -f gfm \
intro.md \
README.md \
programming.md \
language.md \
lecture2part1.md \
lecture2part2.md \
complexity_modularity_abstraction.md \
representation_objects.md \
single_object_doc_instr.md \
polymorphism.md \
dynamic_binding.md \
behavioral_subtyping.md \
interfaces.md \
implementation_inheritance.md \
closed_types.md \
collections.md \
entity_relationship_abstractions.md \
multi_class_abstractions.md \
multi_object_doc_instr.md \
iterators.md \
generics.md
pandoc --wrap=none -V documentclass=book -V papersize:a4 --toc --template=latex.template --listings -o course-notes.tex course-notes.html
if [ `uname -s` = Darwin ]; then
SED_IN_PLACE=(-i '')
else
SED_IN_PLACE=(-i)
fi
sed "${SED_IN_PLACE[@]}" \
-e 's/\\chapter{Object-Oriented Programming}/\\chapter{Overview}/' \
-e 's/\\chapter{First Steps in Modular Programming (Part I)}/\\part{Part I: Single-Object Abstractions}\\chapter{First Steps in Modular Programming (Part I)}/' \
-e 's/\\chapter{Managing Complexity through Modularity and Abstraction}/\\chapter[Managing Complexity: Modularity \\\& Abstraction]{Managing Complexity through Modularity and Abstraction}/' \
-e 's/\\section{FractionLists: Representation Exposure Breaks Consistency}/\\section[Representation Exposure Breaks Consistency]{FractionLists: Representation Exposure Breaks Consistency}/' \
-e 's/\\chapter{How to properly document single-object abstractions}/\\chapter[How to document single-object abstractions]{How to properly document single-object abstractions}/' \
-e 's/\\chapter{Polymorphism}/\\part{Part II: Inheritance}\\chapter{Polymorphism}/' \
-e 's/\\chapter{Entity-relationship abstractions}/\\part{Part III: Multi-Object Abstractions}\\chapter{Entity-relationship abstractions}/' \
-e 's/\\section{Advanced: Nesting class-encapsulated and package-encapsulated abstractions}/\\section[Nesting class-level and package-level abstractions]{Advanced: Nesting class-encapsulated and package-encapsulated abstractions}/' \
-e 's/\\chapter{How to properly document multi-object abstractions}/\\chapter[How to document multi-object abstractions]{How to properly document multi-object abstractions}/' \
-e 's/\\chapter{Behavioral subtyping: modular reasoning about programs that use dynamic binding}/\\chapter[Modular reasoning about dynamic binding]{Behavioral subtyping: modular reasoning about programs that use dynamic binding}/' \
-e 's/\\section{Modular reasoning about programs that use dynamic binding}/\\section[Modular reasoning about dynamic binding]{Modular reasoning about programs that use dynamic binding}/' \
-e 's/\\chapter{Iterators}/\\part{Part IV: Advanced Topics}\\chapter{Iterators}/' \
-e 's/language=Java/language=Java,morekeywords={enum,record,sealed,permits}/g' \
course-notes.tex
pdflatex course-notes.tex
pdflatex course-notes.tex