forked from pbienst/active-math
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tex
executable file
·356 lines (274 loc) · 10.9 KB
/
main.tex
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
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
% Load the kaobook class
\documentclass[
fontsize=11pt, % Base font size
twoside=false, % Use different layouts for even and odd pages (in particular, if twoside=true, the margin column will be always on the outside)
%open=any, % If twoside=true, uncomment this to force new chapters to start on any page, not only on right (odd) pages
secnumdepth=1, % How deep to number headings. Defaults to 1 (sections)
]{kaobook}
% Choose the language
\usepackage[english]{babel} % Load characters and hyphenation
\usepackage[english=british]{csquotes} % English quotes
% Load the bibliography package
\usepackage{styles/kaobiblio}
\addbibresource{minimal.bib} % Bibliography file
% Load mathematical packages for theorems and related environments. NOTE: choose only one between 'mdftheorems' and 'plaintheorems'.
\usepackage{styles/mdftheorems}
%\usepackage{styles/plaintheorems}
% Load the package for hyperreferences
\usepackage{styles/kaorefs}
\usepackage{soul}
\makeindex[columns=3, title=Alphabetical Index, intoc] % Make LaTeX produce the files required to compile the index
%
% Own modifications
%
% Minitoc
\usepackage{tikz}
\usepackage{tikzpagenodes}
\usepackage{etoc}
\etocsetstyle{section}
{}
{\leavevmode\leftskip 0.2cm \rightskip 0.6cm \relax}
{\makebox[1.cm][l]{\etocnumber}%
\etocname\nobreak\dotfill\nobreak
\rlap{\makebox[0.7cm][r]{\etocpage}}\par\vspace{-2mm}}
{}
\etocsettocdepth{1}
\etocsettocstyle{}{}
\newcommand{\chaptertoc}{%
\bigskip%
\bfseries%
\textcolor{headingbordeaux}{\large Contents}%
\vspace{-5mm}%
\par%
\rule{\textwidth}{0.4pt}
\vspace{-7mm}%
\begin{small}%
\localtableofcontents%
\end{small}%
\mdseries%
\vspace{-3mm}%
\rule{\textwidth}{0.4pt}%
\smallskip%
}
\hyphenation{wave-guide ortho-gonal ma-ni-fold}
\definecolor{headingbordeaux}{HTML}{AF2E46}
\definecolor{headingblue}{HTML}{004A90}
\definecolor{greenbackground}{HTML}{F0F7ED}
\definecolor{bluebackground}{HTML}{EFF8FD}
\addtokomafont{chapter}{\color{headingbordeaux}}
\addtokomafont{section}{\color{headingblue}}
\addtokomafont{subsection}{\color{headingbordeaux}}
% Only used for important formulas.
\renewcommand\fbox{\fcolorbox{red}{white}}
\setlength{\fboxrule}{1.5pt}
\setlength{\fboxsep}{10pt}
% Box style
\mdfsetup{skipabove=\topskip,skipbelow=0pt}%-.5\topskip}
\mdfdefinestyle{mdfkaoexer}{
skipabove=\topskip,
skipbelow=\topskip, % Does not work :(
rightmargin=0pt,
leftmargin=0pt,
innertopmargin=4pt,
innerbottommargin=6pt,
innerrightmargin=3pt,
innerleftmargin=3pt,
topline=true,
bottomline=true,
rightline=false,
leftline=false,
%linewidth=1pt,
%roundcorner=0pt,
%font={},
%frametitlefont={},
frametitlerule=true,
%linecolor=black,
%backgroundcolor=LightBlue,
%fontcolor=black,
%frametitlebackgroundcolor=LightBlue,
}
\theoremstyle{kaoexercise}
\declaretheorem[
name=Exercise,
%refname={example,examples},
refname={Exercise,Exercises},
Refname={Exercise,Exercises},
numberwithin=chapter,
mdframed={
style=mdfkaoexer,
backgroundcolor=bluebackground,
%frametitlebackgroundcolor=\@theorembackground,
},
]{exer}
\declaretheoremstyle[
%spaceabove=.5\thm@preskip,
%spacebelow=.5\thm@postskip,
%headfont=\normalfont\bfseries,
%notefont=\normalfont, notebraces={ (}{)},
%bodyfont=\small,
%headformat={\NAME\space\NUMBER\space\NOTE},
headpunct={},
postheadspace=0em,
headindent=0em,
%prefoothook={\hfill\qedsymbol}
%refname={theorem,theorems},
%Refname={Theorem,Theorems},
]{kaocue}
\theoremstyle{kaocue}
\declaretheorem[
name=,
numbered=no,
mdframed={
style=mdfkaoexer,
backgroundcolor=greenbackground,
},
]{cue}
\theoremstyle{kaocue}
\declaretheorem[
name=,
numbered=no,
mdframed={
style=mdfkaoexer,
backgroundcolor=bluebackground,
},
]{exunmarked}
% Dummy environments for use by the Python preprocessor.
\newenvironment{sol}%
{% begin code
\linebreak\textbf{Solution}%
}%
\newenvironment{hnt}%
{% begin code
\linebreak\textbf{Hint}%
}%
% Different icons.
\newcommand\iconmarginoffset{-3pt}
\newcommand\iconheight{15pt}
\newcommand{\trivial}{\includegraphics[height=\iconheight]{icons/trivial.png}}
\newcommand{\normal}{\includegraphics[height=\iconheight]{icons/normal.png}}
\newcommand{\hard}{\includegraphics[height=\iconheight]{icons/hard.png}}
\newcommand{\hint}{\includegraphics[height=\iconheight]{icons/hint.png}}
\newcommand{\solution}{\includegraphics[height=\iconheight]{icons/answer.png}}
\newcommand{\ugent}{\includegraphics[height=\iconheight]{icons/ugent.png}}
\newcommand{\youtube}{\,\,\includegraphics[height=\iconheight]{icons/video.png}\,\,\,}
\newcommand{\jupyter}{\,\,\includegraphics[height=\iconheight]{icons/jupyter.png}\,\,\,}
\newcommand{\sectionmarginoffset}{-1pt} % hack
\newcommand{\sectionyoutubeugent}[2]{\section[#1]{\noindent\marginnote[\sectionmarginoffset]{\href{https://youtu.be/#2}{\youtube}\,\ugent}#1}}
\newcommand{\sectionyoutube}[2]{\section[#1]{\noindent\marginnote[\sectionmarginoffset]{\href{https://youtu.be/#2}{\youtube}}#1}}
\newcommand{\sectionugent}[1]{\section[#1]{\noindent\marginnote[\sectionmarginoffset]{\ugent}#1}}
\newcommand{\subsectionyoutubeugent}[2]{\subsection[#1]{\noindent\marginnote[\sectionmarginoffset]{\href{https://youtu.be/#2}{\youtube}\,\ugent}#1}}
\newcommand{\subsectionyoutube}[2]{\subsection[#1]{\noindent\marginnote[\sectionmarginoffset]{\href{https://youtu.be/#2}{\youtube}}#1}}
\newcommand{\subsectionugent}[1]{\subsection[#1]{\noindent\marginnote[\sectionmarginoffset]{\ugent}#1}}
\begin{document}
%----------------------------------------------------------------------------------------
% BOOK INFORMATION
%----------------------------------------------------------------------------------------
\titlehead{}
\title[Mathematics for Photonics]{Mathematics for Photonics}
\author[PB]{Peter Bienstman}
\date{\today}
%----------------------------------------------------------------------------------------
\KOMAoptions{twoside=semi}
\input{preamble/frontpage}
\KOMAoptions{twoside=false}
\frontmatter % Denotes the start of the pre-document content, uses roman numerals
\setcounter{page}{1}
%----------------------------------------------------------------------------------------
% COPYRIGHT PAGE
%----------------------------------------------------------------------------------------
\makeatletter
\uppertitleback{\@titlehead} % Header
\lowertitleback{
\textbf{Licence} \\
\ccbyncsa \\
This work is licenced under a Creative Commons 4.0 Attribution-NonCommercial-ShareAlike licence.
%\medskip
%\textbf{Publisher} \\
%First printed in May 2019 by \@publishers
}
\makeatother
%----------------------------------------------------------------------------------------
% DEDICATION
%----------------------------------------------------------------------------------------
%\dedication{
% The harmony of the world is made manifest in Form and Number, and the heart and soul and all the poetry of Natural Philosophy are embodied in the concept of mathematical beauty.\\
% \flushright -- D'Arcy Wentworth Thompson
%}
%----------------------------------------------------------------------------------------
% OUTPUT TITLE PAGE AND PREVIOUS
%----------------------------------------------------------------------------------------
% Note that \maketitle outputs the pages before here
% If twoside=false, \uppertitleback and \lowertitleback are not printed
% To overcome this issue, we set twoside=semi just before printing the title pages, and set it back to false just after the title pages
\KOMAoptions{twoside=semi}
\maketitle
\KOMAoptions{twoside=false}
%----------------------------------------------------------------------------------------
% PREFACE
%----------------------------------------------------------------------------------------
\input{preamble/preface}
\input{preamble/how_to_use}
\input{preamble/ugent}
%----------------------------------------------------------------------------------------
% TABLE OF CONTENTS & LIST OF FIGURES/TABLES
%----------------------------------------------------------------------------------------
\begingroup % Local scope for the following commands
% Define the style for the TOC, LOF, and LOT
%\setstretch{1} % Uncomment to modify line spacing in the ToC
\hypersetup{linkcolor=headingblue} % Uncomment to set the colour of links in the ToC
\setlength{\textheight}{230\vscale} % Manually adjust the height of the ToC pages
% Turn on compatibility mode for the etoc package
\etocstandarddisplaystyle % "toc display" as if etoc was not loaded
\etocstandardlines % "toc lines as if etoc was not loaded
\tableofcontents % Output the table of contents
%\listoffigures % Output the list of figures
% Comment both of the following lines to have the LOF and the LOT on different pages
%\let\cleardoublepage\bigskip
%\let\clearpage\bigskip
%\listoftables % Output the list of tables
\endgroup
%----------------------------------------------------------------------------------------
% MAIN BODY
%----------------------------------------------------------------------------------------
\mainmatter % Denotes the start of the main document content, resets page numbering and uses arabic numbers
\setchapterstyle{kao} % Choose the default chapter heading style
\input{helmholtz/helmholtz}
\input{complex/complex}
\input{bessel/bessel}
\input{hermite/hermite}
\input{numeric/numeric}
\input{symmetry/symmetry}
\input{dynamic/dynamic}
\input{kk/kk}
% Old chapter, no longer used.
% \input{stochastic/stochastic}
\appendix % From here onwards, chapters are numbered with letters, as is the appendix convention
%\pagelayout{wide} % No margins
%\addpart{Appendix}
%\pagelayout{margin} % Restore margins
%\chapter{Some more blindtext}
%\blindtext
%----------------------------------------------------------------------------------------
\backmatter % Denotes the end of the main document content
\setchapterstyle{plain} % Output plain chapters from this point onwards
%----------------------------------------------------------------------------------------
% BIBLIOGRAPHY
%----------------------------------------------------------------------------------------
\input{solutions}
\input{hints}
\input{postamble/credits}
% Manually created biobliograhpy:
\input{postamble/bibliography}
% The bibliography needs to be compiled with biber using your LaTeX editor, or on the command line with 'biber main' from the template directory
%\defbibnote{bibnote}{Here are the references in citation order.\par\bigskip} % Prepend this text to the bibliography
%\printbibliography[heading=bibintoc, title=Bibliography, prenote=bibnote] % Add the bibliography heading to the ToC, set the title of the bibliography and output the bibliography note
%----------------------------------------------------------------------------------------
% INDEX
%----------------------------------------------------------------------------------------
% The index needs to be compiled on the command line with 'makeindex main' from the template directory
%\printindex % Output the index
\end{document}
%%% Local Variables:
%%% mode: latex
%%% TeX-master: t
%%% End: