Split configfiles out of TeX document.
[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 % Listings
77 \lstset{
78   basicstyle=\ttfamily,
79   keywordstyle=\color{OliveGreen},
80   commentstyle=\color{gray},
81   backgroundcolor=\color{lightlightgray},
82   upquote=true,
83   showstringspaces=false,
84   tabsize=2,
85   captionpos=b,
86   frame=single,
87   breaklines=true,
88   breakatwhitespace=false,
89   inputencoding=utf8,
90   breakatwhitespace=false,
91   showspaces=false,
92   columns=fullflexible,                   % Column format: no spaces are inserted for monospaced appearance
93   breakindent=10pt,
94   morekeywords={__global__, __device__},% 
95   % breakautoindent=false,
96   prebreak=\raisebox{0ex}[0ex][0ex]{{\color{red}\textbackslash}},
97   postbreak=\raisebox{0ex}[0ex][0ex]{{\color{red}\textbackslash}},
98   escapechar=\`,
99   escapeinside={\%*}{*)},                 % Escape TeX commands inside %* and *)
100 % %  prebreak=\mbox{$\curvearrowright$},     % Disply curved arrow before linebreak
101 %   prebreak=\small\symbol{'134},
102 }
103
104 % Hyperref styles
105 \hypersetup{%
106   breaklinks,%
107   colorlinks,%
108   linkcolor=darkblue,citecolor=blue,urlcolor=blue,%
109   breaklinks=true,%
110   unicode,%
111   pdfnewwindow=true,%
112   final
113 }
114 \urlstyle{same}
115
116 % Bibliography
117 \bibliographystyle{alphalink}
118
119 % Disable single lines at the start of a paragraph (Schusterjungen)
120 \clubpenalty = 10000
121 % Disable single lines at the end of a paragraph (Hurenkinder)
122 \widowpenalty = 10000 
123 \displaywidowpenalty = 10000 % formulas
124 \setlength{\textfloatsep}{\baselineskip}
125 \setlength{\floatsep}{\baselineskip}
126
127 \frenchspacing
128 \raggedbottom
129
130 % customized spaces between text and footnotes
131 \setlength{\skip\footins}{2\baselineskip}
132
133 % Better float parameters: (from the TeX FAQ)
134 \renewcommand{\topfraction}{.85}
135 \renewcommand{\bottomfraction}{.7}
136 \renewcommand{\textfraction}{.15}
137 \renewcommand{\floatpagefraction}{.66}
138 \renewcommand{\dbltopfraction}{.66}
139 \renewcommand{\dblfloatpagefraction}{.66}
140 \setcounter{topnumber}{9}
141 \setcounter{bottomnumber}{9}
142 \setcounter{totalnumber}{20}
143 \setcounter{dbltopnumber}{9}
144
145 % Starred lists (\begin{itemize*}) for less space between items
146 \usepackage{mdwlist}
147
148 %%% Local Variables: 
149 %%% mode: latex
150 %%% TeX-master: "../applied-crypto-hardening"
151 %%% End: