Remove Heading (scrheadings), Aaron's wish
[ach-master.git] / src / common / style.tex
1 %%%
2 %%% style.tex
3 %%% Stylistic configuration
4 %%%
5
6 % Colors
7 \definecolor{green}{RGB}{32,113,10}
8 \definecolor{orange}{RGB}{251,111,16}
9 \definecolor{red}{RGB}{247,56,0}
10 \definecolor{blue}{RGB}{0,28,128}
11 \definecolor{lightgreen}{RGB}{187,218,216}
12 \definecolor{intersectgreen}{RGB}{103,133,155}
13 \definecolor{darkblue}{RGB}{76,87,117}
14 \definecolor{Brown}{cmyk}{0,0.81,1,0.60}
15 \definecolor{OliveGreen}{cmyk}{0.64,0,0.95,0.40}
16 \definecolor{CadetBlue}{cmyk}{0.62,0.57,0.23,0}
17 \definecolor{lightlightgray}{gray}{0.9}
18
19 % Draft stuff
20 \ifdraft{
21   % Ensure that everything is neatly set up for us
22   \AtBeginDocument{
23     \def\draftInfo{%
24       Draft revision\gitVtags: \gitAbbrevHash{} %
25       (\gitCommitterIsoDate) \gitCommitterName}
26     \sbox{\draftWatermark}{%
27       \includegraphics[width=\paperwidth]{img/draft}}
28     \sbox{\draftPageLine}{%
29       \colorbox{black!10}{%
30         % enlarge box vertically by 2/3 lines
31         \raisebox{0pt}%
32         [\dimexpr .33\baselineskip + \height]%
33         [\dimexpr .33\baselineskip + \depth]{%
34           \makebox[\paperwidth]{\color{black!50}\draftInfo}}}}
35   }
36 }{}
37
38
39 %%% Fonts
40 % Fonts are loaded, now is the right time for mictorype.
41 \microtypesetup{stretch=9,shrink=15,step=3,tracking=smallcaps,letterspace=75}
42 % makes default font sans-serif
43  \renewcommand{\familydefault}{\sfdefault}
44
45 % Captions
46 \setcapindent{1em}
47 \addtokomafont{caption}{\small\itshape}
48 \addtokomafont{captionlabel}{\bfseries}
49
50 % Section headers
51 \addtokomafont{disposition}{\color{darkblue}\bfseries}
52
53 % Page foot
54 \setkomafont{pagefoot}{\normalfont\sffamily\footnotesize}
55 \ifoot%
56 [Applied Crypto Hardening\ifdraft{ % Space!
57   \textbullet{} \draftInfo}{}]%
58 {Applied Crypto Hardening \ifdraft{ % Space!
59     \textbullet{} \draftInfo}{}}
60 \cfoot[]{}
61 \ofoot%
62 [page \thepage\ of \pageref{LastPage}]%
63 {page \thepage\ of \pageref{LastPage}}
64
65 % Epigraph / dictum
66 \newcommand*{\epigraph}[3][]{\dictum[#3]{#2}\bigskip}
67 \renewcommand*{\dictumrule}{}
68 \renewcommand*{\dictumauthorformat}[1]{--- #1}
69 \addtokomafont{dictumtext}{\itshape}
70 \setkomafont{dictumauthor}{\normalfont}
71 \renewcommand{\dictumwidth}{8cm}
72
73 % Graphics
74 %tell TeX where to look for graphics/logos
75 \graphicspath{ {/img/} }
76
77 % This block is for listings
78 \usepackage[framemethod=TikZ]{mdframed} % mdframed is used to draw a grey box
79 \mdfdefinestyle{listingstyle}{
80   backgroundcolor=black!10,outerlinewidth=0,outerlinecolor=black,
81   innerleftmargin=9pt,innerrightmargin=0,innertopmargin=3pt,innerbottommargin=2pt
82 }
83 %\usepackage{amssymb}% for \curvearrowright
84 % Insert a grey box behind the listing for uniform background color (The \cipherstring would the listing and the background would turn white)
85 \BeforeBeginEnvironment{lstlisting}{\vspace{0.2cm}\begin{mdframed}[style=listingstyle]}
86 \AfterEndEnvironment{lstlisting}{\end{mdframed}}
87 % Listings
88 \lstset{
89   basicstyle=\ttfamily,
90   keywordstyle=\color{OliveGreen},
91   commentstyle=\color{gray},
92   backgroundcolor=\color{lightlightgray},
93   upquote=true,
94   showstringspaces=false,
95   tabsize=2,
96   captionpos=b,
97   breaklines=true,
98   breakatwhitespace=false,
99   inputencoding=utf8,
100   breakatwhitespace=false,
101   showspaces=false,
102   columns=fullflexible,                   % Column format: no spaces are inserted for monospaced appearance
103   breakindent=10pt,
104   morekeywords={__global__, __device__},% 
105   escapechar=\`,
106   escapeinside={\%*}{*)},                 % Escape TeX commands inside %* and *)
107 %  prebreak=\mbox{$\curvearrowright$},     % Disply curved arrow before linebreak
108   prebreak=\small\symbol{'134},
109 }
110
111
112 % Hyperref styles
113 \hypersetup{%
114   breaklinks,%
115   colorlinks,%
116   linkcolor=darkblue,citecolor=blue,urlcolor=blue,%
117   breaklinks=true,%
118   unicode,%
119   pdfnewwindow=true,%
120   final
121 }
122 \urlstyle{same}
123
124 % Bibliography
125 \bibliographystyle{alphalink}
126
127 % Disable single lines at the start of a paragraph (Schusterjungen)
128 \clubpenalty = 10000
129 % Disable single lines at the end of a paragraph (Hurenkinder)
130 \widowpenalty = 10000 
131 \displaywidowpenalty = 10000 % formulas
132 \setlength{\textfloatsep}{\baselineskip}
133 \setlength{\floatsep}{\baselineskip}
134
135 \frenchspacing
136 \raggedbottom
137
138 % customized spaces between text and footnotes
139 \setlength{\skip\footins}{2\baselineskip}
140
141 % Better float parameters: (from the TeX FAQ)
142 \renewcommand{\topfraction}{.85}
143 \renewcommand{\bottomfraction}{.7}
144 \renewcommand{\textfraction}{.15}
145 \renewcommand{\floatpagefraction}{.66}
146 \renewcommand{\dbltopfraction}{.66}
147 \renewcommand{\dblfloatpagefraction}{.66}
148 \setcounter{topnumber}{9}
149 \setcounter{bottomnumber}{9}
150 \setcounter{totalnumber}{20}
151 \setcounter{dbltopnumber}{9}
152
153 %%% Local Variables: 
154 %%% mode: latex
155 %%% TeX-master: "../applied-crypto-hardening"
156 %%% End: