forked from kmyk/competitive-programming-library
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprintout.sh
executable file
·95 lines (81 loc) · 2.4 KB
/
printout.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#!/bin/bash
{
cat <<'EOF'
\documentclass[a4paper,10pt,onecolumn,notitlepage]{article}
\usepackage[top=10truemm,bottom=15truemm,left=10truemm,right=10truemm]{geometry}
\usepackage{setspace}
\usepackage{listings}
\title{my library for ICPC}
EOF
echo "\\author{$(git config user.name)}"
echo "\\date{\\today \\\\ repo: $(git config remote.origin.url) \\\\ commit: $(git rev-parse HEAD)}"
cat <<'EOF'
\lstset{
language=C++,
numbers=left,
breaklines=true,
basicstyle=\tiny\ttfamily,
}
\begin{document}
\maketitle
\begin{spacing}{0}
\tableofcontents
\end{spacing}
EOF
section() {
name=$(echo $@ | tr _ -)
echo "\\section{$name}"
}
list() {
name=$(echo $@ | tr _ -)
file="$@"
echo "\\subsection{$name}"
echo "\\lstinputlisting{$file}"
}
section misc
list environment.sh
list template.cpp
section data structure
list data-structure/binary-indexed-tree.inc.cpp
list data-structure/segment-tree.inc.cpp
list data-structure/dual-segment-tree.inc.cpp
list data-structure/lazy-propagation-segment-tree.inc.cpp
list data-structure/dynamic-segment-tree.inc.cpp
list data-structure/union-find-tree.inc.cpp
list data-structure/treap.inc.cpp
list data-structure/sparse_table.inc.cpp
list data-structure/sliding-window.inc.cpp
list data-structure/convex-hull-trick.inc.cpp
section graph
list graph/ford-fulkerson.inc.cpp
list graph/dinic.inc.cpp
list graph/minimum-cost-flow.inc.cpp
list graph/lowest-common-ancestor.inc.cpp
list graph/strongly_connected_components.cpp
list graph/two-edge-connected-components.inc.cpp
list graph/centroid-decomposition.inc.cpp
list graph/topological-sort.inc.cpp
section modulus
list modulus/factorial.inc.cpp
list modulus/choose.inc.cpp
section number
list number/gcd.inc.cpp
list number/primes.inc.cpp
list number/matrix.inc.cpp
list number/extgcd.inc.cpp
section string
list string/palindrome.inc.cpp
list string/suffix-array.inc.cpp
list string/aho-corasick.inc.cpp
section geometry
list geometry/convex-hull.inc.cpp
section utils
list utils/binsearch.inc.cpp
list utils/longest-increasing-subsequence.inc.cpp
list utils/dice.inc.cpp
list utils/subset.inc.cpp
cat <<'EOF'
\end{document}
EOF
} > library.tex
pdflatex library.tex && pdflatex library.tex