add quotation mark in add_header HSTS directive
[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 \setkomafont{pagehead}{\normalfont\sffamily\footnotesize}
56 \ifoot%
57 [Applied Crypto Hardening\ifdraft{ % Space!
58   \textbullet{} \draftInfo}{}]%
59 {Applied Crypto Hardening \ifdraft{ % Space!
60     \textbullet{} \draftInfo}{}}
61 \cfoot[]{}
62 \ofoot%
63 [page \thepage\ of \pageref{LastPage}]%
64 {page \thepage\ of \pageref{LastPage}}
65 \automark[subsection]{section}
66 \ihead{\leftmark}
67 \chead[]{}
68 \ohead{\rightmark}
69 \pagestyle{scrheadings}
70
71 % Epigraph / dictum
72 \newcommand*{\epigraph}[3][]{\dictum[#3]{#2}\bigskip}
73 \renewcommand*{\dictumrule}{}
74 \renewcommand*{\dictumauthorformat}[1]{--- #1}
75 \addtokomafont{dictumtext}{\itshape}
76 \setkomafont{dictumauthor}{\normalfont}
77 \renewcommand{\dictumwidth}{8cm}
78
79 % Graphics
80 %tell TeX where to look for graphics/logos
81 \graphicspath{ {/img/} }
82 % Listings
83 \lstset{
84   basicstyle=\ttfamily,
85   keywordstyle=\color{OliveGreen},
86   commentstyle=\color{gray},
87   backgroundcolor=\color{lightlightgray},
88   upquote=true,
89   showstringspaces=false,
90   tabsize=2,
91   captionpos=b,
92   frame=single,
93   breaklines=true,
94   breakatwhitespace=false,
95   inputencoding=utf8,
96   breakatwhitespace=false,
97   showspaces=false,
98   columns=fullflexible,                   % Column format: no spaces are inserted for monospaced appearance
99   breakindent=10pt,
100   morekeywords={__global__, __device__},% 
101   % breakautoindent=false,
102   prebreak=\raisebox{0ex}[0ex][0ex]{{\color{red}\textbackslash}},
103   postbreak=\raisebox{0ex}[0ex][0ex]{{\color{red}\textbackslash}},
104   escapechar=\`,
105   escapeinside={\%*}{*)},                 % Escape TeX commands inside %* and *)
106 % %  prebreak=\mbox{$\curvearrowright$},     % Disply curved arrow before linebreak
107 %   prebreak=\small\symbol{'134},
108 }
109
110 % Hyperref styles
111 \hypersetup{%
112   breaklinks,%
113   colorlinks,%
114   linkcolor=darkblue,citecolor=blue,urlcolor=blue,%
115   breaklinks=true,%
116   unicode,%
117   pdfnewwindow=true,%
118   final
119 }
120 \urlstyle{same}
121
122 % Glossary
123 \setupglossaries{shortcuts,index,nohypertypes={index}}
124 \glstoctrue
125 \setacronymstyle{long-sc-short}
126 % as per documentation
127 \newglossarystyle{achindex}{%
128  \setglossarystyle{mcolindex}%
129 \renewcommand*{\glsnamefont}[1]{\textmd{##1}}
130  \renewcommand*{\glsgroupheading}[1]{%
131     \item\textbf{\glsgetgrouptitle{##1}}\item{}\space}%
132   \renewcommand*{\glsgroupskip}{%
133     \ifglsnogroupskip\else%
134     \newline\relax%
135     \fi}%
136 }
137
138 % Bibliography
139 \bibliographystyle{alphalink}
140
141 % Disable single lines at the start of a paragraph (Schusterjungen)
142 \clubpenalty = 10000
143 % Disable single lines at the end of a paragraph (Hurenkinder)
144 \widowpenalty = 10000 
145 \displaywidowpenalty = 10000 % formulas
146 \setlength{\textfloatsep}{\baselineskip}
147 \setlength{\floatsep}{\baselineskip}
148
149 \frenchspacing
150 \raggedbottom
151
152 % customized spaces between text and footnotes
153 \setlength{\skip\footins}{2\baselineskip}
154
155 % Better float parameters: (from the TeX FAQ)
156 \renewcommand{\topfraction}{.85}
157 \renewcommand{\bottomfraction}{.7}
158 \renewcommand{\textfraction}{.15}
159 \renewcommand{\floatpagefraction}{.66}
160 \renewcommand{\dbltopfraction}{.66}
161 \renewcommand{\dblfloatpagefraction}{.66}
162 \setcounter{topnumber}{9}
163 \setcounter{bottomnumber}{9}
164 \setcounter{totalnumber}{20}
165 \setcounter{dbltopnumber}{9}
166
167 % Starred lists (\begin{itemize*}) for less space between items
168 \usepackage{mdwlist}
169
170 %%% Local Variables: 
171 %%% mode: latex
172 %%% TeX-master: "../applied-crypto-hardening"
173 %%% End: