-
Notifications
You must be signed in to change notification settings - Fork 8
/
preamble.tex
71 lines (59 loc) · 2.68 KB
/
preamble.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
\usepackage{booktabs}
\usepackage[T1,T2A]{fontenc}
\usepackage{xcolor}
\usepackage{color}
\usepackage{framed}
\definecolor{scrollboxcolor}{HTML}{F9F9F9}
\definecolor{successcolor}{HTML}{DFF2BF}
\definecolor{informationcolor}{HTML}{BDE5F8}
\definecolor{warningcolor}{HTML}{FEEFB3}
\definecolor{errorcolor}{HTML}{FFBABA}
\usepackage{avant}
\usepackage{mathptmx}
\usepackage{microtype} % Slightly tweak font spacing for aesthetics
\usepackage[utf8]{inputenc} % Required for including letters with accents
\usepackage[T1]{fontenc} % Use 8-bit encoding that has 256 glyphs
%----------------------------------------------------------------------------------------
% PAGE HEADERS
%----------------------------------------------------------------------------------------
\usepackage{fancyhdr} % Required for header and footer configuration
\pagestyle{fancy}
\renewcommand{\chaptermark}[1]{\markboth{\sffamily\normalsize\bfseries\chaptername\ \thechapter.\ #1}{}} % Chapter text font settings
\renewcommand{\sectionmark}[1]{\markright{\sffamily\normalsize\thesection\hspace{5pt}#1}{}} % Section text font settings
\fancyhf{} \fancyhead[LE,RO]{\sffamily\normalsize\thepage} % Font setting for the page number in the header
\fancyhead[LO]{\rightmark} % Print the nearest section name on the left side of odd pages
\fancyhead[RE]{\leftmark} % Print the current chapter name on the right side of even pages
\renewcommand{\headrulewidth}{0.5pt} % Width of the rule under the header
\addtolength{\headheight}{2.5pt} % Increase the spacing around the header slightly
\renewcommand{\footrulewidth}{0pt} % Removes the rule in the footer
\fancypagestyle{plain}{\fancyhead{}\renewcommand{\headrulewidth}{0pt}} % Style for when a plain pagestyle is specified
% Removes the header from odd empty pages at the end of chapters
\makeatletter
\renewcommand{\cleardoublepage}{
\clearpage\ifodd\c@page\else
\hbox{}
\vspace*{\fill}
\thispagestyle{empty}
\newpage
\fi}
\DeclareUnicodeCharacter{00A0}{~}
\newenvironment{scrollingbox}{%
\def\FrameCommand{\colorbox{scrollboxcolor}}%
\MakeFramed{\advance\hsize-\width \FrameRestore}}
{\endMakeFramed}
\newenvironment{comment_success}{%
\def\FrameCommand{\colorbox{successcolor}}%
\MakeFramed{\advance\hsize-\width \FrameRestore}}
{\endMakeFramed}
\newenvironment{comment_information}{%
\def\FrameCommand{\colorbox{informationcolor}}%
\MakeFramed{\advance\hsize-\width \FrameRestore}}
{\endMakeFramed}
\newenvironment{comment_warning}{%
\def\FrameCommand{\colorbox{warningcolor}}%
\MakeFramed{\advance\hsize-\width \FrameRestore}}
{\endMakeFramed}
\newenvironment{comment_error}{%
\def\FrameCommand{\colorbox{errorcolor}}%
\MakeFramed{\advance\hsize-\width \FrameRestore}}
{\endMakeFramed}