add scrhack to make koma play nice with listings/float
[ach-master.git] / src / applied-crypto-hardening.tex
1 %%%
2 %%% Applied Crypto Hardening
3 %%% bettercrypto.org
4 %%%
5 %%%% Based on:
6 %%% LaTeX Template: Two column article
7 %%%
8 %%% Source: http://www.howtotex.com/
9 %%% Feel free to distribute this template, but please keep to referal to http://www.howtotex.com/ here.
10 %%% Date: February 2011
11 %%%%
12
13 %%% Preamble
14 \RequirePackage{fix-cm}
15 \documentclass{scrreprt}
16 \usepackage[utf8]{inputenc}
17 % changes font encoding to T1
18 \usepackage[T1]{fontenc}
19 \usepackage{textcomp}
20 % For searchable pdfs
21 \input glyphtounicode
22 \pdfgentounicode=1
23 \usepackage{fixltx2e}
24 \usepackage{scrhack}
25
26 \KOMAoptions{paper=a4%
27   ,fontsize=10pt%
28   ,DIV=12%
29   ,parskip=true%
30 }
31
32
33 \usepackage[english]{babel}
34 \usepackage[final,babel=true]{microtype}[2011/08/18]
35 \usepackage{graphicx}
36 \usepackage[hang, small,labelfont=bf,up,textfont=it,up]{caption}
37 \usepackage{epstopdf}
38 \usepackage{subfig}
39
40 \usepackage[usenames,dvipsnames]{color}
41 \usepackage{float}
42 \usepackage{subfig}
43 \usepackage{acronym}
44 \usepackage{fancyvrb}
45 \usepackage{listings}
46 \usepackage{longtable}
47
48 % Epigraph / dictum
49 \renewcommand*{\dictumrule}{}
50 \renewcommand*{\dictumauthorformat}[1]{--- #1}
51 \newcommand*{\epigraph}[3][]{\dictum[#3]{#2}\bigskip}
52 \addtokomafont{dictumtext}{\itshape}
53 \setkomafont{dictumauthor}{\normalfont}
54 \renewcommand{\dictumwidth}{8cm}
55
56 \usepackage{gitinfo}
57
58 % custom changes:
59 \usepackage[usenames,dvipsnames,svgnames,table]{xcolor}
60 \usepackage{placeins}
61 \usepackage{draftwatermark}
62
63 % human tables
64 \usepackage{booktabs}
65 \renewcommand{\arraystretch}{1.25}
66
67 % side box
68 \usepackage{wrapfig}
69 %\usepackage{tcolorbox}
70 \newenvironment{WrapText}[1][r]
71   {\wrapfigure{#1}{0.5\textwidth}\tcolorbox}
72   {\endtcolorbox\endwrapfigure}
73
74 % Add text symbols
75 \usepackage{pifont}
76 \newcommand{\yes}{\textcolor{green}{\ding{51}}}
77 \newcommand{\no}{\textcolor{red}{\ding{55}}}
78
79
80 % Colours
81 \definecolor{green}{RGB}{32,113,10}
82 \definecolor{orange}{RGB}{251,111,16}
83 \definecolor{red}{RGB}{247,56,0}
84 \definecolor{blue}{RGB}{0,28,128}
85 \definecolor{lightgreen}{RGB}{187,218,216}
86 \definecolor{intersectgreen}{RGB}{103,133,155}
87 \definecolor{darkblue}{RGB}{76,87,117}
88
89 \bibliographystyle{alphalink}
90
91 \definecolor{Brown}{cmyk}{0,0.81,1,0.60}
92 \definecolor{OliveGreen}{cmyk}{0.64,0,0.95,0.40}
93 \definecolor{CadetBlue}{cmyk}{0.62,0.57,0.23,0}
94 \definecolor{lightlightgray}{gray}{0.9}
95
96
97 % make font Open Sans
98 \usepackage[defaultsans]{opensans}
99
100 % makes default font sans-serif
101  \renewcommand{\familydefault}{\sfdefault}
102
103 %
104 % Fonts are loaded, now is the right time for mictorype.
105 \microtypesetup{stretch=9,shrink=15,step=3,tracking=smallcaps,letterspace=75}
106
107
108 \lstset{
109 %language=Bash,                             % Code langugage
110 basicstyle=\ttfamily,                   % Code font, Examples: \footnotesize, \ttfamily
111 keywordstyle=\color{OliveGreen},        % Keywords font ('*' = uppercase)
112 commentstyle=\color{gray},              % Comments font
113 %numbers=left,                           % Line nums position
114 %numberstyle=\tiny,                      % Line-numbers fonts
115 %stepnumber=1,                           % Step between two line-numbers
116 %numbersep=5pt,                          % How far are line-numbers from code
117 backgroundcolor=\color{lightlightgray}, % Choose background color
118 frame=none,                             % A frame around the code
119 tabsize=2,                              % Default tab size
120 captionpos=b,                           % Caption-position = bottom
121 breaklines=true,                        % Automatic line breaking?
122 breakatwhitespace=false,                % Automatic breaks only at whitespace?
123 showspaces=false,                       % Dont make spaces visible
124 showtabs=false,                         % Dont make tabls visible
125 columns=fixed,                          % Column format
126 morekeywords={__global__, __device__},  % 
127 }
128
129
130 %% \todo{} command.
131 % Outputs red TODOs in the document. Requires \usepackage{color}.
132 % Usage: \todo{Document the TODO command.}
133 % Comment out second line to disable.
134 \newcommand{\todo}[1]{}
135 \renewcommand{\todo}[1]{{\color{Red} TODO: {#1}}}
136
137 \addtokomafont{disposition}{\color{darkblue}\bfseries}
138 % use more of the page
139 %\usepackage{fullpage}
140
141 % Detect if we can use the brand new scrlayer
142 % else use the good old scrpage2
143 \newif\ifscrlayer
144 {\def\tempa#1 v#2 #3!{\ifdim #2pt>3.11pt\relax \global\scrlayertrue\else \scrlayerfalse\fi}
145 \expandafter\tempa\KOMAScriptVersion!}
146 \ifscrlayer
147 \usepackage[footsepline]{scrlayer-scrpage}
148 \else
149 \usepackage[footsepline]{scrpage2}
150 \fi
151
152 \usepackage{lastpage}
153
154 \ifoot%
155 [{\footnotesize Applied Crypto Hardening \textbullet ~Draft revision\gitVtags: \gitAbbrevHash{} (\gitCommitterIsoDate) \gitCommitterName}]%
156 {{\footnotesize Applied Crypto Hardening \textbullet ~Draft revision\gitVtags: \gitAbbrevHash{} (\gitCommitterIsoDate) \gitCommitterName}}
157 \cfoot[]{}
158 \ofoot%
159 [{\footnotesize page \thepage\ of \pageref{LastPage}}]%
160 {{\footnotesize page \thepage\ of \pageref{LastPage}}}
161
162 % Creating a horizontal rule
163 \newcommand{\HorRule}{\color{darkblue}%
164   \rule{\linewidth}{1pt}%
165 }
166
167 \date{\today}
168
169 %tell TeX where to look for graphics/logos
170 \graphicspath{ {/img/} }
171
172 % hyperref needs to be the last package you load.
173 \usepackage[pdftex,breaklinks,colorlinks,linkcolor=darkblue,citecolor=blue,urlcolor=blue]{hyperref}
174
175 % Package to create dummy text
176 \usepackage{blindtext}
177 % debug page layout
178 %\usepackage{showframe}
179
180 %%% Begin document
181 \begin{document}
182
183 %\maketitle
184 \pagestyle{scrheadings}
185 % new title page
186 \input{title.tex}
187
188
189
190 \input{neboltai}
191 \input{acknowledgements}
192 \input{abstract}
193 \tableofcontents
194 \chapter{Introduction}
195 \label{chapter:Intro}
196 \input{whoshouldread}
197 \input{related_publications}
198 \input{howtoread}
199 \input{disclaimer}
200 \input{motivation}
201 \input{methods}
202 %%
203 \chapter{Practical recommendations}
204 \label{chapter:PracticalSettings}
205 \input{practical_settings}
206 %%
207 \chapter{Theory}
208 %\epigraph{``Number theorists are like lotus-eaters - having tasted this food they can never give it up.''}{Leopold Kronecker}
209 \label{chapter:Theory}
210 \input{theory}
211 \chapter{Appendix}
212 \input{tools}
213 \input{links}
214 \input{suggested_reading}
215 \input{cipher_suite_names}
216 \input{further_research}
217 %\input{reviewers}
218 \input{bib}
219
220 \end{document}
221 %%% Local Variables: 
222 %%% mode: latex
223 %%% TeX-master: t
224 %%% End: