initial slide deck for trainings
[ach-master.git] / presentations / org-training / 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=9pt,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 % red warning box (for SSH section)
112 \mdfdefinestyle{warningboxstyle}{
113   backgroundcolor=pink!20,
114   innerleftmargin=9pt,innerrightmargin=9pt,innertopmargin=9pt,innerbottommargin=9pt
115 }
116
117 % Hyperref styles
118 %\hypersetup{%
119 %  breaklinks,%
120 %  colorlinks,%
121 %  linkcolor=darkblue,citecolor=blue,urlcolor=blue,%
122 %  breaklinks=true,%
123 %  unicode,%
124 %  pdfnewwindow=true,%
125 %  final
126 %}
127 %\urlstyle{same}
128
129 % Bibliography
130 \bibliographystyle{alphalink}
131
132 % Disable single lines at the start of a paragraph (Schusterjungen)
133 \clubpenalty = 10000
134 % Disable single lines at the end of a paragraph (Hurenkinder)
135 \widowpenalty = 10000 
136 \displaywidowpenalty = 10000 % formulas
137 \setlength{\textfloatsep}{\baselineskip}
138 \setlength{\floatsep}{\baselineskip}
139
140 \frenchspacing
141 \raggedbottom
142
143 % customized spaces between text and footnotes
144 \setlength{\skip\footins}{2\baselineskip}
145
146 % Better float parameters: (from the TeX FAQ)
147 \renewcommand{\topfraction}{.85}
148 \renewcommand{\bottomfraction}{.7}
149 \renewcommand{\textfraction}{.15}
150 \renewcommand{\floatpagefraction}{.66}
151 \renewcommand{\dbltopfraction}{.66}
152 \renewcommand{\dblfloatpagefraction}{.66}
153 \setcounter{topnumber}{9}
154 \setcounter{bottomnumber}{9}
155 \setcounter{totalnumber}{20}
156 \setcounter{dbltopnumber}{9}
157
158 % Starred lists (\begin{itemize*}) for less space between items
159 \usepackage{mdwlist}
160
161 %%% Local Variables: 
162 %%% mode: latex
163 %%% TeX-master: "../applied-crypto-hardening"
164 %%% End: