forked from crypto101/book
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Header.tex
196 lines (173 loc) · 5.19 KB
/
Header.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
% Typography
\usepackage{fontspec}
\defaultfontfeatures{Ligatures=TeX}
\setmainfont{Adobe Caslon Pro}
\setsansfont{Myriad Pro}
\setmonofont[Scale=MatchLowercase]{Menlo}
\usepackage{microtype}
\usepackage{setspace}
\usepackage{csquotes}
% Colors, links, syntax highlighting
\usepackage[dvipsnames,table]{xcolor}
\usepackage[pagebackref]{hyperref}
\hypersetup{
pdftitle={Crypto 101},
pdfauthor={Laurens Van Houtven (lvh)},
colorlinks,
linkcolor=Sepia,
citecolor=Periwinkle
}
\usepackage{minted}
\usepackage[acronym,toc]{glossaries}
\include{Glossary}
\makeglossaries
\usepackage{makeidx}
\makeindex
% Localization
\usepackage{polyglossia}
\setdefaultlanguage{english}
% Mathematical symbols
%% \usepackage{savesym}
%% \savesymbol{iint}
%% \savesymbol{iiint}
\usepackage{amsmath}
\usepackage{amssymb}
\newcommand\xor{\oplus}
% Advanced command definitions
\usepackage{xparse}
% Figures and subfigures
\usepackage{float}
\usepackage{rotating}
\usepackage{subcaption}
\usepackage{array}
\usepackage{calc}
\usepackage{framed}
\usepackage{wrapfig}
\usepackage{longtable}
\newcolumntype{C}[1]{>{\centering\arraybackslash$}p{#1}<{$}}
\usepackage[export]{adjustbox}
% Fancy figure command
\DeclareDocumentCommand{\illustration}{
m % sub-path to illustration, /Illustrations/{this}.pdf, mandatory
O{.8} % width as fraction of line width, optional
o % caption, optional
o % label, optional
}{
\begin{figure}[ht!]
\centering
\includegraphics[width=#2\linewidth]{./Illustrations/#1.pdf}
\IfValueTF{#3}{\caption{#3}}{}
\IfValueTF{#4}{\label{#4}}{}
\end{figure}
}
% Special subsection commands
\definecolor{shadecolor}{HTML}{AABAD1}
\DeclareDocumentCommand{\advanced}{
o % extra caption, optional
}{
\begin{shaded}
\begin{wrapfigure}{l}{.2\linewidth}
\vspace{-8pt}
\includegraphics[width=\linewidth]{./Illustrations/Propeller/Propeller.pdf}
\end{wrapfigure}
\noindent This is an optional, in-depth section. It almost
certainly won't help you write better software, so feel free to
skip it. It is only here to satisfy your inner geek's curiosity.
\IfValueTF{#1}{#1}{}
\end{shaded}
}
% Chapter markup
\usepackage{tikz, blindtext}
\makechapterstyle{box}{
\renewcommand*{\printchaptername}{}
\renewcommand*{\printchapternum}{
\flushright
\begin{tikzpicture}
\draw[fill,color=black] (0,0) rectangle (2cm,2cm);
\draw[color=white] (1cm,1cm) node { \chapnumfont\thechapter };
\end{tikzpicture}
}
\renewcommand*{\printchaptertitle}[1]{\flushright\chaptitlefont##1}
}
\chapterstyle{box}
% Title page markup
\usepackage{geometry}
\usepackage{titlesec}
\makeatletter
\newlength\drop
\renewcommand{\maketitle}{
\thispagestyle{empty}
\begingroup
\drop = 0.1\textheight
\vspace*{\baselineskip}
\vfill
\hbox{%
\hspace*{0.2\textwidth}%
\rule{1pt}{\dimexpr\textheight-28pt\relax}%
\hspace*{0.05\textwidth}%
\parbox[b]{0.75\textwidth}{%
\vbox{%
\vspace{\drop}
{\Huge\bfseries\raggedright\@title\par}\vskip2.37\baselineskip
{\Large\bfseries\@author\par}
\vspace{0.5\textheight}
}% end of vbox
}% end of parbox
}% end of hbox
\vfill
\null
\endgroup
\thispagestyle{plain}
\par
\noindent
Copyright 2013-2014, Laurens Van Houtven
\noindent
This book is made possible by your donations. If you enjoyed it,
please consider making a donation, so it can be made even better and
reach even more people.
\noindent
This work is available under the Creative Commons
Attribution-NonCommercial 4.0 International (CC BY-NC 4.0) license.
You can find the full text of the license
at \url{https://creativecommons.org/licenses/by-nc/4.0/}.
\begin{center}
\includegraphics{./Illustrations/CC/CC-BY-NC.pdf}
\end{center}
\noindent
The following is a human-readable summary of (and not a substitute
for) the license. You can:
\begin{itemize}
\item Share: copy and redistribute the material in any medium or format
\item Adapt: remix, transform, and build upon the material
\end{itemize}
The licensor cannot revoke these freedoms as long as you follow the
license terms:
\begin{itemize}
\item Attribution: you must give appropriate credit, provide a link
to the license, and indicate if changes were made. You may do so in
any reasonable manner, but not in any way that suggests the licensor
endorses you or your use.
\item NonCommercial: you may not use the material for commercial
purposes.
\item No additional restrictions: you may not apply legal terms or
technological measures that legally restrict others from doing
anything the license permits.
\end{itemize}
You do not have to comply with the license for elements of the
material in the public domain or where your use is permitted by an
applicable exception or limitation.
No warranties are given. The license may not give you all of the
permissions necessary for your intended use. For example, other
rights such as publicity, privacy, or moral rights may limit how you
use the material.
\clearpage
\thispagestyle{plain}
\par
\vspace*{.3\textheight}{
\centering
\emph{Pomidorkowi}
\par
\clearpage
}
}
\makeatother