Revert "Revert "Merge pull request #36 from krono/krono/draft-enhanchement""
[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 \renewcommand*{\chapterpagestyle}{scrheadings}
65 \pagestyle{scrheadings}
66
67 % Epigraph / dictum
68 \newcommand*{\epigraph}[3][]{\dictum[#3]{#2}\bigskip}
69 \renewcommand*{\dictumrule}{}
70 \renewcommand*{\dictumauthorformat}[1]{--- #1}
71 \addtokomafont{dictumtext}{\itshape}
72 \setkomafont{dictumauthor}{\normalfont}
73 \renewcommand{\dictumwidth}{8cm}
74
75 % Graphics
76 %tell TeX where to look for graphics/logos
77 \graphicspath{ {/img/} }
78
79 % Listings
80 \lstset{
81 %  literate={###CIPHERSTRINGB###}{{\CIPHERSTRINGB}}254,
82   basicstyle=\ttfamily,
83   keywordstyle=\color{OliveGreen},
84   commentstyle=\color{gray},
85   backgroundcolor=\color{lightlightgray},
86   upquote=true,
87   tabsize=2,
88   captionpos=b,
89   breaklines=true,
90   breakatwhitespace=false,
91   inputencoding=utf8,
92   prebreak=\raisebox{0ex}[0ex][0ex]{\ensuremath{\hookleftarrow}},
93   morekeywords={__global__, __device__},% 
94   escapechar=\`,
95 }
96
97
98 % Hyperref styles
99 \hypersetup{%
100   breaklinks,%
101   colorlinks,%
102   linkcolor=darkblue,citecolor=blue,urlcolor=blue,%
103   breaklinks=true,%
104   unicode,%
105   pdfnewwindow=true,%
106   final
107 }
108 \urlstyle{same}
109
110 % Bibliography
111 \bibliographystyle{alphalink}
112
113 % Disable single lines at the start of a paragraph (Schusterjungen)
114 \clubpenalty = 10000
115 % Disable single lines at the end of a paragraph (Hurenkinder)
116 \widowpenalty = 10000 
117 \displaywidowpenalty = 10000 % formulas
118 \setlength{\textfloatsep}{\baselineskip}
119 \setlength{\floatsep}{\baselineskip}
120
121 \frenchspacing
122 \raggedbottom
123
124 % customized spaces between text and footnotes
125 \setlength{\skip\footins}{2\baselineskip}
126
127 % Better float parameters: (from the TeX FAQ)
128 \renewcommand{\topfraction}{.85}
129 \renewcommand{\bottomfraction}{.7}
130 \renewcommand{\textfraction}{.15}
131 \renewcommand{\floatpagefraction}{.66}
132 \renewcommand{\dbltopfraction}{.66}
133 \renewcommand{\dblfloatpagefraction}{.66}
134 \setcounter{topnumber}{9}
135 \setcounter{bottomnumber}{9}
136 \setcounter{totalnumber}{20}
137 \setcounter{dbltopnumber}{9}
138
139 %%% Local Variables: 
140 %%% mode: latex
141 %%% TeX-master: "../applied-crypto-hardening"
142 %%% End: