-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathheader.tex
92 lines (78 loc) · 2.86 KB
/
header.tex
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
% boxes
\usepackage{mdframed}
\newenvironment{inbox}{\begin{mdframed}\small\setlength{\parskip}{1ex}}{\end{mdframed}}
\newcommand{\newpageon}[1]{\newpage}
\newcommand{\pagebreakon}[1]{\pagebreak}
% make an environment called "abstract" that ignores its contents,
% because the book class does not provide an "abstract" environment
\usepackage{comment}
\excludecomment{abstract}
% do not show leading "Figure n" or "Table n"
\usepackage{caption}
\captionsetup[figure]{labelformat=empty,font=small}
\captionsetup[table]{labelformat=empty}
% to adapt list appearance in "Bibliographic Note"
\usepackage{enumitem}
% set default figure placement to !htbp
\makeatletter
\def\fps@figure{!htbp}
\makeatother
% footnotes with stars
\usepackage{alphalph}
\makeatletter
\newcommand*{\fnsymbolsingle}[1]{\ensuremath{\ifcase#1\or *\else\@ctrerr\fi}}
\makeatother
\newalphalph{\fnsymbolmult}[mult]{\fnsymbolsingle}{}
\renewcommand*{\thefootnote}{\fnsymbolmult{\value{footnote}}}
% reset footnotes after starting a new part (important on page 136)
\makeatletter
\@addtoreset{footnote}{part}
\makeatother
% set font of verbatim environments
% https://tex.stackexchange.com/questions/120633/change-typeface-of-verbatim-environment/120694#120694
\makeatletter
\newcommand{\verbatimfont}[1]{\def\verbatim@font{#1}}%
\makeatother
\verbatimfont{\scriptsize\ttfamily}
% to reset chapters to root (startatroot)
\usepackage{bookmark}
% headers
\usepackage{scrlayer-scrpage}
\clearpairofpagestyles
\lehead{\thepage\ \MakeUppercase{Computers in Spaceflight: The NASA Experience}}
\rohead{\MakeUppercase{\leftmark}\ \thepage}
\setkomafont{pagehead}{\normalfont \scriptsize \bfseries}
%% omit "chapter n: " prefix in front of chapter name in header
%% https://tex.stackexchange.com/questions/228362/get-sectionmark-in-fancyhdr-without-chapter-number/228363#228363
\renewcommand{\chaptermark}[1]{\markboth{#1}{}}
\renewcommand{\partmark}[1]{\markboth{#1}{}}
% indentation of new paragraphs
\setlength{\parindent}{2em}
% space between lines
\linespread{0.8}
% do not "stretch" page content to fill page
\raggedbottom
% for Numberstring
\usepackage{fmtcount}
\RedeclareSectionCommand[
beforeskip=0em
]{part}
\renewcommand*{\partformat}{\partname~\Numberstring{part}:}
\renewcommand*\raggedpart{\raggedright}
\addtokomafont{partnumber}{\normalfont}
\makeatletter
\renewcommand*{\partheadmidvskip}{ }
\renewcommand{\partheadendvskip}{\vskip\@tempskipa\hrule\vspace{1.5em}}
\makeatother
\renewcommand{\partheademptypage}{}
\RedeclareSectionCommand[
innerskip=1em
]{chapter}
\renewcommand*{\chapterformat}{\quad \thechapter}
\addtokomafont{chapter}{\normalfont}
\makeatletter
\renewcommand*{\chapterheadendvskip}{\vskip\@tempskipa\newpage}
\makeatother
\setkomafont{section}{\normalfont\normalsize\bfseries\MakeUppercase}
\setkomafont{subsection}{\normalfont\normalsize\bfseries}
\setkomafont{subsubsection}{\normalfont\bfseries\centering}