Advertisement
Guest User

Untitled

a guest
Apr 3rd, 2017
518
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 23.94 KB | None | 0 0
  1. %%
  2. %% File : infthesis.cls (LaTeX2e class file)
  3. %% Author : Version 3.6 by Charles Sutton <csutton@inf.ed.ac.uk>
  4. %% Version 3.5 by Vasilis Vasaitis <v.vasaitis@sms.ed.ac.uk>
  5. %% Version 3.4.1 updated by Tiejun Ma (t.j.ma@ed.ac.uk)
  6. %% Version 3.0 by Mary Ellen Foster <mef@cogsci.ed.ac.uk>
  7. %% Original version by Martin Reddy (mxr@dcs.ed.ac.uk)
  8. %% Version : 3.6
  9. %% Updates : 1.0 [9/11/95] - initial release.
  10. %% 1.1 [24/4/96] - fixed bibliography bug caused by new report.cls
  11. %% 1.2 [13/5/96] - \dedication & \thesiscaption[]
  12. %% 1.3 [28/5/96] - abbrevs, parskip, minitoc fix, \headfootstyle
  13. %% 1.4 [12/7/96] - appendices okay now, \cleardoublepage's added
  14. %% 1.45 [6/8/96] - added space between chapter & numb on toc
  15. %% 1.5 [13/8/96] - tailmargin was too small by 0.7cm!!
  16. %% 2.0 [20/9/96] - \SetPrinter for margin settings (default=hp24)
  17. %% no header, more abbreviations
  18. %% 3.0 [16/10/2000] - Changed name and some formatting to become
  19. %% "infthesis" instead
  20. %% 3.1 [20/10/2000] - Added sans-serif running heads
  21. %% Added pslatex by default (unless "cmfonts")
  22. %% Added back in the code to create empty pages
  23. %% on cleardoublepage (from titlesec.sty)
  24. %% 3.2 [13/11/2000] - Changed name of font-setting commands
  25. %% - Changed name of shield input file
  26. %% 3.3 [23/11/2000] - Use the new and improved shield graphic
  27. %% 3.4 [23/11/2000] - Political changes... also fixed a problem
  28. %% with the margins on two-sided documents.
  29. %% 3.4.1[09/03/2006] -add [a4paper] parameter for geometry package
  30. %% 3.5 [02/02/2011] - fix double-sided margins with modern
  31. %% versions of the geometry package
  32. %% 3.6 [15/03/2012] - addition to support the MInf degree
  33.  
  34.  
  35. %% This file contains a class definition, infthesis, for the LaTeX2e
  36. %% system which defines the layout of theses which are submitted in
  37. %% the School of Informatics at the University of Edinburgh.
  38. %%
  39. %% For information on this class, please refer to "texdoc infthesis"
  40. %%
  41.  
  42. \NeedsTeXFormat{LaTeX2e}[1994/12/01]
  43. \ProvidesClass{infthesis}[2011/02/02 v3.5 School of Informatics Thesis Class]
  44.  
  45.  
  46. %%
  47. %% --- Initial Code ---
  48. %%
  49.  
  50. %% Required packages:
  51. %% - ifthen for conditionals
  52. %% - geometry for margin-setting
  53. %% - graphics for including the (scaled) logo on the front page
  54. %% - xspace if abbreviations are used
  55. \usepackage[paper=a4paper]{geometry}
  56. \RequirePackage{ifthen,%
  57. graphics,%
  58. xspace,
  59. styles/eushield}
  60.  
  61.  
  62. %%%% The following packages are also used but are included further on rather
  63. %%%% than here, either because their options depend on the class options or
  64. %%%% because they only need to be loaded in certain cases.
  65. %% - parskip for alternate formatting of paragraphs
  66. %% - tocbibind to put LOF and LOT into table of contents
  67. %% - sectsty to change format of section headers
  68. %% - caption to change format of captions
  69. %% - pslatex to set default fonts (if they don't specify notimes)
  70.  
  71. %% Default values for various fields
  72. \newcommand{\@degreetext}{}
  73. \newcommand{\@infschool}{School of Informatics}
  74. \newcommand{\@university}{University of Edinburgh}
  75. \newcommand{\@chapteralignment}{\centering}
  76. \newcommand{\@chapterfont}{}
  77. \newcommand{\@thesisside}{}
  78. \newcommand{\@thesisopen}{}
  79. \newcommand{\@thesispoints}{}
  80. \newcommand{\@draftmessage}{}
  81.  
  82. %% Lots of boolean things to keep track of options
  83. \newboolean{draftthesis}
  84. \newboolean{usequotemarks}
  85. \newboolean{usesinglespacing}
  86. \newboolean{usedoublespacing}
  87. \newboolean{usefullspacing}
  88. \newboolean{usedeptreport}
  89. \newboolean{useabbrevs}
  90. \newboolean{sansheadings}
  91. \newboolean{ltoc}
  92. \newboolean{romanpre}
  93. \newboolean{logo}
  94. \newboolean{frontabs}
  95. \newboolean{strict}
  96. \newboolean{timesfonts}
  97.  
  98. %% Choose the monochrome crest for the front page (if crests used)
  99. \shieldtype{0}
  100.  
  101. %%
  102. %% --- Options ---
  103. %%
  104. %% Current options: phd, mphil, msc, mscres, bsc
  105. %% deptreport
  106. %% draft
  107. %% usequotes
  108. %% singlespacing, doublespacing, fullspacing
  109. %% cent{er,re}chapter, leftchapter, rightchapter,
  110. %% + all report.cls options
  111. %%
  112.  
  113. %% Commands to set course and project (for 4th year -- too many possibilities
  114. %% to use options).
  115. \let\@course\@empty
  116. \newcommand{\course}[1]{\gdef\@course{#1}}
  117. \newcommand{\@project}{Fourth Year Project Report}
  118. \newcommand{\project}[1]{\gdef\@project{#1}}
  119.  
  120. %% Options to specify school and/or degree
  121. % MSc degree: default is Informatics
  122. \let\@mscdegree\@empty
  123. \DeclareOption{cogsci}{\gdef\@mscdegree{Cognitive Science and Natural Language
  124. Processing}}
  125. \DeclareOption{cs}{\gdef\@mscdegree{Computer Science}}
  126. \DeclareOption{ai}{\gdef\@mscdegree{Artificial Intelligence}}
  127.  
  128. % Institute
  129. \let\@institute\@empty
  130. \DeclareOption{aiai}{\gdef\@institute{Artificial Intelligence
  131. Applications Institute}}
  132. \DeclareOption{cisa}{\gdef\@institute{Centre for Intelligent Systems
  133. and their Applications}}
  134. \DeclareOption{icsa}{\gdef\@institute{Institute of Computing Systems
  135. Architecture}}
  136. \DeclareOption{ianc}{\gdef\@institute{Institute for Adaptive and
  137. Neural Computation}}
  138. \DeclareOption{ilcc}{\gdef\@institute{Institute for Language, Cognition and
  139. Computation}}
  140. \DeclareOption{ipab}{\gdef\@institute{Institute of Perception, Action
  141. and Behaviour}}
  142. \DeclareOption{lfcs}{\gdef\@institute{Laboratory for Foundations of
  143. Computer Science}}
  144.  
  145. % Degree
  146. \def\@researchdegree#1{%
  147. \renewcommand{\@degreetext}{#1 \\
  148. \ifx\@empty\@institute
  149. \PackageWarning{infthesis}{No institute specified for research
  150. degree}
  151. \else
  152. \@institute \\
  153. \fi
  154. \@infschool \\ \@university}
  155. \setboolean{strict}{true}}
  156. \DeclareOption{phdproposal}{\@researchdegree{PhD Proposal}}
  157. \DeclareOption{phd}{\@researchdegree{Doctor of Philosophy}}
  158. \DeclareOption{mphil}{\@researchdegree{Master of Philosophy}}
  159. \DeclareOption{mscres}{\@researchdegree{Master of Science by Research}}
  160.  
  161. \def\@taughtdegree#1#2{%
  162. \renewcommand{\@degreetext}{#1 \\
  163. \ifx\@empty#2
  164. % \PackageWarning{infthesis}{No course/school specified for taught
  165. % degree}
  166. \else
  167. #2 \\
  168. \fi
  169. \@infschool \\ \@university}%
  170. \setboolean{strict}{false}}
  171. \DeclareOption{msc}{\@taughtdegree{Master of Science}{\@mscdegree}}
  172. \DeclareOption{minf}{\@taughtdegree{Master of Informatics}{~}}
  173. \DeclareOption{bsc}{\@taughtdegree{\@project}{\@course}}
  174.  
  175. %% Chapter header alignment, font of headings
  176. \DeclareOption{centerchapter,centrechapter}
  177. {\renewcommand{\@chapteralignment}{\centering}}
  178. \DeclareOption{leftchapter}
  179. {\renewcommand{\@chapteralignment}{\raggedright}}
  180. \DeclareOption{rightchapter}
  181. {\renewcommand{\@chapteralignment}{\raggedleft}}
  182. \DeclareOption{sansheadings}{%
  183. \setboolean{sansheadings}{true}}
  184. \DeclareOption{normalheadings}{%
  185. \setboolean{sansheadings}{false}}
  186.  
  187. %% Sidedness, openright-ness, and font size (so that the draft option can
  188. %% override them as needed.
  189. \DeclareOption{twoside}{\renewcommand{\@thesisside}{twoside}}
  190. \DeclareOption{oneside}{\renewcommand{\@thesisside}{oneside}}
  191. \DeclareOption{openany}{\renewcommand{\@thesisopen}{openany}}
  192. \DeclareOption{openright}{\renewcommand{\@thesisopen}{openright}}
  193. \DeclareOption{10pt}{\renewcommand{\@thesispoints}{10pt}}
  194. \DeclareOption{11pt}{\renewcommand{\@thesispoints}{11pt}}
  195. \DeclareOption{12pt}{\renewcommand{\@thesispoints}{12pt}}
  196.  
  197. %% Font options.
  198. \DeclareOption{notimes}{\setboolean{timesfonts}{false}}
  199. \DeclareOption{timesfonts}{\setboolean{timesfonts}{true}}
  200.  
  201. %% Whether it's a draft (if so, single space and wider margins to fit more)
  202. \DeclareOption{draft}{
  203. \setboolean{draftthesis}{true}
  204. \ExecuteOptions{10pt,openany,twoside}
  205. \renewcommand{\@draftmessage}{(Draft Copy)}}
  206.  
  207. %% Use quotation marks in quotation environment?
  208. \DeclareOption{usequotes}{\setboolean{usequotemarks}{true}}
  209.  
  210. %% Use useful abbrevations?
  211. \DeclareOption{abbrevs}{\setboolean{useabbrevs}{true}}
  212.  
  213. %% Select spacing (default: fullspacing)
  214. \DeclareOption{singlespacing}{\setboolean{usesinglespacing}{true}}
  215. \DeclareOption{doublespacing}{\setboolean{usedoublespacing}{true}}
  216. \DeclareOption{fullspacing}{\setboolean{usefullspacing}{true}}
  217.  
  218. %% Options to control the format of the cover page
  219. \DeclareOption{deptreport}{\setboolean{usedeptreport}{true}}
  220. \DeclareOption{logo}{%
  221. \setboolean{logo}{true}}
  222. \DeclareOption{frontabs}{%
  223. \setboolean{frontabs}{true}}
  224.  
  225. %% Use parskip formatting of paragraphs
  226. \DeclareOption{parskip}{\AtEndOfClass{\RequirePackage{parskip}}}
  227.  
  228. %% Whether to put list of figures and tables into TOC (default: no)
  229. \DeclareOption{listsintoc}{%
  230. \setboolean{ltoc}{true}}
  231.  
  232. %% Pre pages can be numbered separately or with the rest of the thesis.
  233. \DeclareOption{romanprepages}{\setboolean{romanpre}{true}}
  234. \DeclareOption{plainprepages}{\setboolean{romanpre}{false}}
  235.  
  236. %% Pass all other options directly to report class
  237. \DeclareOption*{\PassOptionsToClass{\CurrentOption}{report}}
  238.  
  239. %% Set default options and process the ones we were given.
  240. \ExecuteOptions{phd,centerchapter,romanprepages,%
  241. sansheadings,openright,oneside,12pt,timesfonts}
  242. \ProcessOptions
  243.  
  244. %%
  245. %% --- Class Loading (built ontop of report.cls) ---
  246. %%
  247.  
  248. \LoadClass[a4paper,\@thesispoints,\@thesisside,\@thesisopen]{report}
  249. \ifthenelse{\boolean{draftthesis}}
  250. {}
  251. {\ifthenelse{\boolean{strict}}
  252. {\if@twoside
  253. \if@openright
  254. \else
  255. \PackageWarning{infthesis}{A two-sided PhD or MPhil thesis must
  256. not use the "openany" option}
  257. \fi
  258. \fi}
  259. {}}
  260.  
  261. %%
  262. %% --- Main Code ---
  263. %%
  264.  
  265. \newboolean{isspecialchapter}
  266. \setboolean{isspecialchapter}{false}
  267.  
  268. %%
  269. %% First we will sort out the page layout. The following is a brief
  270. %% summary of the university typesetting regulations:
  271. %% Printed on A4 paper, entirely on rectos (single-sided) or on both sides
  272. %% but with chapters starting on even pages
  273. %% 4cm binding margin
  274. %% 2cm head margin
  275. %% 2.5cm fore-edge margin
  276. %% 4cm tail margin
  277. %% spacing: not less then 1.5 spacing (18pt leading)
  278. %% quotations & footnotes in single spacing
  279. %% bibliography may be in single spacing
  280. %% character size: not exceed 12pt for body text (at least 10pt)
  281. %% style: a serif font should be used, with a sans-serif for headings
  282. %% hyphenation should be avoided if possible
  283.  
  284. %% Try to set up the margins according to the specifications in the thesis
  285. %% regulations. I have removed all of the old code (ca. 1996) that attempted
  286. %% to compensate for particular printers in the Department of Computer
  287. %% Science.
  288. \ifthenelse{\boolean{draftthesis}}
  289. {\geometry{a4paper,margin=2cm,twoside}}
  290. {\if@twoside
  291. \geometry{a4paper,left=4cm,top=2cm,right=2.5cm,bottom=4cm,twoside}
  292. \else
  293. \geometry{a4paper,left=4cm,top=2cm,right=2.5cm,bottom=4cm}
  294. \fi}
  295.  
  296. %% We should make pages created by "cleardoublepage" be
  297. %% really empty. Taken from titlesec.sty
  298.  
  299. \def\cleardoublepage{%
  300. \clearpage{\ps@empty\if@twoside\ifodd\c@page\else
  301. \hbox{}\newpage\if@twocolumn\hbox{}\newpage\fi\fi\fi}}
  302.  
  303. %%
  304. %% Hack to make minitoc work with csthesis. We declare a new chapter
  305. %% variable called starchapter to be used by \addcontentsline when we
  306. %% add contents lines for List of Figures/Tables. If we don't, then
  307. %% minitoc treats the LOF/LOT sections as chapters of the thesis.
  308. %%
  309.  
  310. \@ifundefined{chapter}{}{\let\l@starchapter\l@chapter}
  311.  
  312. %%
  313. %% This bit will set up the header format for the thesis.
  314. %% This currently uses a "headings" style showing the pagenumber
  315. %% and chapter number/title. (in slanted text) If the document is two-sided,
  316. %% the right-hand page will show the section number and title instead.
  317. %%
  318.  
  319. \newcommand{\headfootstyle}{\normalsize} % font size of headers and footers
  320. % This will have \sffamily added to it if "sansheadings" is specified.
  321.  
  322. %% Set up different headers for right and left-hand pages. Those \defs are a
  323. %% bit magic, but they seem to do the trick... :-)
  324. %% Adapted from Francois Pitt's ut-thesis class from the University of
  325. %% Toronto.
  326. \if@twoside % if two-sided printing
  327. \renewcommand{\ps@headings}{
  328. \let\@mkboth\markboth
  329. \def\@oddfoot{}
  330. \let\@evenfoot\@oddfoot
  331. \def\@oddhead{{\headfootstyle\itshape \rightmark}\hfil \headfootstyle\thepage}%
  332. \def\@evenhead{\headfootstyle\thepage\hfil
  333. {\headfootstyle\itshape\leftmark}}%
  334. \def\chaptermark##1{\markboth
  335. {\ifnum\c@secnumdepth >\m@ne
  336. \@chapapp\ \thechapter. \ \fi ##1}{}}%
  337. \def\sectionmark##1{\markright
  338. {\ifnum\c@secnumdepth >\z@
  339. \thesection. \ \fi ##1}}%
  340. }%ps@headings
  341. \else % if one-sided printing
  342. \renewcommand{\ps@headings}{
  343. \let\@mkboth\markboth
  344. \def\@oddfoot{}
  345. \def\@oddhead{{\headfootstyle\itshape\rightmark}\hfil
  346. \headfootstyle\thepage}%
  347. \def\chaptermark##1{\markright
  348. {\ifnum\c@secnumdepth >\m@ne
  349. \@chapapp\ \thechapter. \ \fi ##1}}%
  350. }%ps@headings
  351. \fi%@twoside
  352.  
  353. \renewcommand{\ps@plain}{
  354. \renewcommand{\@oddfoot}{\hfil\headfootstyle\thepage\hfil}
  355. \renewcommand{\@evenfoot}{\hfil\headfootstyle\thepage\hfil}
  356. \renewcommand{\@evenhead}{}
  357. \renewcommand{\@oddhead}{}
  358. }
  359.  
  360. %%
  361. %% And now setup that headings style as default
  362. %%
  363.  
  364. \newcommand{\@textpagenumbering}{arabic}
  365. \newcommand{\@preamblepagenumbering}{roman}
  366. \newcommand{\@textpagestyle}{headings}
  367. \newcommand{\@preamblepagestyle}{plain}
  368.  
  369. \pagestyle{\@textpagestyle}
  370.  
  371. \setcounter{secnumdepth}{6}
  372.  
  373. %%
  374. %% Set up the default names for the various chapter headings
  375. %%
  376.  
  377. \renewcommand{\contentsname}{Table of Contents}
  378. \renewcommand{\listfigurename}{List of Figures}
  379. \renewcommand{\listtablename}{List of Tables}
  380. \renewcommand{\bibname}{Bibliography}
  381. \renewcommand{\indexname}{Index}
  382. \renewcommand{\abstractname}{Abstract}
  383.  
  384. %%
  385. %% Some sundry commands which are generally useful...
  386. %%
  387.  
  388. \ifthenelse{\boolean{useabbrevs}}
  389. {\newcommand{\NB}{N.B.\@\xspace}
  390. \newcommand{\eg}{e.g.\@\xspace}
  391. \newcommand{\Eg}{E.g.\@\xspace}
  392. \newcommand{\ie}{i.e.\@\xspace}
  393. \newcommand{\Ie}{I.e.\@\xspace}
  394. \newcommand{\etc}{etc.\@\xspace}
  395. \newcommand{\etal}{{\em et al}.\@\xspace}
  396. \newcommand{\etseq}{{\em et seq}.\@\xspace}
  397. \newcommand{\precis}{pr\'ecis\xspace}
  398. \newcommand{\Precis}{Pr\'ecis\xspace}
  399. \newcommand{\role}{r\^ole\xspace}
  400. \newcommand{\Role}{R\^ole\xspace}
  401. \newcommand{\naive}{na\"\i ve\xspace}
  402. \newcommand{\Naive}{Na\"\i ve\xspace}
  403. \newcommand{\tm}{\raisebox{1ex}{\tiny TM}\xspace}
  404. \newcommand{\cpright}{\raisebox{1ex}{\tiny\copyright}\xspace}
  405. \newcommand{\degrees}{\raisebox{1.2ex}{\tiny\ensuremath{\circ}}\xspace}}
  406. {}
  407.  
  408. %%
  409. %% Set up the double spacing and provide commands to alter the
  410. %% spacing for the subsequent text. By default, 1.5 spacing will be
  411. %% used. This can be modified through the singlespacing, doublespacing
  412. %% or draft class options.
  413. %%
  414.  
  415. \newcommand{\doublespace}{%
  416. \renewcommand{\baselinestretch}{1.66}\normalsize}
  417. \newcommand{\oneandahalfspace}{%
  418. \renewcommand{\baselinestretch}{1.33}\normalsize}
  419. \newcommand{\singlespace}{%
  420. \renewcommand{\baselinestretch}{1}\normalsize}
  421.  
  422. \ifthenelse{\boolean{draftthesis}}
  423. {\AtBeginDocument{\singlespace}}% \SetPrinterDraft}
  424. {\ifthenelse{\boolean{usesinglespacing}}
  425. {\AtBeginDocument{\singlespace}%
  426. \ifthenelse{\boolean{strict}}
  427. {\PackageWarning{infthesis}{Single spacing is not permitted in the
  428. regulations for PhD and MPhil theses}}
  429. {}}
  430. {\ifthenelse{\boolean{usedoublespacing}}
  431. {\AtBeginDocument{\doublespace}}
  432. {\AtBeginDocument{\oneandahalfspace}}
  433. }
  434. }
  435.  
  436. %%
  437. %% We must ensure that the thesis ends on a lef-hand page. We
  438. %% do the latter by issuing a \cleardoublepage at the end of document.
  439. %% MEF: deleted this, there's no point -- it'll print the other side of that
  440. %% page anyway!
  441. %%
  442.  
  443. % \AtEndDocument{\cleardoublepage}
  444.  
  445. %%
  446. %% A couple of commands for figures/captions
  447. %%
  448.  
  449. \newcommand{\thesiscaption}[3][]{
  450. \ifthenelse{\equal{#1}{}}
  451. {\parbox{5in}{\caption{{\em #2\/}}\label{#3}}}
  452. {\parbox{5in}{\caption[#1]{{\em #2\/}}\label{#3}}}
  453. }
  454.  
  455. %%
  456. %% Quotations are supposed to be in single-space, so we will
  457. %% explicitly redefine the quotation env. to support this.
  458. %% And introduce a quotetext env. which can add an attribution.
  459. %%
  460.  
  461. \let\old@quote\quote
  462. \let\old@endquote\endquote
  463. \renewcommand{\quote}{\old@quote\singlespace\ifthenelse{\boolean{usequotemarks}}{``}{}}
  464. \renewcommand{\endquote}{\ifthenelse{\boolean{usequotemarks}}{''}{}\old@endquote}
  465.  
  466. \let\old@quotation\quotation
  467. \let\old@endquotation\endquotation
  468. \renewcommand{\quotation}{\old@quotation\singlespace}
  469. \renewcommand{\endquotation}{\old@endquotation}
  470. % \renewenvironment{quote}
  471. % {\old@quote\singlespace
  472. % \ifthenelse{\boolean{usequotemarks}}{``}{}}
  473. % {\ifthenelse{\boolean{usequotemarks}}{''}{}\end{quote}}
  474.  
  475. \newenvironment{iquote}
  476. {\begin{quote}\it}
  477. {\rm\end{quote}}
  478.  
  479. \newcommand{\quotationname}{}
  480. \newenvironment{quotetext}[1]
  481. {\renewcommand{\quotationname}{#1}\begin{iquote}\singlespace
  482. \ifthenelse{\boolean{usequotemarks}}{``}{}\it}
  483. {\ifthenelse{\boolean{usequotemarks}}{\rm''}{}
  484. \hspace*{\fill}\nolinebreak[1]\hspace*{\fill}
  485. \rm (\quotationname)\end{iquote}}
  486.  
  487. %%
  488. %% Footnotes should also be single-spaced.
  489. %%
  490.  
  491. \let\tmp@footnotetext=\@footnotetext
  492. \renewcommand{\@footnotetext}[1]%
  493. {{\singlespace\tmp@footnotetext{#1}}}
  494.  
  495. %% "preliminary" environment to control numbering of pages between title and
  496. %% first chapter. This will only kick in if romanprepages is specificed (the
  497. %% default).
  498. %% Based on Francois Pitt's ut-thesis.cls from University of Toronto.
  499.  
  500. \newenvironment{preliminary}
  501. {\ifthenelse{\boolean{romanpre}}%
  502. {\pagestyle{plain}\pagenumbering{roman}}
  503. {\pagestyle{empty}}}%
  504. {\cleardoublepage%
  505. \ifthenelse{\boolean{romanpre}}%
  506. {\pagenumbering{arabic}}%
  507. {}}
  508.  
  509. %%
  510. %% Let's have a dedication page so I can thank my mummy.
  511. %%
  512.  
  513. \newcommand{\dedication}[1]
  514. {\vspace*{\fill}
  515. \begin{center}#1\end{center}
  516. \vspace*{\fill}}
  517.  
  518.  
  519. %% A generic "frontmatter" environment, for use with abstract, dedication etc.
  520. %% You specify the title of the environment and the font size to use (so that
  521. %% both normal abstracts and those on the front page can be accommodated.)
  522.  
  523. \newenvironment{frontenv}[2]
  524. {\vspace{1cm}
  525. \begin{center}
  526. \@chapterfont\bfseries \LARGE#1
  527. \end{center}}
  528. {\par\vfil}
  529.  
  530. %% You specify the abstract with the \abs command; it gets automatically
  531. %% inserted into the document where appropriate (title page or first main
  532. %% page.
  533.  
  534. \def\@abs{}
  535. \renewcommand{\abstract}[1]{\gdef\@abs{#1}}
  536.  
  537. \newenvironment{mainabs}
  538. {\begin{frontenv}{\abstractname}{\LARGE}}
  539. {\end{frontenv}\newpage}
  540. \newenvironment{frontabs}
  541. {\begin{frontenv}{\abstractname}{\large}
  542. \begin{quotation}\rm}
  543. {\end{quotation}\end{frontenv}}
  544.  
  545. %%
  546. %% Based upon the above abstract env., provide wrappers for
  547. %% an acknowledgements and declation env.
  548. %%
  549.  
  550. \newenvironment{acknowledgements}
  551. {\renewcommand{\abstractname}{Acknowledgements}\begin{mainabs}}
  552. {\end{mainabs}\renewcommand{\abstractname}{Abstract}}
  553.  
  554. \newenvironment{declaration}
  555. {\renewcommand{\abstractname}{Declaration}\begin{mainabs}}
  556. {\end{mainabs}\renewcommand{\abstractname}{Abstract}}
  557.  
  558. \newcommand{\standarddeclaration}{
  559. \begin{declaration}
  560. I declare that this thesis was composed by myself,
  561. that the work contained herein is my own
  562. except where explicitly stated otherwise in the text,
  563. and that this work has not been submitted for any other degree or
  564. professional qualification except as specified.\par
  565. \vspace{1in}\raggedleft({\em \@author\/})
  566. \end{declaration}
  567. }
  568.  
  569. %%
  570. %% Now let's look at the format for the title page of the
  571. %% thesis. This is done by redefining \maketitle, and allowing
  572. %% some extra input options: \submityear and \graduationdate
  573. %%
  574.  
  575. \def\submityear#1{\gdef\@submityear{#1}}
  576. \gdef\@submityear{\the\year}
  577.  
  578. \def\graduationdate#1{\gdef\@graduationdate{#1}}
  579. \gdef\@graduationdate{}
  580.  
  581. %% If usedeptreport is specified, then none of the other funky options kick
  582. %% in. If not, then if frontabs is specified then it is used; otherwise,
  583. %% the logo is inserted if required. If the abstract is not put on the front
  584. %% page, then \maketitle will also create the abstract page as the first page
  585. %% of the actual document.
  586.  
  587. \ifthenelse{\boolean{usedeptreport}}{
  588. \renewcommand{\maketitle}{
  589. \begin{titlepage}
  590. \addtolength{\oddsidemargin}{-0.75cm}
  591. \begin{center}
  592. \null\vskip 6.1cm
  593. \begin{minipage}[t][9.6cm]{10.5cm}
  594. \begin{center}
  595. {\LARGE\bfseries \@chapterfont \@title \par
  596. \ifthenelse{\boolean{draftthesis}}{\large \@draftmessage}{}
  597. }\vfill
  598. {\Large\itshape \@author \par}\vfill
  599. \ifthenelse{\boolean{logo}}%
  600. {\resizebox{30mm}{!}{\includeshield}\\\vfill}
  601. {}
  602. \end{center}
  603. \end{minipage}\\
  604. {\large \@degreetext \par \@submityear \par}
  605. \ifthenelse{\equal{\@graduationdate}{}}{}
  606. {\vskip 1cm {\large \ttfamily (Graduation date: \@graduationdate)}}
  607. \end{center}
  608. \end{titlepage}\cleardoublepage
  609. \begin{mainabs}\@abs\end{mainabs}
  610. }}{\ifthenelse{\boolean{frontabs}}{
  611. \ifthenelse{\boolean{strict}}
  612. {\PackageWarning{infthesis}{The regulations for PhD and MPhil theses
  613. do not permit the abstract on the front page}}
  614. {}
  615. \renewcommand{\maketitle}{
  616. \begin{titlepage}\begin{center}
  617. {\LARGE\bfseries \@chapterfont \@title \par
  618. \ifthenelse{\boolean{draftthesis}}{\large (Draft Copy)}{}
  619. }\vspace{3cm}
  620. {\Large\itshape \@author \par}\vspace{3cm}
  621. {\large \@degreetext \par \@submityear \par}
  622. \vskip 1cm
  623. \ifthenelse{\equal{\@graduationdate}{}}{}
  624. {{\large \ttfamily (Graduation date: \@graduationdate)}}
  625. \end{center}
  626. \begin{frontabs}\@abs\end{frontabs}
  627. \end{titlepage}
  628. }}{
  629. \renewcommand{\maketitle}{
  630. \begin{titlepage}\begin{center}
  631. \null\vfil\vskip 60\p@
  632. {\LARGE\bfseries \@chapterfont \@title \par
  633. \ifthenelse{\boolean{draftthesis}}{\large (Draft Copy)}{}
  634. }\vfill
  635. {\Large\itshape \@author \par}\vskip 1cm\vfill
  636. \ifthenelse{\boolean{logo}}%
  637. {\resizebox{30mm}{!}{\includeshield}\\\vfill}
  638. {}
  639. {\large \@degreetext \par \@submityear \par}
  640. \vskip 1cm
  641. \ifthenelse{\equal{\@graduationdate}{}}{}
  642. {{\large \ttfamily (Graduation date: \@graduationdate)}}
  643. \end{center}
  644. \end{titlepage}\cleardoublepage
  645. \begin{mainabs}\@abs\end{mainabs}
  646. }}}
  647.  
  648.  
  649. %% If requested, put the list of figures and list of tables into the table of
  650. %% contents.
  651.  
  652. \ifthenelse{\boolean{ltoc}}
  653. {\RequirePackage[nottoc,notbib]{tocbibind}}
  654. {}
  655.  
  656. %% Use the "pslatex" fonts unless they told us not to
  657. \ifthenelse{\boolean{timesfonts}}
  658. {\RequirePackage{pslatex}}
  659. {}
  660.  
  661. %% ALWAYS put the bibliography into the TOC.
  662. %% Thanks to Peter Wilson <peter.r.wilson@boeing.com> for pointing me in the
  663. %% right direction, and to Heiko Oberdiek <oberdiek@ruf.uni-freiburg.de>
  664. %% and Michael J Downes <epsmjd@ams,org> for together coming up with this
  665. %% solution.
  666. %%
  667. %% However the bibliography is defined, this will append the \addcontentsline
  668. %% statement to it. Also, it will put the bibname into the page headers.
  669. \AtBeginDocument{%
  670. \expandafter\def\expandafter\thebibliography\expandafter
  671. #\expandafter1\expandafter{\thebibliography{#1}%
  672. {\addcontentsline{toc}{chapter}{\bibname}}
  673. \markboth{\bibname}{\bibname}}}
  674.  
  675. %% Do what is requested with headings and captions... can't include these
  676. %% packages above because sectsty won't work except from within report.cls
  677. %% itself. Must save \@chapterfont because the front environments (abstract
  678. %% etc) also need to use it.
  679. \RequirePackage{sectsty,caption}
  680. \ifthenelse{\boolean{sansheadings}}
  681. {\allsectionsfont{\sffamily}
  682. \renewcommand{\@chapterfont}{\sffamily}
  683. \renewcommand{\captionfont}{\sffamily}
  684. \renewcommand{\headfootstyle}{\normalsize\sffamily}}
  685. {}
  686. %% To make sure we get chapters aligned correctly, we set it here instead.
  687. \chapterfont{\@chapterfont\@chapteralignment}
  688.  
  689. %%
  690. %% EOF: infthesis.cls
  691. %%
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement