-
Notifications
You must be signed in to change notification settings - Fork 9
/
phdthesis.sty
165 lines (143 loc) · 5.59 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
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
163
164
165
%%
%% 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
\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\footnotesize \rightmark}
%% make the even pages have the chapter name on the top left
\fancyhead[LE]{\sffamily\bfseries\footnotesize \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\footnotesize \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\footnotesize \thepage}}}}}
%% make the bottom line above the page number box
\renewcommand{\footrulewidth}{0.4pt}
\renewcommand{\footruleskip}{0mm}
\pagestyle{fancy}
\RequirePackage{eso-pic}
\RequirePackage{ifthen}
\def\pageLang{none}
\def\withPageBkg{false}
\makeatletter
\AddToShipoutPicture{%
\ifthenelse{\equal{\withPageBkg}{true}}{%
\begin{tikzpicture}[remember picture, overlay]%
\node[inner sep=0pt,opacity=0.15] at (current page.center) {%
\includegraphics[width=\paperwidth,height=\paperheight]{resources/images/paper2}%
};%
\end{tikzpicture}%
} % End if
\ifthenelse{\equal{\pageLang}{c}}{
\ifodd \value{page} {
\begin{tikzpicture}[remember picture, overlay]
\node[c-mybox,minimum height=0.66\textheight,minimum width=1cm] (box) at (current page.east)
{};% % end
\node[c-fancytitle,rotate=-90,minimum width=0.21\textheight,rounded corners] at (box.west) {\texttt{C++ Reference}};
\end{tikzpicture}%
} \else { %
\begin{tikzpicture}[remember picture, overlay]
\node[c-mybox,minimum height=0.66\textheight,minimum width=1cm] (box) at (current page.west)
{};% % end
\node[c-fancytitle,rotate=90,minimum width=0.21\textheight,rounded corners] at (box.east) {\texttt{C++ Reference}};
\end{tikzpicture}%
}% End ifodd
\fi
}% End C if
{
\ifthenelse{\equal{\pageLang}{pas}}{
\ifodd \value{page} {
\begin{tikzpicture}[remember picture, overlay]
\node[pas-mybox,minimum height=0.66\textheight,minimum width=1cm] (box) at (current page.east)
{};% % end
\node[pas-fancytitle,rotate=-90,minimum width=0.21\textheight,rounded corners] at (box.west) {\texttt{Pascal Reference}};
\end{tikzpicture}%
} \else { %
\begin{tikzpicture}[remember picture, overlay]
\node[pas-mybox,minimum height=0.66\textheight,minimum width=1cm] (box) at (current page.west)
{};% % end
\node[pas-fancytitle,rotate=90,minimum width=0.21\textheight,rounded corners] at (box.east) {\texttt{Pascal Reference}};
\end{tikzpicture}%
}% End ifodd
\fi
}{}
}
}%
\makeatother
%% 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}{0.5pt}
}
% code pages have no headers or footers to allow full page code
\fancypagestyle{codepage}{
\fancyhf{}
\fancyfoot{}
\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]}]
%%
%% End of file `phdthesis.sty`