-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathphdthesis.sty
108 lines (93 loc) · 3.58 KB
/
phdthesis.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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
%%
%% This is file `phdthesis.sty`,
%%
%% This style file changes the appearance of the pages to improve
%% the aesthetics of PhD theses (in my opinion =)
%%
%% Copyright (C) 2007 Jamie Stevens
%%
%%
%% This program is free software: you can redistribute it and/or modify
%% it under the terms of the GNU General Public License as published by
%% the Free Software Foundation, either version 3 of the License, or
%% (at your option) any later version.
%%
%% This program is distributed in the hope that it will be useful,
%% but WITHOUT ANY WARRANTY; without even the implied warranty of
%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
%% GNU General Public License for more details.
%%
%% You should have received a copy of the GNU General Public License
%% along with this program. If not, see <http://www.gnu.org/licenses/>.
%%
\NeedsTeXFormat{LaTeX2e}[1994/06/01]
\ProvidesPackage{phdthesis}[2007/09/11 v1.0 PhD Thesis Style]
%% change the equation number appearance
%% load up the AMS math package
\RequirePackage{amsmath}
%% load up the fancy box making package
\setcounter{secnumdepth}{4}
\RequirePackage{fancybox}
%% make the equation numbers have little ovals around them
\def\tagform@#1{\maketag@@@{\cornersize{0.8}\ovalbox{\ignorespaces\sffamily{#1}\unskip\@@italiccorr}}}
%% Load up PS insertion package
\RequirePackage{psboxit}
\PScommands
%% Load up fancy headers and footers package
\RequirePackage{fancyhdr}
%% now reset the headers and footers
\fancyhead{}
\fancyfoot{}
%% make the odd pages have the section name on the top right
\fancyhead[RO]{\sffamily\bfseries \rightmark}
%% make the even pages have the chapter name on the top left
\fancyhead[LE]{\sffamily\bfseries \leftmark}
%% put the page numbers on the bottom in a nice box
%% even side pages
\fancyfoot[LE]{\psboxit{box 0.8 setgray fill}
{\framebox[10mm][c]{\rule{0cm}{4mm}\color{black}{\bfseries \thepage}}}}
%% odd side pages
\fancyfoot[RO]{\psboxit{box 1 setgray fill}
{\hspace{\textwidth}\psboxit{box 0.8 setgray fill}
{\framebox[10mm][c]{\rule{0cm}{4mm}\color{black}{\bfseries \thepage}}}}}
%% make the bottom line above the page number box
\renewcommand{\footrulewidth}{0pt}
\renewcommand{\footruleskip}{0mm}
%% bring the style into effect
\pagestyle{fancy}
\addtolength{\headwidth}{22mm}
%\setlength{\headwidth}{\textwidth}
%% now redefine the plain style pages (chapter pages, contents pages)
%% to have the same page number stuff on the bottom
\fancypagestyle{plain}{
\fancyhf{}
\fancyfoot[RO]{\psboxit{box 1 setgray fill}
{\hspace{\textwidth}\psboxit{box 0.8 setgray fill}
{\framebox[10mm][c]{\rule{0cm}{4mm}\color{black}{\bfseries \thepage}}}}}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
}
%% this next section (till \makeatother) makes sure that blank pages
%% are actually completely blank, cause they're not usually
\makeatletter
\def\cleardoublepage{\clearpage\if@twoside \ifodd\c@page\else
\hbox{}
\vspace*{\fill}
\thispagestyle{empty}
\newpage
\if@twocolumn\hbox{}\newpage\fi\fi\fi}
\makeatother
%% now change the chapter style
%% load up the quotchap package
\RequirePackage[avantgarde]{quotchap}
%% make the quotation appear next to the chapter number
\renewcommand\chapterheadstartvskip{\vspace*{-5\baselineskip}}
%% now change the section heading to have a line beneath it
%% load up the fancy title-style package
\RequirePackage[calcwidth]{titlesec}
\titleformat{\section}[hang]{\sffamily\bfseries}
{\Large\thesection}{12pt}{\Large}[{\titlerule[0.5pt]}]
\titleformat{\subsection}[hang]{\sffamily\bfseries}
{\thesubsection}{12pt}{}[{\titlerule[0.5pt]}]
%%
%% End of file `phdthesis.sty`