-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.tex
More file actions
264 lines (200 loc) · 8.62 KB
/
main.tex
File metadata and controls
264 lines (200 loc) · 8.62 KB
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% The Legrand Orange Book
% LaTeX Template
% Version 3.1 (February 18, 2022)
%
% This template originates from:
% https://www.LaTeXTemplates.com
%
% Authors:
% Vel (vel@latextemplates.com)
% Mathias Legrand (legrand.mathias@gmail.com)
%
% License:
% CC BY-NC-SA 4.0 (https://creativecommons.org/licenses/by-nc-sa/4.0/)
%
% Compiling this template:
% This template uses biber for its bibliography and makeindex for its index.
% When you first open the template, compile it from the command line with the
% commands below to make sure your LaTeX distribution is configured correctly:
%
% 1) pdflatex main
% 2) makeindex main.idx -s indexstyle.ist
% 3) biber main
% 4) pdflatex main x 2
%
% After this, when you wish to update the bibliography/index use the appropriate
% command above and make sure to compile with pdflatex several times
% afterwards to propagate your changes to the document.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%----------------------------------------------------------------------------------------
% PACKAGES AND OTHER DOCUMENT CONFIGURATIONS
%----------------------------------------------------------------------------------------
\documentclass[
11pt, % Default font size, select one of 10pt, 11pt or 12pt
fleqn, % Left align equations
a4paper, % Paper size, use either 'a4paper' for A4 size or 'letterpaper' for US letter size
%oneside, % Uncomment for oneside mode, this doesn't start new chapters and parts on odd pages (adding an empty page if required), this mode is more suitable if the book is to be read on a screen instead of printed
]{LegrandOrangeBook}
% Book information for PDF metadata, remove/comment this block if not required
\hypersetup{
pdftitle={Title}, % Title field
pdfauthor={Author}, % Author field
pdfsubject={Subject}, % Subject field
pdfkeywords={Keyword1, Keyword2, ...}, % Keywords
pdfcreator={LaTeX}, % Content creator field
}
\addbibresource{sample.bib} % Bibliography file
% \definecolor{ocre}{RGB}{26, 201, 128} % Define the color used for highlighting throughout the book
\definecolor{ocre}{RGB}{211, 42, 45} % Define the color used for highlighting throughout the book
%\chapterimage{orange1.jpg} % Chapter heading image
\chapterimage{}
\chapterspaceabove{6.5cm} % Default whitespace from the top of the page to the chapter title on chapter pages
\chapterspacebelow{6.75cm} % Default amount of vertical whitespace from the top margin to the start of the text on chapter pages
%----------------------------------------------------------------------------------------
\usepackage{listings}
\usepackage{xcolor}
\usepackage{tikz}
\usepackage{tkz-graph}
\usepackage{tkz-berge}
\definecolor{codegreen}{rgb}{0,0.6,0}
\definecolor{codegray}{rgb}{0.5,0.5,0.5}
\definecolor{codepurple}{rgb}{0.58,0,0.82}
\definecolor{backcolour}{rgb}{0.95,0.95,0.92}
\lstdefinestyle{incellstyle}{
backgroundcolor=\color{backcolour},
commentstyle=\color{codegreen},
keywordstyle=\color{magenta},
numberstyle=\tiny\color{codegray},
stringstyle=\color{codepurple},
basicstyle=\ttfamily\footnotesize,
breakatwhitespace=false,
breaklines=true,
captionpos=b,
keepspaces=true,
numbers=left,
numbersep=5pt,
showspaces=false,
showstringspaces=false,
showtabs=false,
tabsize=2,
numbers=none,
frame=lines,
framextopmargin=2pt,
framexbottommargin=2pt
}
\lstdefinestyle{outcellstyle}{
backgroundcolor=\color{white},
commentstyle=\color{codegreen},
keywordstyle=\color{magenta},
numberstyle=\tiny\color{codegray},
stringstyle=\color{codepurple},
basicstyle=\ttfamily\footnotesize,
breakatwhitespace=false,
breaklines=true,
captionpos=b,
keepspaces=true,
numbers=left,
numbersep=5pt,
showspaces=false,
showstringspaces=false,
showtabs=false,
tabsize=2,
numbers=none,
frame=lines,
framextopmargin=2pt,
framexbottommargin=2pt
}
\lstset{style=incellstyle}
\lstnewenvironment{sageCell}{%
\smallskip
\lstset{style=incellstyle,language=Python}
}
{}
\lstnewenvironment{outCell}{%
\smallskip
\lstset{style=outcellstyle,language=Python}
}
{}
% \newcommand{cmd}[args][default]{def}
\newenvironment{outImage}{
%
\begin{samepage}
\noindent\hrulefill
\begin{center}
}{
\end{center}
\noindent\hrulefill
\end{samepage}
%
}
\begin{document}
%----------------------------------------------------------------------------------------
% TITLE PAGE
%----------------------------------------------------------------------------------------
\titlepage % Output the title page
{\makebox[\paperwidth]{}}
% {\includegraphics[width=\paperwidth]{background_green.pdf}} % Code to output the background image, which should be the same dimensions as the paper to fill the page entirely; leave empty for no background image
{ % Title(s) and author(s)
\centering\sffamily % Font styling
{\Huge\bfseries Discrete Mathematics\par} % Book title
% {\Huge\bfseries Diskretna matematika 2\par} % Book title
\vspace{16pt} % Vertical whitespace
{\LARGE Exercises for Discrete Mathematics\\[1mm] University of Ljubljana, Faculty of Computer and Information Science \par}
\vspace{16pt}
{\Large Gradiva za vaje iz Diskretne matematike\\[1mm] Univerza v Ljubljani, Fakulteta za računalnišvo in informatiko \par
% english
} % Subtitle
\vspace{24pt} % Vertical whitespace
{\huge\bfseries Marko Boben\par} % Author name
}
%----------------------------------------------------------------------------------------
% COPYRIGHT PAGE
%----------------------------------------------------------------------------------------
\thispagestyle{empty} % Suppress headers and footers on this page
~\vfill % Push the text down to the bottom of the page
\noindent Copyright \copyright\ 2024 Marko Boben\\ % Copyright notice
% \noindent \textsc{Published by Publisher}\\ % Publisher
\noindent Available at: \url{https://github.com/mboben/DM2Book/blob/build/main.pdf}\\ % URL
\noindent Licensed under the Creative Commons Attribution-NonCommercial 4.0 License (the ``License''). You may not use this file except in compliance with the License. You may obtain a copy of the License at \url{https://creativecommons.org/licenses/by-nc-sa/4.0}. Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \textsc{``as is'' basis, without warranties or conditions of any kind}, either express or implied. See the License for the specific language governing permissions and limitations under the License.\\ % License information, replace this with your own license (if any)
\noindent \textit{February 2024} % Printing/edition date
%----------------------------------------------------------------------------------------
% TABLE OF CONTENTS
%----------------------------------------------------------------------------------------
\pagestyle{empty} % Disable headers and footers for the following pages
\tableofcontents % Output the table of contents
% \listoffigures % Output the list of figures, comment or remove this command if not required
% \listoftables % Output the list of tables, comment or remove this command if not required
\pagestyle{fancy} % Enable default headers and footers again
\cleardoublepage % Start the following content on a new page
\chapterimage{}
\chapterspaceabove{6.75cm} % Whitespace from the top of the page to the chapter title on chapter pages
\chapterspacebelow{7.25cm} % Amount of vertical whitespace from the top margin to the start of the
%------------------------------------------------
\input{chapter_intro}
\input{chapter_sage}
\input{chapter_dfs_bfs}
\input{chapter_low}
\input{chapter_tsp}
\input{chapter_drawing}
\input{chapter_discharging}
\input{chapter_5-coloring}
\input{chapter_list_coloring}
\input{chapter_balanced_separators}
\input{chapter_chordal_graphs}
\input{chapter_tree_decomposition}
\input{chapter_maximum_independent_set}
\input{chapter_bipartite_matchings}
\input{chapter_stable_matchings}
%------------------------------------------------
%\chapter*{Bibliography}
%\markboth{\sffamily\normalsize\bfseries Bibliography}{\sffamily\normalsize\bfseries Bibliography} % Set the page headers to display a Bibliography chapter name
%\addcontentsline{toc}{chapter}{\textcolor{ocre}{Bibliography}} % Add a Bibliography heading to the table of contents
%\section*{Articles}
%\addcontentsline{toc}{section}{Articles} % Add the Articles subheading to the table of contents
%\printbibliography[heading=bibempty, type=article] % Output article bibliography entries
%\section*{Books}
%\addcontentsline{toc}{section}{Books} % Add the Books subheading to the table of contents
%\printbibliography[heading=bibempty, type=book] % Output book bibliography entries
\end{document}