-
Notifications
You must be signed in to change notification settings - Fork 0
/
GmE300_Thesis.cls
executable file
·160 lines (140 loc) · 5 KB
/
GmE300_Thesis.cls
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
%--------------------------------------------------------------------------
% This 'GmE300_Thesis.cls' class sets the format of the thesis template. To
% use it, instantiate \documentclass{GmE300_Thesis} in 'GmE300_Thesis.tex'
% file. The file 'format.tex' file needs to be supplied, which defines the
% packages needed.
%--------------------------------------------------------------------------
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{GmE300_Thesis}[2017/06/30 GmE 300 Thesis Class]
%--------------------------------------------------------------------------
% Font Size
%--------------------------------------------------------------------------
\newcommand\@thesisptsize{12pt}
\DeclareOption{12pt}{\renewcommand\@thesisptsize{12pt}}
\DeclareOption{11pt}{\renewcommand\@thesisptsize{11pt}}
\DeclareOption{10pt}{\renewcommand\@thesisptsize{10pt}}
\ProcessOptions
\LoadClass[\@thesisptsize,letterpaper,oneside]{book}
\pagestyle{plain}
%--------------------------------------------------------------------------
% Page Setup
%--------------------------------------------------------------------------
% Note: Based on National Graduate School of Engineering Thesis Guidelines
\setlength{\voffset}{-1in}
\setlength{\marginparsep}{0in}
\setlength{\marginparwidth}{0in}
\setlength{\marginparpush}{0in}
\setlength{\parindent}{0.75cm}
\setlength{\hoffset}{-1in}
\setlength{\oddsidemargin}{3.8cm}
\setlength{\evensidemargin}{3.8cm}
\setlength{\textwidth}{15.25cm}
\setlength{\topmargin}{2.54cm}
\setlength{\textheight}{20.32cm}
%\setlength{\headheight}{15pt}
%\setlength{\headsep}{16pt}
%\setlength{\footskip}{18pt}
\renewcommand{\baselinestretch}{1.7} % Line spacing
% \tableofcontents
\makeatletter
\renewcommand\tableofcontents{%
\if@twocolumn
\@restonecoltrue\onecolumn
\else
\@restonecolfalse
\fi
\chapter*{\contentsname
\@mkboth{\contentsname}{\contentsname}}%
\@starttoc{toc}%
\if@restonecol\twocolumn\fi
}
% \listoffigures
\renewcommand\listoffigures{%
\if@twocolumn
\@restonecoltrue\onecolumn
\else
\@restonecolfalse
\fi
\chapter*{\listfigurename
\@mkboth{\listfigurename}{\listfigurename}}%
\@starttoc{lof}%
\if@restonecol\twocolumn\fi
}
% \listoftables
\renewcommand\listoftables{%
\if@twocolumn
\@restonecoltrue\onecolumn
\else
\@restonecolfalse
\fi
\chapter*{\listtablename
\@mkboth{\listtablename}{\listtablename}}%
\@starttoc{lot}%
\if@restonecol\twocolumn\fi
}
% thebibliograph
%\renewenvironment{thebibliography}[1]
% {\chapter*{\bibname
% \@mkboth{\bibname}{\bibname}}%
% \list{\@biblabel{\@arabic\c@enumiv}}%
% {\settowidth\labelwidth{\@biblabel{#1}}%
% \leftmargin\labelwidth
% \advance\leftmargin\labelsep
% \@openbib@code
% \usecounter{enumiv}%
% \let\p@enumiv\@empty
% \renewcommand\theenumiv{\@arabic\c@enumiv}}%
% \sloppy
% \clubpenalty4000
% \@clubpenalty \clubpenalty
% \widowpenalty4000%
% \sfcode`\.\@m}
% {\def\@noitemerr
% {\@latex@warning{Empty `thebibliography' environment}}%
% \endlist}
% bibliography
%\RequirePackage{natbib}
\usepackage[style=authoryear,bibencoding=utf8,minnames=1,maxnames=3, maxbibnames=99,natbib=true,dashed=false,terseinits=true,firstinits=true,uniquename=false,uniquelist=true,labeldate=true,doi=true, isbn=true, natbib=true,backend=biber]{biblatex}
\DeclareFieldFormat{url}{\url{#1}}
\DeclareFieldFormat[article]{pages}{#1}
\DeclareFieldFormat[inproceedings]{pages}{\lowercase{pp.}#1}
\DeclareFieldFormat[incollection]{pages}{\lowercase{pp.}#1}
\DeclareFieldFormat[article]{volume}{\mkbibbold{#1}}
\DeclareFieldFormat[article]{number}{\mkbibparens{#1}}
\DeclareFieldFormat[article]{title}{\MakeCapital{#1}}
\DeclareFieldFormat[article]{url}{}
\DeclareFieldFormat[book]{url}{}
\DeclareFieldFormat[inbook]{url}{}
\DeclareFieldFormat[incollection]{url}{}
\DeclareFieldFormat[inproceedings]{url}{}
\DeclareFieldFormat[inproceedings]{title}{#1}
\DeclareFieldFormat{shorthandwidth}{#1}
% No dot before number of articles
\usepackage{xpatch}
\xpatchbibmacro{volume+number+eid}{\setunit*{\adddot}}{}{}{}
% Remove In: for an article.
\renewbibmacro{in:}{%
\ifentrytype{article}{}{%
\printtext{\bibstring{in}\intitlepunct}}}
% Get rid of months in dates (not sure that this works)
\AtEveryBibitem{\clearfield{month}}
\AtEveryCitekey{\clearfield{month}}
\def\thebibliography#1{\chapter*{\bibname\@mkboth
{{\bibname}}{{\bibname}}}%
\addcontentsline{toc}{chapter}{\bibname}%
\list
{\@biblabel{\arabic{enumiv}}}{\settowidth\labelwidth{\@biblabel{#1}}%
\leftmargin\labelwidth
\advance\leftmargin\labelsep
\usecounter{enumiv}%
\let\p@enumiv\@empty
\def\theenumiv{\arabic{enumiv}}}%
\def\newblock{\hskip .11em plus.33em minus.07em}%
\sloppy\clubpenalty4000\widowpenalty4000
\sfcode`\.=\@m}
\def\endthebibliography{%
\def\@noitemerr{\@warning{Empty `thebibliography' environment}}%
\endlist}
% Input the format.tex file.
% \input format.tex
% \endinput