Skip to content

Commit cd1ac5d

Browse files
authored
Cheatsheets for CM1020 Discrete Mathemathics (#22)
* init dm personal dir * add set theory file * add set builder notation * add section on powersets * add section on set operations * generate PDF for set theory * add chapter on universal set, compelement and laws * add laws and identities of sets * add section on partition set * generate pdf for universal set, complement and laws doc * fix typo * rename src file * fix typo, generate PDFs * update README, reference PDFs * add functions doc * add function info pic to functions doc * expand injective, surjective and bijective functions * add section on composition * section on inverses * add section on injective/bijective/surjective proofs * add section on exponential and logarithmic functions * expand section on floor or ceiling, convert phi to emptyset * restruct floor and ceiling section * update PDFs * fix typo, update PDF * reference Propositional Logic in README * rename title * adjust sentence * track postulates of boolean algebra chapter * add basic theorems to boolean algebra * update README * add section on boolean functions * generate pdf for boolean algebra * start logic gates chapter * add circuits to logic gates * update README, generate pdf for logic gates * update pdf for boolean algebra * update logic gates pdf * add simplification of circuits to logic gates * adjust widh of pictures * fix typo * formatting * update boolean algebra pdf * change Proof ref * add graph chapter, track assets * expand walks, paths and other concepts * expand concepts * update transitive closure graph * update section levels * expand degree sequence of graphs section * track new assets * adjust width of pictures in graph chapter * expand graph chapter, create PDF * update README * create graph subdir for assets * start chapter on graph isomorphism * todo on dijkstra's algorithm * create PDF for graph isomorphism * update README * add chapter on trees * add section on spanning trees * add section on rooted trees * update README * add section on binary search trees * generate PDF for Trees * add chapter on Relations * update README * expand Matrix and Graph sections on Relations chapter * add second graph example * add section on properties * add section on transitivity * generate PDF for relations * add chapter on equivalence relations & classes * add section on partial and total order * expand Relation cheatsheet with more notes * update README, generate PDFs for Relations and Equivalences * update README * init Basics of Counting * add chapter on binomial coefficients * update README * generate PDF for binomial coefficients * update README, remove TODOs * regenerate all PDFs * fix typo in README
1 parent 9548df9 commit cd1ac5d

File tree

82 files changed

+2119
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+2119
-0
lines changed
Lines changed: 78 additions & 0 deletions
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
#!/bin/bash
2+
3+
# Because `make` sucks.
4+
5+
gen_html() {
6+
# Remove suffix and prefix
7+
FILE=$1
8+
OUT=${FILE%.adoc}
9+
HTML_OUT="cheatsheet_${OUT}.html"
10+
11+
asciidoctor $FILE -o ${HTML_OUT}
12+
}
13+
14+
# Change directory to src/ in order to have images included correctly.
15+
cd "$(dirname "$0")/src/"
16+
17+
case $1 in
18+
html)
19+
for FILE in *.adoc
20+
do
21+
# Generate HTML file.
22+
gen_html ${FILE}
23+
done
24+
25+
# Move up from src/
26+
mv *.html ../
27+
;;
28+
pdf)
29+
for FILE in *.adoc
30+
do
31+
# Generate HTML file.
32+
gen_html ${FILE}
33+
34+
# Convert HTML to PDF.
35+
PDF_OUT="cheatsheet_${OUT}.pdf"
36+
wkhtmltopdf \
37+
--enable-local-file-access \
38+
--javascript-delay 2000\
39+
$HTML_OUT $PDF_OUT
40+
done
41+
42+
# Move up from src/
43+
mv *.pdf ../
44+
45+
# Cleanup temporarily generated HTML files.
46+
rm *.html > /dev/null 2>&1
47+
;;
48+
png | img)
49+
for FILE in *.adoc
50+
do
51+
# Generate HTML file.
52+
gen_html ${FILE}
53+
54+
# Convert HTML to PNG.
55+
IMG_OUT="cheatsheet_${OUT}.png"
56+
wkhtmltopdf \
57+
--enable-local-file-access \
58+
--javascript-delay 2000\
59+
$HTML_OUT $IMG_OUT
60+
done
61+
62+
# Move up from src/
63+
mv *.png ../
64+
65+
# Cleanup temporarily generated HTML files.
66+
rm *.html > /dev/null 2>&1
67+
;;
68+
clean)
69+
rm *.html > /dev/null 2>&1
70+
rm *.png > /dev/null 2>&1
71+
rm ../*.html > /dev/null 2>&1
72+
rm ../*.png > /dev/null 2>&1
73+
;;
74+
*)
75+
echo "Unrecognized command"
76+
;;
77+
esac
796 KB
Binary file not shown.
580 KB
Binary file not shown.
2.09 MB
Binary file not shown.
3.76 MB
Binary file not shown.
1.17 MB
Binary file not shown.
1.33 MB
Binary file not shown.
1.13 MB
Binary file not shown.
2.14 MB
Binary file not shown.

0 commit comments

Comments
 (0)