summaryrefslogtreecommitdiff
path: root/style.tex
blob: ec9b1785fa81730cc4c7ed3385a57f51cbe3bfd3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{calc}
\usepackage[svgnames]{xcolor} % needed by tables & mdframed (load before tikz)
\usepackage{tikz}
\usetikzlibrary{positioning,shapes,arrows,fit,backgrounds,calc,patterns}
\usepackage{tikz-uml}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage[framemethod=TikZ]{mdframed}
\newmdenv[backgroundcolor=cgrey-light!25,
          linecolor=cgrey-med,
          innerleftmargin=2em,
          innerrightmargin=2em,
          innertopmargin=2em,
          innerbottommargin=2em]{cartouche}

% colours: (only works after xcolor is included)
\definecolor{cpurple}{RGB/CMYK}{92, 61, 204/0.76,0.77,0,0}
\definecolor{cgreen}{RGB/CMYK}{67, 194, 0/0.69,0,1,0}
\definecolor{cgrey-dark}{RGB/CMYK}{60, 60, 62/0,0,0,0.85}
\definecolor{cgrey-med}{RGB/CMYK}{139, 139, 137/0.33,0.26,0.28,0.12}
\definecolor{cgrey-light}{RGB/CMYK}{206, 208, 210/0,0,0,0.17}
\definecolor{green-sickly}{RGB}{167, 222, 139}
\definecolor{cpurple-pale}{RGB}{160, 145, 208}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{fontspec}
\setmainfont{Karla}
\setsansfont{Karla}
\setmonofont[Scale=MatchLowercase]{DejaVu Sans Mono}
\newfontfamily\headingfont{TeX Gyre Heros}
\newfontfamily\hreffont[Color=cpurple]{TeX Gyre Heros}
\newfontfamily\palefont[Color=cgrey-light]{TeX Gyre Heros}
\newfontfamily\greyfont[Color=cgrey-med]{TeX Gyre Heros}
\newfontfamily\whitefont[Color=FEFEFE]{TeX Gyre Heros}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Karla doesn't have all the emoticons, use Symbola for that block
% but use DejaVU Sans for punctuation classes
\usepackage{ucharclasses}
\newfontfamily\emotifont{Symbola}
\newfontfamily\punctfont{DejaVu Sans}
\setTransitionsForSymbols{\emotifont}{\normalfont}
\setTransitionsForMathematics{\emotifont}{\normalfont}
\setTransitionsForPunctuation{\punctfont}{\normalfont}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{polyglossia}
%\usepackage{bidi}
\setmainlanguage[]{english}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% itemised lists:
%\renewcommand{\labelitemi}{\includegraphics{images/blue-bullet.png}}
\usepackage{enumitem}
\newcommand\bang[1]{\includegraphics[height=8pt]{images/#1-bullet.eps}}
\setlist[itemize]{leftmargin=*}
\setlist[itemize,1]{label={\bang{blue}}}
\setlist[itemize,2]{label={\bang{blue}}}
\setlist[itemize,3]{label={\bang{blue}}}
\setlist[itemize,4]{label={\bang{blue}}}
\setlist[description]
{
  leftmargin=\parindent,
  itemsep=\parindent,
  font=\Large\color{cpurple},
  before=\itshape
}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% columnar layout:
\usepackage[toc]{multitoc}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% toc style
\usepackage{tocloft}
\renewcommand{\cfttoctitlefont}{\LARGE\bfseries\headingfont}

% smaller toc text, [sub]subsections in italic
\renewcommand\cftsecfont{\small}
\renewcommand\cftsecpagefont{\small}
\renewcommand\cftsubsecfont{\small\itshape}
\renewcommand\cftsubsecpagefont{\small}
\renewcommand\cftsubsubsecfont{\small\itshape}
\renewcommand\cftsubsubsecpagefont{\small}

% space the toc out a bit more:
\renewcommand\cftsecafterpnum{\vskip0.25\baselineskip}
\renewcommand\cftsubsecafterpnum{\vskip0.25\baselineskip}
\renewcommand\cftsubsubsecafterpnum{\vskip0.25\baselineskip}

% pull subsections and subsubsections to the same indent level in the toc
\cftsetindents{subsection}{2em}{2em}
\cftsetindents{subsubsection}{2em}{2em}

% page numbers in toc left aligned
\renewcommand{\cftpnumalign}{l}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% header and footer:
\usepackage[a4paper, margin={15mm}, top={19mm}, bottom={21mm}]{geometry}
\usepackage{eso-pic}
\usepackage[export]{adjustbox}
\usepackage{fancyhdr}
\renewcommand{\headrulewidth}{0pt}
% horizontal stripe
\newcommand{\hstripe}[2]{\color{#1}\rule{\paperwidth}{#2}}
% purple URL, 1cm gap, then grey page number followed by a .
\newcommand{\collaborapage}{%
\href{https://www.collabora.com/}{{\hreffont{}www.collabora.com}}%
\hspace{1cm}%
{\greyfont\thepage.}%
}

\newcommand{\banner}{\includegraphics[width=\paperwidth,height=0.33\paperheight]{images/title-banner.jpg}}
\newlength\bannerheight
\setlength\bannerheight{\heightof{\banner}}

\newcommand{\logo}{\includegraphics[width=0.33\paperwidth]{images/collogo-greyscale.eps}}
\newlength\logoheight
\newlength\logowidth
\setlength\logoheight{\heightof{\logo}}
\setlength\logowidth{\widthof{\logo}}

\newcommand{\minlogo}{\includegraphics[valign=M,height=10pt]{images/colicon.eps}}

% the plain style gets used on title pages: override it rather than
% manually choosing a style after creating the title
\fancypagestyle{plain}
{
    \fancyhf{}
    %\addtolength\topmargin{\bannerheight}
    %\addtolength\topmargin{-2.5cm}
    %\addtolength\textheight{-5cm}
    %\fancyhead[L]{\banner}
    \fancyfootoffset[R,L]{1cm}
    \fancyfoot[L]{\hspace{0.2cm}\minlogo}
    \fancyfoot[R]{\collaborapage{}}

    % add the purple stripe at the bottom of the page
    \AddToShipoutPictureBG*
    {
      \AtPageUpperLeft{\raisebox{-\bannerheight}{\banner}}
      \AtPageLowerLeft{\hstripe{cpurple}{0.33cm}}
    }
    \AddToShipoutPictureFG*
    {
      \AtTextUpperLeft{\adjustbox{raise=-0.5\logoheight,lap={\logowidth}{\textwidth-0.92\logowidth}}{\logo}}
    }
}

\fancypagestyle{collabora}
{
    \fancyhf{}
    \fancyfootoffset[R,L]{1cm}
    \fancyfoot[L]{\hspace{0.2cm}\minlogo}
    \fancyfoot[R]{\collaborapage{}}
    % add the purple stripe at the bottom of the page
    \AddToShipoutPictureBG{\AtPageLowerLeft{\hstripe{cpurple}{0.33cm}}}
}

\fancypagestyle{end}
{
    \fancyhf{}
    \fancyfootoffset[R,L]{1cm}
    \fancyfoot[R]{\greyfont\thepage.}
    \AddToShipoutPictureBG*
    {
      \AtPageLowerLeft{\includegraphics{images/blue-bg.png}}
      \AtPageLowerLeft{\hstripe{cgreen}{0.33cm}}
    }
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% section titles
\usepackage{titlesec}
\titleformat*{\section}{\LARGE\bfseries\headingfont}
\titleformat*{\subsection}{\LARGE\bfseries\headingfont}
\titleformat*{\subsubsection}{\Large\bfseries\headingfont}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% misc layout:
% no hanging indent at start of paragraph
\setlength{\parindent}{0pt}
\setlength{\baselineskip}{1.2\baselineskip}
% 1 full blank line between paragraphs
\setlength{\parskip}{1\baselineskip}
% unnumbered sections:
\setcounter{secnumdepth}{0}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{multicol}
% if we need to multiply the default column separation
\setlength\columnsep{2\columnsep}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% URLs
\newcommand{\www}[2]{\href{#1}{\color{cpurple}{#2}}}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% title page (redefine title command, remembering to allow for the bannner):
\makeatletter
\def\authoruri#1{\gdef\@authoruri{#1}}
\def\copyholder#1{\gdef\@copyholder{#1}}
\def\copydates#1{\gdef\@copydates{#1}}
\def\@maketitle{%
  \newpage
  \null
  \vskip \bannerheight
  \vskip -2cm
  {\Huge\bfseries\headingfont\color{cpurple}{\@title}\par}%
  {\Large\headingfont {\color{cgrey-dark}by}
                      {\href{\@authoruri}{\color{cgreen}{\@author}}},
                      {\color{cgrey-dark} \@date\par}}%
  {\large\headingfont Copyright © \@copydates \@copyholder\par}
  \vskip 3.0em%a
  \hrule{}}
\makeatother