Advertisement
Guest User

Mama had a chicken, Mama had a cow, Dad was proud, He didn't

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