%%
%% This is file `uccthesis.cls',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% uccthesis.dtx  (with options: `class')
%% This file was generated from an XML master source.
%% Amendments and corrections should be notified to the maintainer
%% for inclusion in future versions.
\NeedsTeXFormat{LaTeX2e}[2009/09/24]
\ProvidesClass{uccthesis}[2014/05/30 v1.19
 Typesetting a UCC thesis with LaTeX]
%% v1.17 2014/01/27 Documented the fix for apacite
\RequirePackage{fixltx2e}
\RequirePackage{fix-cm}
\PassOptionsToPackage{hyperref}{svgnames}
\RequirePackage{ifthen}
\def\@schoolhandle{School of}
\def\@unittype{\relax}
\def\@school{\relax}
\newcommand{\school}[2][\relax]{%
  \ifthenelse{\equal{#1}{}}%
    {\gdef\@school{#2}}%
    {\if#1\relax\gdef\@school{\@schoolhandle\ #2}%
     \else\gdef\@school{#1 #2}%
     \fi
  }%
  \gdef\@unittype{School}%
}%
\def\@departmenthandle{Department of}
\def\@department{\relax}
\newcommand{\department}[2][\relax]{%
  \ifthenelse{\equal{#1}{}}{\gdef\@department{#2}}{%
    \if#1\relax
      \gdef\@department{\@departmenthandle\ #2}%
    \else\gdef\@department{#1 #2}\fi
  }%
  \def\@unittype{Department}%
}%
\def\@institutehandle{Institute}
\def\@institute{\relax}
\newcommand{\institute}[2][\relax]{%
  \ifthenelse{\equal{#1}{}}{\gdef\@institute{#2}}{%
    \if#1\relax
      \gdef\@institute{#2 \@institutehandle}%
    \else\gdef\@institute{#2 (#1)}\fi}}
\def\@hospitalhandle{Hospital}
\def\@hospital{\relax}
\newcommand{\hospital}[2][\relax]{%
  \ifthenelse{\equal{#1}{}}{\gdef\@hospital{#2}}{%
    \if#1\relax
      \gdef\@hospital{#2 \@hospitalhandle}%
    \else\gdef\@hospital{#2 (#1)}\fi}}
\def\@centrehandle{Centre}
\def\@centre{\relax}
\newcommand{\centre}[2][\relax]{%
  \ifthenelse{\equal{#1}{}}{\gdef\@centre{#2}}{%
    \if#1\relax
      \gdef\@centre{#2 \@centrehandle}%
    \else\gdef\@centre{#2 (#1)}\fi}}
\def\@unithandle{Unit}
\def\@unit{\relax}
\newcommand{\unit}[2][\relax]{%
  \ifthenelse{\equal{#1}{}}{\gdef\@unit{#2}}{%
    \if#1\relax
      \gdef\@unit{#2 \@unithandle}%
    \else\gdef\@unit{#2 (#1)}\fi}}
\def\@userbibstyle{plain}
\newcommand{\@usebib}[4][\relax]{%
  \if#1\relax\else
%% v1.17 2014/01/27 Added code for apacite exception
    \ifthenelse{\equal{#4}{}}{%null#4
      \AtEndOfClass{% ie maybe before user customisations
        \message{Loading #1 package for #2 citations}%
        \RequirePackage{#1}}}{%live#4
      \AtBeginDocument{% ie after *everything*
        \message{Loading #1 package for #2 citations}%
        \RequirePackage{#1}}}%
    \fi
  \gdef\@userbibstyle{#2}%
  \AtEndDocument{%
    \message{Setting bibliography style to \@userbibstyle}%
    \bibliographystyle{\@userbibstyle}}%
}
\newcommand{\resetbibstyle}[2][\relax]{%
  \gdef\@userbibstyle{#2}%
  \ifx\relax#1\else
    \message{Loading #1 package for #2 citations}%
    \usepackage{#1}\fi
}
\newcommand{\@usebabel}[2][\relax]{%
  \if\relax#1
    \RequirePackage{#2}
  \else
    \RequirePackage[#1]{#2}
  \fi
}
%% v0.99 2012/04/20 Added institutions to the list of options to generate (previously omitted)
\DeclareOption{apsoc}{%
  \school{Applied Social Studies}
  \@usebib[natbib,har2nat]{kluwer}{Harvard}{}
}
\DeclareOption{apsych}{%
  \school{Applied Psychology}
  \@usebib[apacite]{apacite}{APA}{}
}
\DeclareOption{arch}{%
  \department{Archaeology}
  \@usebib[natbib,har2nat]{kluwer}{Harvard}{}
}
\DeclareOption{arthist}{%
  \school{History}
  \department{History of Art}
  \@usebib[oxford]{oxford_en}{Oxford}{}
}
\DeclareOption{asian}{%
  \school{Asian Studies}
  \@usebib[natbib,har2nat]{kluwer}{Harvard}{}
}
\DeclareOption{bealoideas}{%
  \department[]{Béaloideas~/ Folklore}
  \@usebib[natbib,har2nat]{kluwer}{Harvard}{}
}
\DeclareOption{classics}{%
  \department{Classics}
  \@usebib[oxford]{oxford_en}{Oxford}{}
}
\DeclareOption{educ}{%
  \school{Education}
  \@usebib[natbib,har2nat]{kluwer}{Harvard}{}
}
\DeclareOption{emi}{%
  \department{Early and Medieval Irish}
  \@usebib[natbib,har2nat]{kluwer}{Harvard}{}
}
\DeclareOption{eng}{%
  \school{English}
  \@usebib[natbib,har2nat]{kluwer}{Harvard}{}
}
\DeclareOption{folketh}{%
  \department{Folklore and Ethnology}
  \@usebib[natbib,har2nat]{kluwer}{Harvard}{}
}
\DeclareOption{french}{%
  \school{Languages, Literatures and Cultures}
  \department{French}
  \@usebib[natbib,har2nat]{kluwer}{Harvard}{}
}
\DeclareOption{geog}{%
  \department{Geography}
  \@usebib[natbib,har2nat]{kluwer}{Harvard}{}
}
\DeclareOption{german}{%
  \school{Languages, Literatures and Cultures}
  \department{German}
  \@usebib[chicago]{mlaa}{MLA}{}
}
\DeclareOption{hisp}{%
  \school{Languages, Literatures and Cultures}
  \department{Hispanic Studies}
  \@usebib[natbib,har2nat]{agsm-mod}{Harvard}{}
}
\DeclareOption{hist}{%
  \school{History}
  \@usebib[natbib,har2nat]{kluwer}{Harvard}{}
}
\DeclareOption{italian}{%
  \school{Languages, Literatures and Cultures}
  \department{Italian}
  \@usebib[natbib,har2nat]{kluwer}{Harvard}{}
}
\DeclareOption{llc}{%
  \school{Languages, Literatures and Cultures}
  \@usebib[natbib,har2nat]{kluwer}{Harvard}{}
}
\DeclareOption{lnag}{%
  \school{Scoil Léann na Gaeilge~/ School of Irish Learning}
  \@usebib[natbib,har2nat]{kluwer}{Harvard}{}
}
\DeclareOption{modirish}{%
  \department{Modern Irish}
  \@usebib[natbib,har2nat]{kluwer}{Harvard}{}
}
\DeclareOption{music}{%
  \school{Music and Theatre}
  \department{Music}
  \@usebib[natbib,har2nat]{kluwer}{Harvard}{}
}
\DeclareOption{nuag}{%
  \department{Nua-Ghaeilge}
  \@usebib[natbib,har2nat]{kluwer}{Harvard}{}
}
\DeclareOption{phil}{%
  \department{Philosophy}
  \@usebib[natbib,har2nat]{kluwer}{Harvard}{}
}
\DeclareOption{planning}{%
  \school{Geography and Archaeology: The Human Environment}
  \@usebib[natbib,har2nat]{kluwer}{Harvard}{}
}
\DeclareOption{politics}{%
  \department{Politics}
  \@usebib[natbib,har2nat]{kluwer}{Harvard}{}
}
\DeclareOption{relig}{%
  \department{Study of Religions}
  \@usebib[natbib,har2nat]{kluwer}{Harvard}{}
}
\DeclareOption{smg}{%
  \department{Sean- agus Meán-Ghaeilge}
  \@usebib[natbib,har2nat]{kluwer}{Harvard}{}
}
\DeclareOption{socio}{%
  \department{Sociology}
  \@usebib[natbib,har2nat]{kluwer}{Harvard}{}
}
\DeclareOption{sociophil}{%
  \school{Sociology and Philosophy}
  \@usebib[natbib,har2nat]{dcu}{Harvard}{}
}
\DeclareOption{theatre}{%
  \school{Music and Theatre}
  \department{Drama and Theatre Studies}
  \@usebib[natbib,har2nat]{kluwer}{Harvard}{}
}
\DeclareOption{afis}{%
  \school[]{Faculty of Commerce}
  \department{Accounting and Finance}
  \@usebib[natbib,har2nat]{apsr}{Harvard}{}
}
\DeclareOption{bis}{%
  \school[]{Faculty of Commerce}
  \department{Business Information Systems}
  \@usebib[natbib,har2nat]{apsr}{Harvard}{}
}
\DeclareOption{commerce}{%
  \school[]{Faculty of Commerce}
  \@usebib[natbib,har2nat]{kluwer}{Harvard}{}
}
\DeclareOption{coop}{%
  \school[]{Faculty of Commerce}
  \centre[]{Centre for Co-operative Studies}
  \@usebib[natbib,har2nat]{apsr}{Harvard}{}
}
\DeclareOption{cps}{%
  \school[]{Faculty of Commerce}
  \centre[]{Centre for Policy Studies}
  \@usebib[natbib,har2nat]{apsr}{Harvard}{}
}
\DeclareOption{econ}{%
  \school[]{Faculty of Commerce}
  \department{Economics}
  \@usebib[natbib,har2nat]{apsr}{Harvard}{}
}
\DeclareOption{foodbus}{%
  \school{Food and Nutritional Sciences}
  \department{Food Business and Development}
  \@usebib[natbib,har2nat]{agsm}{Harvard}{}
}
\DeclareOption{govt}{%
  \school[]{Faculty of Commerce}
  \department{Government}
  \@usebib[natbib,har2nat]{apsr}{Harvard}{}
}
\DeclareOption{law}{%
  \school[]{Faculty of Law}
  \@usebib[jurabib]{jurabib}{Legal}{}
}
\DeclareOption{mgt}{%
  \school[]{Faculty of Commerce}
  \department{Management and Marketing}
  \@usebib[natbib,har2nat]{apsr}{Harvard}{}
}
\DeclareOption{mktg}{%
  \school[]{Faculty of Commerce}
  \department{Management and Marketing}
  \@usebib[natbib,har2nat]{apsr}{Harvard}{}
}
\DeclareOption{stats}{%
  \department{Statistics}
  \@usebib[natbib,har2nat]{apsr}{Harvard}{}
}
\DeclareOption{anat}{%
  \department{Anatomy}
  \@usebib{vancouver}{Vancouver}{}
}
\DeclareOption{biochem}{%
  \department{Biochemistry}
  \@usebib{vancouver}{Vancouver}{}
}
\DeclareOption{clinther}{%
  \school{Clinical Therapies}
  \@usebib[natbib,har2nat]{kluwer}{Harvard}{}
}
\DeclareOption{cuh}{%
  \hospital{Cork University}
  \@usebib{vancouver}{Vancouver}{}
}
\DeclareOption{denthosp}{%
  \hospital[]{University Dental School and Hospital}
  \@usebib{vancouver}{Vancouver}{}
}
\DeclareOption{dentrest}{%
  \hospital[]{University Dental School and Hospital}
  \school{Dental Hygiene}
  \department{Restorative Dentistry}
  \@usebib{vancouver}{Vancouver}{}
}
\DeclareOption{dentsurg}{%
  \hospital[]{University Dental School and Hospital}
  \department{Dental Surgery}
  \@usebib{vancouver}{Vancouver}{}
}
\DeclareOption{epipub}{%
  \school{Medicine}
  \department{Epidemiology and Public Health}
  \@usebib{vancouver}{Vancouver}{}
}
\DeclareOption{gp}{%
  \school{Medicine}
  \department{General Practice}
  \@usebib{vancouver}{Vancouver}{}
}
\DeclareOption{hearing}{%
  \school{Clinical Therapies}
  \department{Speech and Hearing Sciences}
  \@usebib[apacite]{apacite}{APA}{}
}
\DeclareOption{life}{%
  \school{Life Sciences}
  \@usebib[natbib,har2nat]{agsm}{Harvard}{}
}
\DeclareOption{medsch}{%
  \school{Medicine}
  \@usebib{vancouver}{Vancouver}{}
}
\DeclareOption{medicine}{%
  \school{Medicine}
  \department{Medicine}
  \@usebib{vancouver}{Vancouver}{}
}
\DeclareOption{mercy}{%
  \hospital{Mercy University}
  \@usebib{vancouver}{Vancouver}{}
}
\DeclareOption{midwifery}{%
  \school{Nursing and Midwifery}
  \@usebib[natbib,har2nat]{dcu}{Harvard}{}
}
\DeclareOption{nursing}{%
  \school{Nursing and Midwifery}
  \@usebib[natbib,har2nat]{dcu}{Harvard}{}
}
\DeclareOption{obsgyn}{%
  \school{Medicine}
  \department{Obstetrics and Gynaecology}
  \@usebib{vancouver}{Vancouver}{}
}
\DeclareOption{occther}{%
  \school{Clinical Therapies}
  \department{Occupational Therapy}
  \@usebib[natbib,har2nat]{kluwer}{Harvard}{}
}
\DeclareOption{oralhealth}{%
  \hospital[]{University Dental School and Hospital}
  \department{Oral Health and Development}
  \@usebib{vancouver}{Vancouver}{}
}
\DeclareOption{path}{%
  \school{Medicine}
  \department{Pathology}
  \@usebib{vancouver}{Vancouver}{}
}
\DeclareOption{pch}{%
  \school{Medicine}
  \department{Paediatrics and Child Health}
  \@usebib{vancouver}{Vancouver}{}
}
\DeclareOption{pharm}{%
  \school{Pharmacy}
  \@usebib[natbib,har2nat]{kluwer}{Harvard}{}
}
\DeclareOption{pharmthera}{%
  \school{Medicine}
  \department{Pharmacology and Therapeutics}
  \@usebib{vancouver}{Vancouver}{}
}
\DeclareOption{physio}{%
  \department{Physiology}
  \@usebib{vancouver}{Vancouver}{}
}
\DeclareOption{psychiatry}{%
  \school{Medicine}
  \department{Psychiatry}
  \@usebib{vancouver}{Vancouver}{}
}
\DeclareOption{radio}{%
  \school{Medicine}
  \department{Radiology}
  \@usebib[natbib,har2nat]{agsm}{Harvard}{}
}
\DeclareOption{speech}{%
  \school{Clinical Therapies}
  \department{Speech and Hearing Sciences}
  \@usebib[apacite]{apacite}{APA}{}
}
\DeclareOption{surg}{%
  \school{Medicine}
  \department{Surgery}
  \@usebib{vancouver}{Vancouver}{}
}
\DeclareOption{foodbus}{%
  \school{Food and Nutritional Sciences}
  \department{Food Business and Development}
  \@usebib[natbib,har2nat]{agsm}{Harvard}{}
}
\DeclareOption{stats}{%
  \department{Statistics}
  \@usebib[natbib,har2nat]{apsr}{Harvard}{}
}
\DeclareOption{physio}{%
  \department{Physiology}
  \@usebib{vancouver}{Vancouver}{}
}
\DeclareOption{appmaths}{%
  \department{Applied Mathematics}
  \@usebib{alpha}{Default}{}
}
\DeclareOption{bees}{%
  \school{Biological, Earth and Environmental Sciences}
  \@usebib[natbib,har2nat]{apsr}{Oxford}{}
}
\DeclareOption{chem}{%
  \school[]{Faculty of Science}
  \department{Chemistry}
  \@usebib[natbib]{achemso}{ACS}{}
}
\DeclareOption{chemeng}{%
  \department{Process and Chemical Engineering}
  \@usebib[natbib,har2nat]{agsm}{Harvard}{}
}
\DeclareOption{civil}{%
  \school{Engineering}
  \department{Civil and Environmental Engineering}
  \@usebib[natbib,har2nat]{agsm}{Harvard}{}
}
\DeclareOption{cs}{%
  \school[]{Faculty of Science}
  \department{Computer Science}
  \@usebib{alpha}{Default}{}
}
\DeclareOption{elec}{%
  \school{Engineering}
  \department{Electrical and Electronic Engineering}
  \@usebib[natbib,har2nat]{agsm}{Harvard}{}
}
\DeclareOption{engineering}{%
  \school{Engineering}
  \@usebib[natbib,har2nat]{agsm}{Harvard}{}
}
\DeclareOption{food}{%
  \school{Food and Nutritional Sciences}
  \@usebib{alpha}{Default}{}
}
\DeclareOption{geol}{%
  \school[]{Faculty of Science}
  \department{Geology}
  \@usebib{alpha}{Default}{}
}
\DeclareOption{maths}{%
  \school{Mathematical Sciences}
  \department{Mathematics}
  \@usebib{alpha}{Default}{}
}
\DeclareOption{microbio}{%
  \department{Microbiology}
  \@usebib{alpha}{Default}{}
}
\DeclareOption{microelec}{%
  \school{Engineering}
  \department{Microelectronic Engineering}
  \@usebib[natbib,har2nat]{agsm}{Harvard}{}
}
\DeclareOption{physics}{%
  \school{Science}
  \department{Physics}
  \@usebib{ieeetr}{Transactions of the IEEE}{}
}
\DeclareOption{scifac}{%
  \school[]{Faculty of Science}
  \@usebib{alpha}{Default}{}
}
\DeclareOption{zeps}{%
  \school{Zoology, Ecology and Plant Science}
  \@usebib[oxford]{oxford_en}{Oxford}{}
}
\DeclareOption{imi}{%
  \institute{Irish Management}
  \@usebib[natbib,har2nat]{dcu}{Harvard}{}
}
\DeclareOption{tyndall}{%
  \institute{Tyndall National}
  \@usebib{alpha}{Alpha}{}
}
\def\@degreehandle{Degree of \@degree}
\def\@degree{[Unspecified]}
\newif\ifthesis
\newcommand{\degree}[1]{\gdef\@degree{#1}\thesistrue}
\DeclareOption{dlitt}{%
  \degree{Doctor of Literature}
}
\DeclareOption{dlittcelt}{%
  \degree{Doctor of Celtic Literature}
}
\DeclareOption{dmus}{%
  \degree{Doctor of Music}
}
\DeclareOption{dsocsci}{%
  \degree{Doctor of Social Science}
}
\DeclareOption{phd}{%
  \degree{Doctor of Philosophy}
}
\DeclareOption{phded}{%
  \degree{Doctor of Philosophy in Education~--- Structured}
}
\DeclareOption{phdss}{%
  \degree{Doctor of Philosophy in Social Sciences}
}
\DeclareOption{phdtcc}{%
  \degree{Doctor of Philosophy in Texts, Contexts and Cultures}
}
\DeclareOption{ma}{%
  \degree{Master of Arts}
}
\DeclareOption{mbsasian}{%
  \degree{Master of Business Systems
          (Asian Business)}
}
\DeclareOption{med}{%
  \degree{Master of Education}
}
\DeclareOption{mphil}{%
  \degree{Master of Philosophy}
}
\DeclareOption{mplan}{%
  \degree{Master of Planning and Sustainable Development}
}
\DeclareOption{msocsc}{%
  \degree{Master of Social Science}
}
\DeclareOption{msw}{%
  \degree{Master of Social Work}
}
\DeclareOption{phd}{%
  \degree{Doctor of Philosophy}
}
\DeclareOption{mbsasian}{%
  \degree{Master of Business Systems
          (Asian Business)}
}
\DeclareOption{dbe}{%
  \degree{Doctor of Business Economics}
}
\DeclareOption{deconsc}{%
  \degree{Doctor of Economic Science}
}
\DeclareOption{lld}{%
  \degree{Doctor of Law}
}
\DeclareOption{phdbis}{%
  \degree{Doctor of Philosophy in Business Information Systems}
}
\DeclareOption{llm}{%
  \degree{Master of Law}
}
\DeclareOption{llmcj}{%
  \degree{Master of Law
          (Criminal Justice)}
}
\DeclareOption{llme}{%
  \degree{Master of Law
          (e-Law)}
}
\DeclareOption{llmp}{%
  \degree{Master of Law
          (Practitioner)}
}
\DeclareOption{mba}{%
  \degree{Master of Business Administration}
}
\DeclareOption{mbs}{%
  \degree{Master of Business Systems}
}
\DeclareOption{mbsbe}{%
  \degree{Master of Business Systems
          (Business Economics)}
}
\DeclareOption{mbsbis}{%
  \degree{Master of Business Systems
          (Business Information Systems)}
}
\DeclareOption{mbsbp}{%
  \degree{Master of Business Systems
          (Economics of Business Practice)}
}
\DeclareOption{mbscse}{%
  \degree{Master of Business Systems
          (Co-operative and Social Enterprise)}
}
\DeclareOption{mbseb}{%
  \degree{Master of Business Systems
          (Electronic Business)}
}
\DeclareOption{mbsfm}{%
  \degree{Master of Business Systems
          (Food Marketing)}
}
\DeclareOption{mbsg}{%
  \degree{Master of Business Systems
          (Government)}
}
\DeclareOption{mbshsm}{%
  \degree{Master of Business Systems
          (Health Services Management)}
}
\DeclareOption{mbsieb}{%
  \degree{Master of Business Systems
          (Innovation in European Business)}
}
\DeclareOption{mbsippd}{%
  \degree{Master of Business Systems
          (International Public Policy and Diplomacy)}
}
\DeclareOption{mbsisbp}{%
  \degree{Master of Business Systems
          (Information Systems for Business Performance)}
}
\DeclareOption{mbsmimas}{%
  \degree{Master of Business Systems
          (Management Information and Managerial Accounting Systems)}
}
\DeclareOption{mbsmm}{%
  \degree{Master of Business Systems
          (Management and Marketing)}
}
\DeclareOption{mcomm}{%
  \degree{Master of Commerce}
}
\DeclareOption{mcommbb}{%
  \degree{Master of Commerce
          (Supply Chain Management~--- Lean SCM Black Belt)}
}
\DeclareOption{mcommbe}{%
  \degree{Master of Commerce
          (Business Economics)}
}
\DeclareOption{mcommgpp}{%
  \degree{Master of Commerce
          (Government and Public Policy)}
}
\DeclareOption{mcommscm}{%
  \degree{Master of Commerce
          (Supply Chain Management)}
}
\DeclareOption{meconsc}{%
  \degree{Master of Economic Science}
}
\DeclareOption{msccf}{%
  \degree{Master of Science
          (Corporate Finance)}
}
\DeclareOption{mscfe}{%
  \degree{Master of Science
          (Financial Economics)}
}
\DeclareOption{msche}{%
  \degree{Master of Science
          (Health Economics)}
}
\DeclareOption{phd}{%
  \degree{Doctor of Philosophy}
}
\DeclareOption{dclindent}{%
  \degree{Doctor of Clinical Dentistry}
}
\DeclareOption{dmed}{%
  \degree{Doctor of Medicine}
}
\DeclareOption{dnp}{%
  \degree{Doctor of Nursing Practice}
}
\DeclareOption{docct}{%
  \degree{Doctor of Occupational Therapy}
}
\DeclareOption{md}{%
  \degree{Doctor of Medicine}
}
\DeclareOption{phdcb}{%
  \degree{Doctor of Philosophy in Cancer Biology}
}
\DeclareOption{phdhsr}{%
  \degree{Doctor of Philosophy in Health Services Research}
}
\DeclareOption{mao}{%
  \degree{Master of Obstetrics}
}
\DeclareOption{mch}{%
  \degree{Master of Surgery}
}
\DeclareOption{mdph}{%
  \degree{Master in Dental Public Health}
}
\DeclareOption{mds}{%
  \degree{Master of Dental Science}
}
\DeclareOption{mmedsc}{%
  \degree{Master in Sport and Exercise Medicine}
}
\DeclareOption{mph}{%
  \degree{Master in Public Health}
}
\DeclareOption{msccp}{%
  \degree{Master of Science
          (Clinical Pharmacy)}
}
\DeclareOption{mscebtp}{%
  \degree{Master of Science
          (Evidence-Based Therapy Practice)}
}
\DeclareOption{mscm}{%
  \degree{Master of Science
          (Midwifery)}
}
\DeclareOption{mscog}{%
  \degree{Master of Science
          (Obstetrics and Gynaecology)}
}
\DeclareOption{mscoh}{%
  \degree{Master of Science
          (Occupational Health)}
}
\DeclareOption{mscptqs}{%
  \degree{Master of Science
          (Pharmaceutical Technology and Quality Systems)}
}
\DeclareOption{phd}{%
  \degree{Doctor of Philosophy}
}
\DeclareOption{mplan}{%
  \degree{Master of Planning and Sustainable Development}
}
\DeclareOption{dsc}{%
  \degree{Doctor of Science}
}
\DeclareOption{me}{%
  \degree{Master of Engineering}
}
\DeclareOption{mengsc}{%
  \degree{Master of Engineering Science}
}
\DeclareOption{mengscit}{%
  \degree{Master of Engineering Science
          (Information Technology in Architecture, Engineering and Construction)}
}
\DeclareOption{mengscm}{%
  \degree{Master of Engineering Science
          (Microelectronics)}
}
\DeclareOption{mengscmd}{%
  \degree{Master of Engineering Science
          (Microelectronic Design)}
}
\DeclareOption{mengscme}{%
  \degree{Master of Engineering Science in Mechanical Engineering
          (Manufacturing, Process and Automation Systems)}
}
\DeclareOption{mengscpbe}{%
  \degree{Master of Engineering Science
          (Pharmaceutical and Biopharmaceutical Engineering)}
}
\DeclareOption{mengscse}{%
  \degree{Master of Engineering Science
          (Sustainable Energy)}
}
\DeclareOption{msc}{%
  \degree{Master of Science}
}
\DeclareOption{mscac}{%
  \degree{Master of Applied Science
          (Analytical Chemistry)}
}
\DeclareOption{mscapc}{%
  \degree{Master of Applied Science
          (Analysis of Pharmaceutical Compounds)}
}
\DeclareOption{mscb}{%
  \degree{Master of Applied Science
          (Biotechnology)}
}
\DeclareOption{mscbsb}{%
  \degree{Master of Applied Science
          (Bioinformatics with Systems Biology)}
}
\DeclareOption{msccoop}{%
  \degree{Master of Science
          (Co-operative Organisation/Food Marketing/Rural Development)}
}
\DeclareOption{mscea}{%
  \degree{Master of Applied Science
          (Ecological Assessment)}
}
\DeclareOption{msceac}{%
  \degree{Master of Applied Science
          (Environmental Analytical Chemistry)}
}
\DeclareOption{mscfb}{%
  \degree{Master of Science
          (Food Business)}
}
\DeclareOption{mscfm}{%
  \degree{Master of Applied Science
          (Food Microbiology)}
}
\DeclareOption{mscfs}{%
  \degree{Master of Applied Science
          (Food Science)}
}
\DeclareOption{mscgis}{%
  \degree{Master of Applied Science
          (Geographical Information Systems and Remote Sensing)}
}
\DeclareOption{mscmb}{%
  \degree{Master of Applied Science
          (Marine Biology)}
}
\DeclareOption{mscmmsc}{%
  \degree{Master of Applied Science
          (Mathematical Modelling and Scientific Computing)}
}
\DeclareOption{mscns}{%
  \degree{Master of Applied Science
          (Nutritional Sciences)}
}
\DeclareOption{mscrd}{%
  \degree{Master of Science
          (Rural Development)}
}
\DeclareOption{mscssmn}{%
  \degree{Master of Applied Science
          (Software and Systems for Mobile Networks)}
}
\DeclareOption{msctm}{%
  \degree{Master of Science
          (Technology Management)}
}
\def\class@mode{draft}
\def\@revdate{\relax}
\DeclareOption{draft}{\setlength\overfullrule{5pt}%
  \def\class@mode{draft}%
  \sloppy\raggedbottom
  \AtEndOfClass{%
    \lfoot{\scriptsize\ttfamily Draft: \jobname}%
    \rfoot{\scriptsize\ttfamily
           \if\relax\@revdate
             \TODAY T\now:00\else\@revdate\fi}}%
  \typeout{DRAFT MODE}}
\newcommand{\revdate}[1]{\gdef\@revdate{#1}}
\DeclareOption{final}{\setlength\overfullrule{0pt}%
  \def\class@mode{final}%
  \sloppy\raggedbottom
  \typeout{Final mode}}
\def\class@size{11pt}
\DeclareOption{10pt}{\def\class@size{10pt}}
\DeclareOption{11pt}{\def\class@size{11pt}}
\DeclareOption{12pt}{\def\class@size{12pt}}
\def\class@paper{a4paper}
\DeclareOption{a4paper}{\def\class@paper{a4paper}}
\DeclareOption{letterpaper}{\def\class@paper{letterpaper}}
\newif\iflot\lottrue
\DeclareOption{nolot}{\lotfalse}
\newif\iflof\loftrue
\DeclareOption{nolof}{\loffalse}
%% v1.19 2014/05/30 These are now separate counters to reflect total figs and tables, because the normal counters get reset at the start of each chapter
\newcounter{UCC@totfig}
\newcounter{UCC@tottab}
\AtBeginDocument{%
  \let\UCC@end@figure\endfigure
  \newcommand{\UCC@endfigure}{\UCC@end@figure\global\advance\c@UCC@totfig by1}
  \let\endfigure\UCC@endfigure
  \let\UCC@end@table\endtable
  \newcommand{\UCC@endtable}{\UCC@end@table\global\advance\c@UCC@tottab by1}
  \let\endtable\UCC@endtable
}
\AtEndDocument{%
  \ifnum\c@UCC@totfig=0 \write\@mainaux{%
    \string\global\string\loffalse}\fi
  \ifnum\c@UCC@tottab=0 \write\@mainaux{%
    \string\global\string\lotfalse}\fi
}
\newif\ifshorttoc\shorttocfalse
\DeclareOption{shorttoc}{\shorttoctrue}
\DeclareOption{gaeilge}{%
  \AtEndOfClass{%
    \RequirePackage[english,irish]{babel}%
    \RequirePackage{eiad}%
    \institution{\textsc{\large
      Col\'aiste Naisi\'unta na h\'Eireann, Corcaigh}}
    \renewcommand\ackname{Bu\'\i ochas}
    \def\today{\number\day\space\ifcase\month\or
      Ean\'a\i r\or Feabhra\or M\'arta\or A\i bre\'an\or
      Bealta\i ne\or Me\i theamh\or U\'u\i l\or L\'unasa\or
      Me\'an F\'omha\i r\or De\i readh F\'omha\i r\or
      Samha\i n\or M\'\i\ na Nollag\fi\space
      \number\year}%
  \def\@schoolhandle{Scoil an}
    \def\@departmenthandle{Roinn an}
    \def\@institutehandle{Institúid }
    \def\@hospitalhandle{Spidéal }
    \def\@centrehandle{Lárionad}
    \def\@unithandle{???}
    \def\@degreehandle{???}
    \raggedright
}}
\newif\ifcjk\cjkfalse
\DeclareOption{cjk}{\cjktrue}
\DeclareOption{wp}{%
  \AtBeginDocument{%
    \everypar{\vrule depth.2ex width0pt}%
    \RequirePackage{pslatex,ragged2e}%
    \RaggedRight
    \hyphenpenalty=99999 \exhyphenpenalty=99999
    \def\@makechapterhead#1{%
      \begin{center}\normalfont
\ifnum \c@secnumdepth >\m@ne
\if@mainmatter
\LARGE{\sffamily{\@chapapp}\space
  \LARGE\thechapter}%
\par\nobreak
\vspace*{2\baselineskip}%
\fi
\fi
\interlinepenalty\@M
\Huge\sffamily #1\par\nobreak
\vspace*{3\baselineskip}%
    \end{center}}%
    \renewcommand\section{%
      \@startsection{section}{1}{\z@}%
        {-2\baselineskip}%
        {\baselineskip}%
        {\normalfont\sffamily\LARGE\bfseries}}%
    \renewcommand\subsection{%
      \@startsection{subsection}{2}{\z@}%
        {-2\baselineskip}%
        {\baselineskip}%
        {\normalfont\sffamily\Large\bfseries}}%
    \renewcommand\subsubsection{%
      \@startsection{subsubsection}{3}{\z@}%
        {-\baselineskip}%
        {\baselineskip}%
        {\normalfont\sffamily\large\bfseries}}%
    \renewcommand\paragraph{%
      \@startsection{paragraph}{4}{\z@}%
        {\baselineskip}%
        {-.5\baselineskip}%
        {\normalfont\sffamily\normalsize}}%
    \let\subsubsubsection\paragraph
    \renewcommand\subparagraph{%
      \@startsection{subparagraph}{5}{\parindent}%
        {\baselineskip}%
        {-.1pt}%
        {\normalfont\sffamily\normalsize\itshape}}%
    \let\subsubsubsubsection\subparagraph
    \setcounter{secnumdepth}{-1}
    \let\@makefntext\oldfntext
    \renewcommand{\footnoterule}{\par\vspace*{1pc}}%
    \pagestyle{fancy}%
    \lhead{}\rhead{}\chead{}%
    \lfoot{}\cfoot{\thepage}\rfoot{}%
    \renewcommand{\headrulewidth}{0pt}%
    \def\TeX{TeX}\def\LaTeX{LaTeX}\def\BIBTeX{BibTeX}
    \doublespacing\raggedbottom
    \typeout{Wordprocessor-style formatting}}}%
%% v0.93 2011/05/01 Added justified in response to user queries
\newif\ifjustified
\DeclareOption{justified}{\justifiedtrue}
\newif\ifindented\indentedfalse
\DeclareOption{indented}{\indentedtrue}
\newif\iffancy
\fancytrue
\DeclareOption{plainheaders}{\fancyfalse}
%% v0.97 2012/03/31 Added mdiss option
\newif\ifdiss
\DeclareOption{mdiss}{%
  \disstrue
  \fancyfalse
}
\newif\iftermpaper
\DeclareOption{termpaper}{%
  \AtEndOfClass{%
    \degree{}%
    \def\@degree{\relax}%
    \degreefalse}%
  \typeout{Term paper}}
\newif\ifessay
\DeclareOption{essay}{%
  \AtEndOfClass{%
    \degree{}%
    \def\@degree{\relax}%
    \degreefalse}%
  \typeout{Essay}}
\newif\ifUCC@oneside
\UCC@onesidetrue
\def\UCC@sided{oneside}
\DeclareOption{oneside}{
  \UCC@onesidetrue
  \gdef\UCC@sided{oneside}
}
\DeclareOption{twoside}{
  \UCC@onesidefalse
  \gdef\UCC@sided{twoside,openright}
}
%% added openright for Ethan Soudi (untested)
\DeclareOption*{%
   \PackageWarning{uccthesis}{Unknown option ‘\CurrentOption’;
     please Read The Fine Manual}%
}
\ProcessOptions\relax
\LoadClass[\class@mode,titlepage,\UCC@sided,\class@size,
           \class@paper]{report}
%%
%% Packages required
%%
%%
%% UTF-8 is the default character set, to allow for use of any character
%% in any writing system. Some characters are not specified for all
%% fonts, so may have to be specified manually.
\RequirePackage[utf8x]{inputenc}[2008/03/30]
\PrerenderUnicode{–}
\PrerenderUnicode{š}
\PrerenderUnicode{ć}
\PrerenderUnicode{Å}
%%
%% Extended font encoding to handle UTF-8.
\RequirePackage[T1]{fontenc}
%%
%% Package for establishing margins and text area.
\RequirePackage[right=2.5cm,top=3cm,bottom=3cm,
  left=4cm,headheight=22pt]{geometry}
%%
%% The updated Computer Modern typeface as the default.
\RequirePackage{lmodern}
%%
%% Handling of URI formatting.
\RequirePackage[obeyspaces,hyphens,spaces,
  lowtilde]{url}
%%
%% Provide for graphics (PNG, JPG, or PDF format (only) for pdflatex;
%% EPS format (only) for standard LaTeX).
\RequirePackage{graphicx}
%%
%% Additional column formatting for tables.
\RequirePackage{array}
%%
%% Required for the calculation of extra widths for margin adjustment.
\RequirePackage{calc}
%%
%% Provides letter-spacing, strikeout, and underlining.
\RequirePackage{soul}
%%
%% Additional commands for common symbols and punctuation.
\RequirePackage{textcomp}
%%
%% University College Cork crest (restricted).
\RequirePackage{ucccrest}
%%
%% Provide 1½ or double line spacing.
\RequirePackage{setspace}
%%
%% Allows redesigning of floats and creation of new float types.
\RequirePackage{float}
\ifUCC@oneside\else
  \newgeometry{inner=4cm,outer=2.5cm,top=3cm,bottom=3cm,
               headheight=22pt,twoside}
\fi
\ifcjk
  \RequirePackage[encapsulated]{CJK}
  \newcommand{\cjktext}[1]{\begin{CJK}{UTF8}{min}#1\end{CJK}}
\fi
\renewcommand{\bibname}{References}
\ifdiss
    \RequirePackage{natbib}
    \renewcommand{\thesection}{\arabic{section}}
    \bibpunct[: ]{(}{)}{;}{a}{,}{,}
    \setlength{\parskip}{.666\baselineskip plus1ex minus1ex}
    \renewenvironment{thebibliography}[1]
     {\ifUCC@oneside\clearpage\else\cleardoublepage\fi
      \section*{References}%
      \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}
\fi
%% v0.94 2012/03/19 updated (manual comment)
\ifjustified
  \RequirePackage[bottom,stable]{footmisc}
\else
  \RequirePackage{ccaption}
  \captionstyle{\raggedright}%
  \RequirePackage[bottom,ragged,stable]{footmisc}
%   \raggedright %MICHAEL COMMENTED TO GET JUSTIFICATION
\fi
\ifindented
  \parindent1.5em
\else
  \RequirePackage{parskip}
\fi
%% v1.11 2013/07/23 Added replication of columnwidth for use in headers to avoid conflict with longtable and lscape.
\newlength{\UCC@textbodywidth}
\setlength{\UCC@textbodywidth}{\textwidth}
\iffancy
  \message{Fancy mode }%
  \RequirePackage{fancyhdr}
  \pagestyle{fancy}
%% v1.00 2012/06/15 Made plain style for chapter starts retain the page number
%% v1.10 2013/07/09 Added specs for twosided fancy headers
  \ifUCC@oneside
    \message{One-sided plain}%
    \fancypagestyle{plain}{%
      \fancyhf{}
      \cfoot{\thepage}%
      \renewcommand{\headrulewidth}{0pt}
      \renewcommand{\footrulewidth}{0pt}}
  \else
    \message{Two-sided plain}%
    \fancypagestyle{plain}{%
      \fancyhf{}
      \fancyfoot[CO,CE]{\thepage}%
      \renewcommand{\headrulewidth}{0pt}
      \renewcommand{\footrulewidth}{0pt}}
  \fi
  \fancyhf{}
  \newlength{\rheadhang}
  \settowidth{\rheadhang}{\footnotesize\thechapter.\space}
  \ifUCC@oneside
    \message{One-sided fancy headers}%
    \lhead{\ifthenelse{\equal{\leftmark}{\rightmark}}{}{%
      \footnotesize\scshape\parbox[b]{.475\UCC@textbodywidth}{%
        \hangindent\rheadhang\hangafter1\raggedright
          {\let\\\space\leftmark}}}}
    \rhead{\footnotesize\itshape\parbox[b]{.475\UCC@textbodywidth}{%
      \flushright{\let\\\space\rightmark}}}
    \chead{}
  \else
    \message{Two-sided fancy headers}%
    \fancyhead[LE]{\ifthenelse{\equal{\leftmark}{\rightmark}}{}{%
      \footnotesize\scshape\parbox[b]{\UCC@textbodywidth}{%
        \hangindent\rheadhang\hangafter1\raggedright
          {\let\\\space\leftmark}}}}
    \fancyhead[RO]{\footnotesize\itshape
      \parbox[b]{\UCC@textbodywidth}{%
      \flushright{\let\\\space\rightmark}}}
  \fi
%% v0.91 2011/04/28 Zapped the intrusive double backslash in titles affecting the running footers
%% v0.99 2012/04/15 Italicised the thesis title in the footer
  \ifUCC@oneside
    \message{One-sided fancy footers}%
    \lfoot{\fancyplain{}{\footnotesize
      \parbox[t]{.475\UCC@textbodywidth}{%
        \itshape\raggedright{\@@title}}}}%
    \rfoot{\fancyplain{}{\footnotesize\@author}}
    \cfoot{\fancyplain{\small\thepage}{\small\thepage}}
  \else
    \message{Two-sided fancy footers}%
    \fancyfoot[LE]{\fancyplain{}{\footnotesize
       \parbox[t]{.475\UCC@textbodywidth}{%
         \itshape\raggedright{\@@title}}}}
    \fancyfoot[RO]{\fancyplain{}{\footnotesize\@author}}
    \fancyfoot[CE,CO]{\fancyplain{\small\thepage}{\small\thepage}}
  \fi
%% v0.99 2012/04/15 Fixed uppercased headings at last
  \addtolength{\headheight}{10pt}
  \renewcommand{\headrulewidth}{0pt}
\else
  \message{^MPlain (non-fancy) mode }%
\fi
\renewcommand{\chaptermark}[1]{\markboth{\thechapter.\ #1}{}}
\renewcommand{\sectionmark}[1]{\markright{\thesection\ #1}{}}
\def\ps@headings{}
%% v0.70 2010/05/29 Added timestamp
%% v0.96 2012/03/23 Simplified now, added adobedate
\newcounter{hours}
\newcounter{minutes}
\newcounter{temp}
\setcounter{hours}{\time}%
\setcounter{minutes}{\value{hours}}%
\divide\c@hours by60 % hours is now right
\setcounter{temp}{\value{hours}}%
\multiply\c@temp by60 % integer part to deduct
\addtocounter{minutes}{-\value{temp}}% make deduction
\newcommand{\now}{% \time is in minutes since midnight
  \ifnum\c@hours>9\else0\fi\thehours:%
  \ifnum\c@minutes>9\else0\fi\theminutes}
\def\adobedate{D:\number\year
  \ifnum\month>9\else0\fi\number\month
  \ifnum\day>9\else0\fi\number\day\now00}
\def\today{\number\day\space\ifcase\month\or
  January\or February\or March\or
  April\or May\or June\or
  July\or August\or September\or
  October\or November\or December\fi
  \space\number\year}
\def\TODAY{\number\year{-}%
  \ifnum\month<10 0\fi\number\month{-}%
  \ifnum\day<10 0\fi\number\day}
\def\@institution{\so{NATIONAL UNIVERSITY OF IRELAND, CORK}}
\newcommand{\institution}[1]{\gdef\@institution{\so{#1}}}
%% v0.97 2012/03/31 Added author so we can have optional student number
\def\@studno{\relax}
\renewcommand{\author}[2][\relax]{%
   \gdef\@author{#2}
   \if\relax#1 \else\gdef\@studno{#1}\fi}
\def\@subtitle{\relax}
\newcommand{\subtitle}[1]{\gdef\@subtitle{#1}}
\def\@sponsor{\relax}
\newcommand{\sponsor}[1]{\gdef\@sponsor{#1}}
\def\@supervisor{[Name not supplied]}
\def\@supervisorname{Supervisor}
\newcommand{\supervisor}[1]{\gdef\@supervisor{#1}}
\newcommand{\supervisors}[1]{\gdef\@supervisor{#1}%
  \def\@supervisorname{Supervisors}}
\def\@module{\relax}
\newcommand{\module}[1]{\gdef\@module{#1}}
\def\@prof{\relax}
\newcommand{\professor}[1]{\gdef\@prof{#1}}
\def\@quals{\relax}
\newcommand{\qualifications}[1]{\gdef\@quals{#1}}%
\def\@volume{\relax}
\def\@maxvolumes{\relax}
\def\volume #1 of #2 {\gdef\@volume{#1}%
                      \gdef\@maxvolumes{#2}}
\def\@submission{%
  \if\@hospital\relax
  \else\par\textsc{\@hospital}%
  \fi
  \if\@school\relax
  \else\par\textsc{\@school}%
  \fi
  \if\@department\relax
  \else\par\textsc{\@department}%
  \fi
  \if\@institute\relax
  \else\par\textsc{\@institute}%
  \fi
  \if\@centre\relax
  \else\par\textsc{\@centre}%
  \fi
  \if\@unit\relax
  \else\par\textsc{\@unit}%
  \fi
}
%% v0.96 2012/03/23 Added subject and keywords
\def\@subject{Unspecified}
\newcommand{\subject}[1]{\gdef\@subject{#1}}
\def\@keywords{Unspecified}
\newcommand{\keywords}[1]{\gdef\@keywords{#1}}
\newif\ifmadetitle
%% v1.08 2011/04/07 Added the @title and @@title commands
\def\@@title{\relax}
\renewcommand{\title}[2][\relax]{%
  \gdef\@title{#2}%
  \ifthenelse{\equal{#1}{\relax}}{%
    \gdef\@@title{#2}%
    \message{No short title}%
  }{%
    \gdef\@@title{#1}%
    \message{Short title: #1}%
  }%
}
\renewcommand\maketitle{%
  \begin{titlepage}%
    \null
    \ifthesis\vfill\fi
    \begin{center}%
      {\ifthesis\fontsize{28}{32}\selectfont
       \else\LARGE\bfseries\fi\@title \par}%
      \if\@subtitle\relax\else\bigskip
        {\ifthesis\fontsize{24}{28}\selectfont
         \else\Large\bfseries\fi\@subtitle\par}%
      \fi
      \ifthesis
        \if\@volume\relax\else
          \vspace{2pc}{\large Volume \@volume\ of
                       \@maxvolumes\par}%
        \fi
      \fi
      \vspace*{2pc}%
%% v0.90 2011/04/07 Changed author to LARGE size.
      {\LARGE\@author%
\if\relax\@quals\else
          \\\large\scshape\@quals
        \fi
\if\relax\@studno\else
          \\\Large\upshape\@studno
        \fi
\par}%
      \vfill
      \ifthesis{\Large\UCCcrest}\fi
      \par\medskip
      \ifthesis
        \@institution\par
        \vspace*{.5pc}%
      \fi
      \ifthesis
        \@submission\par
        \vspace*{1.5pc}%
      \fi
      \ifthesis
        \textbf{\large Thesis submitted for the degree of
                \\\@degree}\par
      \else
        \large\@module~--- Minor Dissertation\par
      \fi
      \vspace*{1.5pc}%
      \ifthesis
        {\@date \par}%
        \vspace*{2pc}%
      \fi
      \ifthesis
        \begin{tabular}{%
>{\raggedleft\arraybackslash}p{.45\UCC@textbodywidth}%
>{\raggedright\arraybackslash}p{.45\UCC@textbodywidth}}
          \if\@prof\relax\else
              Head of \@unittype:&\@prof\\[1pc]
          \fi
  \@supervisorname:&
          \begin{tabular}[t]{@{}l@{}}\@supervisor\end{tabular}
        \end{tabular}\par\vfill%
      \else
          Supervisor:\quad\@supervisor\par
      \fi
      \vspace*{2pc}%
      \ifthesis\else
        {\@date \par}%
      \fi
      \if\@sponsor\relax\else
        \vfill
Research supported by \@sponsor\par
      \fi
    \end{center}%
    \setcounter{page}{1}%
    \pagestyle{empty}%
  \end{titlepage}%
  \global\let\@thanks\@empty
  \global\let\and\relax
  \global\let\author\relax
  \global\let\centre\relax
  \global\let\college\relax
  \global\let\date\relax
  \global\let\degree\relax
  \global\let\department\relax
  \global\let\faculty\relax
  \global\let\institute\relax
  \global\let\keywords\relax
  \global\let\maketitle\relax
  \global\let\professor\relax
  \global\let\qualifications\relax
  \global\let\school\relax
  \global\let\sponsor\relax
  \global\let\subject\relax
  \global\let\subtitle\relax
  \global\let\supervisor\relax
  \global\let\thanks\relax
  \global\let\title\relax
  \global\let\unit\relax
  \global\let\volume\relax
  \setcounter{footnote}{0}%
  \pagestyle{empty}
  \ifUCC@oneside\clearpage\else\cleardoublepage\fi
  \ifthesis
    \setcounter{secnumdepth}{5}
    \pagenumbering{roman}%
  \else
    \setcounter{secnumdepth}{0}
    \pagenumbering{arabic}
  \fi
  \ifshorttoc\setcounter{tocdepth}{2}%
  \else\setcounter{tocdepth}{3}\fi
  \iffancy
    \pagestyle{fancy}
  \else
    \pagestyle{plain}
  \fi
  \ifthesis
    \tableofcontents
    \iflof\listoffigures\fi
    \iflot\listoftables\fi
    %% \@ifpackageloaded{glossaries}{\printglossary}{\relax}
  \fi
  \madetitletrue
%% v0.96 2012/03/23 Added PDF metadata
%% v0.98 2012/04/02 Moved pdfinfo to the end of maketitle, temporarily nullified the double backslash
  \renewcommand{\\}{ }
  \pdfinfo{%
   /Title (\@title)
   /Author (\@author)
   /CreationDate (\adobedate)
   /Subject (\@subject)
   /Keywords (\@keywords)
  }}
%% v0.90 2011/04/07 Wording from Michelle Nelson.
%% v0.90 2011/04/28 Centering removed from Declaration.
\newif\ifmadedecl
\newcommand{\makedecl}{%
  \ifthesis
    \ifUCC@oneside\clearpage\else\cleardoublepage\fi
    \null\vfill\markboth{}{}%
    \begingroup
    I, \@author, certify that this thesis is my own work
    and I have not obtained a degree in this university
    or elsewhere on the basis of the work submitted in
    this thesis.
    \par\bigskip\flushright\textit{\@author}\par\endgroup
    \vfill
  \fi
  \global\madedecltrue
  \global\UCC@delaydeclfalse}
\renewcommand{\topfraction}{.85}
\renewcommand{\bottomfraction}{.7}
\renewcommand{\textfraction}{.15}
\renewcommand{\floatpagefraction}{.75}
\renewcommand{\dbltopfraction}{.75}
\renewcommand{\dblfloatpagefraction}{.75}
\setcounter{topnumber}{9}
\setcounter{bottomnumber}{9}
\setcounter{totalnumber}{20}
\setcounter{dbltopnumber}{9}
\newenvironment{dedication}{%
  \ifmadetitle\else\maketitle\fi
  \ifmadedecl\else\makedecl\fi
  \clearpage\null\vfill
  \thispagestyle{empty}%
  \begin{center}}{%
  \end{center}\vfill}
\newif\ifUCC@delaydecl
\newcommand{\prelim}{%
  \@ifnextchar *
     {\UCC@delaydecltrue\UCC@prelim}
     {\UCC@delaydeclfalse\UCC@prelim{*}}}
\newcommand{\UCC@prelim}[2]{% dummy first arg
  \ifmadetitle\else\maketitle\fi
  \ifmadedecl\else
    \ifUCC@delaydecl\else\makedecl\fi
  \fi
  \ifUCC@oneside\clearpage\else\cleardoublepage\fi
  \section*{#2}\@mkboth{{#2}}{{#2}}%
  \addcontentsline{toc}{section}{#2}%
  \onehalfspacing}
\newcommand{\refsec}[1]{%
  \ifUCC@oneside\clearpage\else\cleardoublepage\fi
  \section*{#1}\@mkboth{{#1}}{{#1}}%
  \addcontentsline{toc}{section}{#1}%
  \singlespacing}
\newcommand{\ackname}{Acknowledgements}
%% v1.11 2013/07/23 Added maketitle test to acknowledgements.
\newenvironment{acknowledgements}{%
  \ifmadetitle\else\maketitle\fi
  \ifmadedecl\else\makedecl\fi
  \prelim{\ackname}\singlespacing
}{}%
\renewcommand\tableofcontents{%
  \section*{\contentsname
    \@mkboth{\contentsname}{\contentsname}}%
  \@starttoc{toc}%
}
\renewcommand\listoffigures{%
  \ifUCC@oneside\clearpage\else\cleardoublepage\fi
  \section*{\listfigurename
    \@mkboth{\listfigurename}{\listfigurename}}%
  \addcontentsline{toc}{section}{\listfigurename}%
  \@starttoc{lof}%
}
\renewcommand\listoftables{%
  \ifUCC@oneside\clearpage\else\cleardoublepage\fi
  \section*{\listtablename
    \@mkboth{\listtablename}{\listtablename}}%
  \addcontentsline{toc}{section}{\listtablename}%
  \@starttoc{lot}%
}
\renewenvironment{abstract}{%
  \ifmadetitle\else\maketitle\fi
  \ifmadedecl\else\makedecl\fi
  \ifUCC@oneside\clearpage\else\cleardoublepage\fi
  \@beginparpenalty\@lowpenalty
  \section*{\abstractname}%
  \addcontentsline{toc}{section}{\abstractname}%
  \markboth{\abstractname}{\abstractname}%
  \onehalfspacing
}{%
  \clearpage
}
\renewenvironment{theindex}{%
  \ifUCC@oneside\clearpage\else\cleardoublepage\fi
  \columnseprule \z@
  \columnsep 35\p@
  \twocolumn[\section*{\indexname}]%
  \@mkboth{\indexname}{\indexname}%
  \parindent\z@
  \parskip\z@ \@plus .3\p@\relax
  \let\item\@idxitem}%
 {\clearpage}
\renewcommand\part{% MOD commented this to clear error
  \ifmadetitle\else\maketitle\fi
  \ifmadedecl\else\madedecl\fi
  \if@openright
    \cleardoublepage
  \else
    \clearpage
  \fi
  \thispagestyle{plain}%
  \if@twocolumn
    \onecolumn
    \@tempswatrue
  \else
    \@tempswafalse
  \fi
  \null\vfil
  \ifnum\c@part=0
    \pagenumbering{arabic}%
    \onehalfspacing
  \fi
  \secdef\@part\@spart}
% v0.99 2012/04/15 Changed onehalfspacing to setstretch of 1.333 for prelims and moved the main 1.666 one to here.
% v0.99 2012/04/16 Changed it back.
\renewcommand{\chapter}{%
  \ifmadetitle\else\maketitle\fi
  \ifmadedecl\else\makedecl\fi
  \if@openright\cleardoublepage\else\clearpage\fi
  \thispagestyle{plain}%
  \global\@topnum\z@
  \ifnum\c@chapter=0
    \ifnum\c@part=0
      \ifthenelse{\equal{\@chapapp}{\chaptername}}%
                 {\pagenumbering{arabic}\onehalfspacing}%
                 {}%
    \fi
  \fi
  \@afterindentfalse
  \secdef\@chapter\@schapter}
\newif\ifoptarg
\def\@opttest#1#2\sentinel{\ifx[#1\optargtrue
      \else\optargfalse\fi}
%% v0.92 2011/05/31 Added Epigraphs.
\newenvironment{epigraph}[2][\relax]{%
  \gdef\@fullcite{#1}%
  \gdef\@quotcite{#2}%
  \list{}{%
    \listparindent 1.5em%
    \itemindent    \listparindent
    \rightmargin   \leftmargin
    \parsep        \z@ \@plus\p@}%
  \item\relax\noindent\small\itshape\ignorespaces
}{%
    {\unskip\nobreak\hfil\penalty50
    \hskip2em\hbox{}\nobreak\hfil\upshape\footnotesize
      \if\@fullcite\relax\else\@fullcite\fi
      \ifthenelse{\equal{\@quotcite}{}}{%
        \if\@fullcite\relax(Anon.)\fi}{%
        \expandafter\@opttest\@quotcite\sentinel
        \ifoptarg\expandafter\cite\@quotcite
        \else\cite{\@quotcite}\fi}%
%% v1.00 2012/06/11 Added new positional code for citations to epigraphs
    \parfillskip\z@\finalhyphendemerits=0\par}%
    \medskip
    \endlist\@afterheading}%
\newlength{\mainparskip}
\newlength{\mainparindent}
\renewenvironment{quotation}[1][\relax]{%
  \setlength{\mainparskip}{\parskip}%
  \setlength{\mainparindent}{\parindent}%
  \gdef\@quotcite{#1}%
  \smallskip
  \list{}{%
    \listparindent 1.5em%
    \itemindent    \listparindent
    \rightmargin   \leftmargin
    \parsep        \z@ \@plus\p@}%
  \item\relax\small
  \setlength{\parindent}{\mainparindent}%
  \setlength{\parskip}{\mainparskip}%
  \noindent\ignorespaces
}{%
  \if\@quotcite\relax\else{%
%% v1.00 2012/06/11 Added new positional code for citations to block quotations
%% v1.04 2013/02/08 Removed footnotesize for citation, changed hfil to hfill, and moved the parfillskip and finalhyphendemerits earlier
    \unskip\nobreak\hfil\penalty50
    \parfillskip\z@\finalhyphendemerits=0
    \hskip2em\hbox{}\nobreak\hfill
      \expandafter\@opttest\@quotcite\sentinel
      \ifoptarg\expandafter\cite\@quotcite
      \else\cite{\@quotcite}\fi\par}%
  \fi\medskip\endlist
  \@afterheading\noindent\ignorespaces}%
%% v0.99 2012/04/22 Removed code for altering layout of description lists, as the modifications were not working consistently
%% v1.07 2013/05/06 Added a setlist command via prepost to preset description lists to the unboxed option
\sodef\so{}{.1em}{.5em plus.5em}{1em plus1em}
\setlength{\abovecaptionskip}{.5\baselineskip}
\setlength{\belowcaptionskip}{.5\baselineskip}
\floatstyle{plaintop}
\restylefloat{table}
\floatstyle{plain}
\restylefloat{figure}
%% v0.90 2011/04/28 Changed pnumwidth.
\renewcommand\@pnumwidth{2em}%
\def\inch{\ifmmode{}^{\prime\prime}\else$
                  {}^{\prime\prime}$\fi}
\newcommand{\me}{\@author}
\newcommand{\signature}[1][\relax]{%
  \begin{flushright}\small\me\\
    \if#1\relax\else#1, \fi\@date
  \end{flushright}}
\newcommand{\tm}{\raisebox{2pt}{%
                 \scriptsize\textsf{\texttrademark}}}
\newcommand{\etc}{etc.\ }
\newcommand{\eg}{e.g.\ }
\newcommand{\ie}{i.e.\ }
\hyphenation{%
Regi-strar
Sebas-tian
analy-sis
Analy-sis
analy-ses
Analy-ses
bre-vi-ty
chan-ges
de-fi-ning
docu-ment
epex-e-ge-sis
epex-e-ge-ses
exa-mined
helico-pter
hier-ar-chy
inter-linea-ted
lexi-cal
manu-script
re-fe-ren-ces
re-prin-ted
smal-ler
spe-ci-fy
sub-con-sci-ous-ly
tech-no-logy
typo-gra-phy
no-men-cla-ture
}
\let\foreign\emph
\newcommand{\marginal}[1]{%
  \marginpar{\sffamily\tiny\raggedright#1\par}}
%% v0.99 2012/04/07 Added typeout to bibliography
\def\bibliography#1{%
  \if@filesw
    \immediate\write\@auxout{\string\bibdata{#1}}%
  \fi
  \typeout{\bibname\space.}%
  \@input@{\jobname.bbl}}
%% v0.99 2012/04/15 Changed onehalfspacing to setstretch of 1.333 for prelims and moved the main 1.666 one to the start of the first part or chapter.
%% v0.99 2012/04/16 Changed it back to single spacing for prelims and one and ahalf spacing for the rest.
\raggedbottom
\message{UCC thesis class loaded}

\endinput
%%
%% End of file `uccthesis.cls'.
