blob: c2cea2e3269b6335b27cbe75010edc191aa435d0 (
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
|
\ProvidesPackage{starstyle}
%%%%
%% Package for styling the output (primarily in pdf)
%%%%
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Number sections down to subsubsection level
\setcounter{secnumdepth}{4}
% %%% Formatting of the section headging
\newcommand{\colorsection}[1]{%
\colorbox{bblue}{\strut\parbox{\dimexpr\textwidth-2\fboxsep}{\thesection\ \quad #1}{\huge\strut}}}
\newcommand{\colorsectionnumberless}[1]{%
\colorbox{bblue}{\strut\parbox{\dimexpr\textwidth-2\fboxsep}{#1}\strut}}
% % Section headings (including numberless)
\ifpdf
\titleformat{name=\section}%
{\normalfont\Large\bfseries}{}{0pt}{\colorsection}
\titleformat{name=\section,numberless}%
{\normalfont\Large\bfseries}{}{0pt}{\colorsectionnumberless}
\fi
%... Chapter headings
\ifwithchapters
\titleformat{name=\chapter}[display]%
{\normalfont\huge\bfseries\thispagestyle{plain}}{%
\chaptertitlename\ \thechapter}{0pt}{}
\titleformat{name=\chapter,numberless}[display]%
{\normalfont\huge\bfseries\thispagestyle{plain}}{}{0pt}{\Huge}
%... spacing after chapter headings
\titlespacing*{\chapter}{0pt}{0pt}{20pt}
\fi
%.. section spacing
\titlespacing*{\section}{0pt}{3.5ex plus 1ex minus .2ex}{2.3ex plus .2ex}
\titlespacing*{\subsection}{0pt}{2ex plus 1ex minus .2ex}{1.5ex plus .2ex}
\titlespacing*{\subsubsection}{0pt}{2ex plus 1ex minus .2ex}{1ex plus .2ex}
\titlespacing*{\paragraph}{0pt}{2ex plus 1ex minus .2ex}{1em}
\titlespacing*{\subparagraph}{\parindent}{2ex plus 1ex minus
.2ex}{1em}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Page styles (e.g. headers and footers)
\pagestyle{fancy}
\fancyhf{}
\rhead{\slshape \thestardocinitials{}/\thestardocnumber{} \leftmark}
\lhead{\thepage}
\renewcommand{\headrulewidth}{0.0pt}
\ifwithchapters
\renewcommand{\chaptermark}[1]{
\markboth{#1}{}}
\else
\renewcommand{\sectionmark}[1]{
\markboth{#1}{}}
\fi
% .. Reset the plain pagestyle (used on chapter pages) to only have
% the page number and no rules.
\fancypagestyle{plain}{%
\fancyhf{}%
\iftwoside
\fancyhead[RE,LO]{\thepage}%
\fancyhead[LE,RO]{\slshape
\thestardocinitials{}/\thestardocnumber{}\nouppercase{---\leftmark}}%
\else
\fancyhead[LO]{\thepage}
\fancyhead[RO]{\slshape
\thestardocinitials{}/\thestardocnumber{}\nouppercase{---\leftmark}}%
\fi
\renewcommand{\headrulewidth}{0pt}%
\renewcommand{\footrulewidth}{0pt}%
}
% ensure correct chaptermakr is used when in pagestyle plain
\pagestyle{plain}
\fancyhf{}
\iftwoside
\fancyhead[LE,RO]{\slshape \thestardocinitials{}/\thestardocnumber{} \nouppercase{---\leftmark}}
\fancyhead[RE,LO]{\thepage}
\else
\lhead{\slshape \thestardocinitials{}/\thestardocnumber{} \nouppercase{---\leftmark}}
\rhead{\thepage}
\fi
\renewcommand{\headrulewidth}{0.0pt}
\ifwithchapters
\renewcommand{\chaptermark}[1]{
\markboth{#1}{}}
\else
\renewcommand{\sectionmark}[1]{
\markboth{#1}{}}
\fi
\renewcommand{\headrulewidth}{0pt}%
\renewcommand{\footrulewidth}{0pt}%
\ifwithchapters
\renewcommand{\chaptermark}[1]{\markboth{{#1}}{}}%
\else
\renewcommand{\sectionmark}[1]{\markboth{{#1}}{}}%
\fi
%% Select the fancy pagestyle as default
\pagestyle{fancy}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% General spacing
\setlength{\headheight}{1.5cm}
\setlength{\parskip}{\medskipamount}
\setlength{\parindent}{0pt}
\renewcommand{\arraystretch}{1.5}
%%%% Set up defaults for floats
% maximum size of 'top area'
\renewcommand{\topfraction}{0.9}
% maximum size of 'bottom area'
\renewcommand{\bottomfraction}{0.9}
% minimum amount of text on a non-float page
\renewcommand{\textfraction}{0.1}
%Enumerate list appearance
\setlist[enumerate,1]{label=(\arabic*)}
% macros for typesetting parameters
\providecommand{\aparam}[1]{\texttt{#1}} % ADAM parameter
\providecommand{\cparam}[1]{\texttt{#1}} % CONFIG parameter
\providecommand{\ndfcomp}[1]{\texttt{#1}} % NDF component
\newcommand{\menuitem}[2]{\item[\protect{\hyperref[#1]{#1}}] #2}
\newcommand{\classitem}[1]{\item [\protect{\hyperref[#1]{#1}}]}
|