-
Notifications
You must be signed in to change notification settings - Fork 0
/
hydroheadings.sty
executable file
·87 lines (74 loc) · 2.84 KB
/
hydroheadings.sty
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
%% hydroheadings.sty
%% Headings setup
%% This file is part of the Hydro Thesis package for creating PhD theses
%% Author: Robin Schwemmle ([email protected])
%% File encoding: ASCII
\ProvidesPackage{hydroheadings}[2017/11/04]
\RequirePackage{fancyhdr}
\RequirePackage[sf,raggedright]{titlesec} % use sans serif for chapter/section headings
\titleformat{\chapter}[block]{\sffamily\huge}{\thechapter}{1em}{}
\titlespacing{\chapter}{0pt}{12pt}{1cm}
% \@ifundefined{chapter}%
% {}%
% {\renewcommand{\chaptermark}[1]{%
% \ifthenelse{\value{chapter} < 1}%
% {\markboth{#1}{}}%
% {\markboth{\thechapter.\ #1}{}}
% }}
\addtolength{\headheight}{\baselineskip}
\fancypagestyle{title}{%
\fancyhf{} % clear all header and footer fields
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
}
\fancypagestyle{front}{%
\fancyhf{} % clear all header and footer fields
\fancyfoot[C]{\thepage}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
}
\fancypagestyle{main}{%
\fancyhf{} % clear all header and footer fields
\renewcommand{\chaptermark}[1]{\markboth{##1}{}}
\renewcommand{\sectionmark}[1]{\markright{}}
% \fancyhead[LO]{%
% % We want italics
% % The chapter title only if it's greater than 0
% \ifnum\value{chapter}>0\slshape\sffamily\nouppercase{\leftmark} \fi
% }
\fancyhead[LE]{}
\fancyhead[RO]{%
% We want italics
% The chapter title only if it's greater than 0
\ifnum\value{chapter}>0\slshape\sffamily\nouppercase{\leftmark} \fi
}
\fancyfoot[RO, LE]{\thepage}
\ifthenelse{\value{chapter}>-1}{\renewcommand{\headrulewidth}{0.4pt}}{\renewcommand{\headrulewidth}{0pt}}
\renewcommand{\footrulewidth}{0pt}
}
% table of contents title
\addto\captionsenglish{% Replace "english" with the language you use
\renewcommand{\contentsname}%
{Table of Content}%
}
%% Setup for headings (title, toc, abstract) for hydro* classes only ------------
\makeatletter%
\@ifclassloaded{hydrothesis}{%
\RequirePackage[titles]{tocloft}%
\renewcommand{\cftchapfont}{\normalfont\sffamily}
\renewcommand{\cftsecfont}{\normalfont\sffamily}
\renewcommand{\cftsubsecfont}{\normalfont\sffamily}
\renewcommand\cftchappagefont{\normalfont\sffamily}
\renewcommand\cftsecpagefont{\normalfont\sffamily}
\renewcommand\cftsubsecpagefont{\normalfont\sffamily}
\renewcommand\l@figure{\@dottedtocline{1}{1.5em}{4em}} % spacings between number and text
\renewcommand\l@table{\@dottedtocline{1}{1.5em}{4em}}
\renewcommand\l@Afigure{\@dottedtocline{1}{1.5em}{4em}}
\renewcommand\l@Atable{\@dottedtocline{1}{1.5em}{4em}}
}{}%
\makeatother%
\cftsetpnumwidth{3em}
\newcommand{\stoptocwriting}{%
\addtocontents{toc}{\protect\setcounter{tocdepth}{-5}}}
\newcommand{\resumetocwriting}{%
\addtocontents{toc}{\protect\setcounter{tocdepth}{\arabic{tocdepth}}}}