0

enter image description here

I have a problem with compiling my LaTeX script and I have this error:

Missing \endcsname inserted

Here is the thesis template which I run and the error basically comes from the line that I have: \begin{document}.

Any idea how to fix it?

% MNRAS Manuscript Template
\documentclass[useams,onecolumn,usenatbib,twoside]{Thesis}
%\pdfminorversion=5
%
\usepackage[T1]{fontenc}
%
\usepackage{fancyhdr}
\pagestyle{fancy}
%
\usepackage{titlesec}
\usepackage{graphicx}
\usepackage{longtable}
\usepackage{lettrine}
%
\usepackage{enumitem} %use to remove spacing in bullet points
%
\usepackage{natbib}
\usepackage{amsmath}
\usepackage{setspace}
%\usepackage{pdfpages}
%\usepackage[times,hyper]{Rd}
\usepackage[utf8,latin1]{inputenc}
%\includepdfset{offset=2cm -2cm}
\usepackage{setspace}
%\usepackage{lscape}
\usepackage{makeidx}
\usepackage{pdflscape,array,booktabs}
\usepackage{rotating}
\graphicspath{{./images/}}
\usepackage[table,xcdraw,svgnames]{xcolor}
%\usepackage[colorlinks=true,
%           citecolor=blue,
%           linkcolor=blue,
%           urlcolor=red,
%           linktocpage=true,
%           hyperfootnotes=false]{hyperref}
\hypersetup{final}
\hypersetup{citecolor=CornflowerBlue}
\hypersetup{linkcolor=CornflowerBlue}
\hypersetup{urlcolor=CornflowerBlue}
\def\Planck{\,{\em Planck}}
\def\ie{\,{\rm i.e.}\,}
\def\eg{\,{\rm e.g.}\,}
\def\um{{\rm $\mu$m}\,}
\def\sdss{{\sc sdss}}
\def\viking{{\sc viking}}
\def\hatlas{{\sc h-atlas}}
\def\wise{{\em WISE}}
\def\vista{{\sc vista}}
\def\galex{{\em GALEX}}
\def\lambdar{{\sc lambdar}}
\def\lamsc{{\sc lambdar}}
\def\magphys{{\sc magphys}}
\def\interest{{\sc interest}}
\def\bbf{}
%
% For Revisions: use \bbf to make revised text bold,
%                and uncomment the below. For final
%                submission, re-comment the line to
%                remove the bold-ness.
%\def\bbf{\bf}

\newcommand\aap{A\&A}                % Astronomy and Astrophysics
\let\astap=\aap                          % alternative shortcut
\newcommand\aapr{A\&ARv}             % Astronomy and Astrophysics Review (the)
\newcommand\aaps{A\&AS}              % Astronomy and Astrophysics Supplement Series
\newcommand\actaa{Acta Astron.}      % Acta Astronomica
\newcommand\afz{Afz}                 % Astrofizika
\newcommand\aj{AJ}                   % Astronomical Journal (the)
\newcommand\ao{Appl. Opt.}           % Applied Optics
\let\applopt=\ao                         % alternative shortcut
\newcommand\aplett{Astrophys.~Lett.} % Astrophysics Letters
\newcommand\apj{ApJ}                 % Astrophysical Journal
\newcommand\apjl{ApJ}                % Astrophysical Journal, Letters
\let\apjlett=\apjl                       % alternative shortcut
\newcommand\apjs{ApJS}               % Astrophysical Journal, Supplement
\let\apjsupp=\apjs                       % alternative shortcut
% The following journal does not appear to exist! Disabled.
%\newcommand\apspr{Astrophys.~Space~Phys.~Res.} % Astrophysics Space Physics Research
\newcommand\apss{Ap\&SS}             % Astrophysics and Space Science
\newcommand\araa{ARA\&A}             % Annual Review of Astronomy and Astrophysics
\newcommand\arep{Astron. Rep.}       % Astronomy Reports
\newcommand\aspc{ASP Conf. Ser.}     % ASP Conference Series
\newcommand\azh{Azh}                 % Astronomicheskii Zhurnal
\newcommand\baas{BAAS}               % Bulletin of the American Astronomical Society
\newcommand\bac{Bull. Astron. Inst. Czechoslovakia} % Bulletin of the Astronomical Institutes of Czechoslovakia
\newcommand\bain{Bull. Astron. Inst. Netherlands} % Bulletin Astronomical Institute of the Netherlands
\newcommand\caa{Chinese Astron. Astrophys.} % Chinese Astronomy and Astrophysics
\newcommand\cjaa{Chinese J.~Astron. Astrophys.} % Chinese Journal of Astronomy and Astrophysics
\newcommand\fcp{Fundamentals Cosmic Phys.}  % Fundamentals of Cosmic Physics
\newcommand\gca{Geochimica Cosmochimica Acta}   % Geochimica Cosmochimica Acta
\newcommand\grl{Geophys. Res. Lett.} % Geophysics Research Letters
\newcommand\iaucirc{IAU~Circ.}       % IAU Cirulars
\newcommand\icarus{Icarus}           % Icarus
\newcommand\japa{J.~Astrophys. Astron.} % Journal of Astrophysics and Astronomy
\newcommand\jcap{J.~Cosmology Astropart. Phys.} % Journal of Cosmology and Astroparticle Physics
\newcommand\jcp{J.~Chem.~Phys.}      % Journal of Chemical Physics
\newcommand\jgr{J.~Geophys.~Res.}    % Journal of Geophysics Research
\newcommand\jqsrt{J.~Quant. Spectrosc. Radiative Transfer} % Journal of Quantitiative Spectroscopy and Radiative Transfer
\newcommand\jrasc{J.~R.~Astron. Soc. Canada} % Journal of the RAS of Canada
\newcommand\memras{Mem.~RAS}         % Memoirs of the RAS
\newcommand\memsai{Mem. Soc. Astron. Italiana} % Memoire della Societa Astronomica Italiana
\newcommand\mnassa{MNASSA}           % Monthly Notes of the Astronomical Society of Southern Africa
\newcommand\mnras{MNRAS}             % Monthly Notices of the Royal Astronomical Society
%\newcommand\na{New~Astron.}          % New Astronomy
\newcommand\nar{New~Astron.~Rev.}    % New Astronomy Review
\newcommand\nat{Nature}              % Nature
\newcommand\nphysa{Nuclear Phys.~A}  % Nuclear Physics A
\newcommand\phdt{PhD.T}        % PhD Thesis
\newcommand\pra{Phys. Rev.~A}        % Physical Review A: General Physics
\newcommand\prb{Phys. Rev.~B}        % Physical Review B: Solid State
\newcommand\prc{Phys. Rev.~C}        % Physical Review C
\newcommand\prd{Phys. Rev.~D}        % Physical Review D
\newcommand\pre{Phys. Rev.~E}        % Physical Review E
\newcommand\prl{Phys. Rev.~Lett.}    % Physical Review Letters
\newcommand\pasa{Publ. Astron. Soc. Australia}  % Publications of the Astronomical Society of Australia
\newcommand\pasp{PASP}               % Publications of the Astronomical Society of the Pacific
\newcommand\pasj{PASJ}               % Publications of the Astronomical Society of Japan
\newcommand\physrep{Phys.~Rep.}      % Physics Reports
\newcommand\physscr{Phys.~Scr.}      % Physica Scripta
\newcommand\planss{Planet. Space~Sci.} % Planetary Space Science
\newcommand\procspie{Proc.~SPIE}     % Proceedings of the Society of Photo-Optical Instrumentation Engineers
\newcommand\rmxaa{Rev. Mex. Astron. Astrofis.} % Revista Mexicana de Astronomia y Astrofisica
\newcommand\qjras{QJRAS}             % Quarterly Journal of the RAS
\newcommand\sci{Science}             % Science
\newcommand\skytel{Sky \& Telesc.}   % Sky and Telescope
\newcommand\solphys{Sol.~Phys.}      % Solar Physics
\newcommand\sovast{Soviet~Ast.}      % Soviet Astronomy (aka Astronomy Reports)
\newcommand\ssr{Space Sci. Rev.}     % Space Science Reviews
\newcommand\zap{Z.~Astrophys.}       % Zeitschrift fuer Astrophysik

%%%%%
% Rd functions
%%%%%
%\def\AsIs{\bgroup\let\do\@makeother\Rd@AsIs@dospecials\@noligs\obeylines\@vobeyspaces\parskip\z@skip\Rd@AsIsX}
%\def\Rd@AsIs@dospecials{\do\$\do\&\do\#\do\^\do\_\do\%\do\~}
%\def\Rd@AsIsX#1{\normalfont #1\egroup}
% Arxiver Figure selection: Declare Figures to show on Arxiver
% ___Leave Commented out, just change the Figure Names___
% __Just use Figure Names, Path is determined internally__
%@arxiver{Figure1.png,Figure4.pdf,Figure5.eps}

\newcommand{\HRule}{\rule{\linewidth}{0.5mm}}

%%%%%
\makeatletter
\def\thickhrulefill{\leavevmode \leaders \hrule height 1ex \hfill \kern \z@}
\def\@makechapterhead#1{%
    %\vspace*{50\p@}%
    \vspace*{10\p@}%
    {\parindent \z@ \centering \reset@font
        \thickhrulefill\quad
        \scshape \@chapapp{} \thechapter
        \quad \thickhrulefill
        \par\nobreak
        \vspace*{10\p@}%
        \interlinepenalty\@M
        \hrule
        \vspace*{10\p@}%
        \Huge \bfseries #1\par\nobreak
        \par
        \vspace*{10\p@}%
        \hrule
        %\vskip 40\p@
        \vskip 100\p@
}}
\def\@makeschapterhead#1{%
    %\vspace*{50\p@}%
    \vspace*{10\p@}%
    {\parindent \z@ \centering \reset@font
        \thickhrulefill
        \par\nobreak
        \vspace*{10\p@}%
        \interlinepenalty\@M
        \hrule
        \vspace*{10\p@}%
        \Huge \bfseries #1\par\nobreak
        \par
        \vspace*{10\p@}%
        \hrule
        %\vskip 40\p@
        \vskip 100\p@
}}
%%%%%
\makeindex{}
\begin{document}
%\pagestyle{plain}
\pagenumbering{roman}
\DeclareGraphicsExtensions{.pdf,.png,.gif,.jpg}
%----------------------------------------------------------------------------------
%               Title Page
%----------------------------------------------------------------------------------
\begin{titlepage}
    \begin{center}



    \textsc {\LARGE The University of SomeWhere}\\[0.5cm]
    \textsc {\LARGE  \& }\\[0.5cm]
    \textsc {\LARGE }\\[0.2cm]
    \textsc {\LARGE }\\[1.5cm]
    \textsc{School of Lablab}\\[0.5cm]
    \LARGE PhD Thesis\\[0.5cm]

    % Title
    \HRule \\[0.4cm]
    { \huge \bfseries
My Thesis Title
}\\[0.4cm]
    \HRule \\[0.5cm]


% Author and supervisor
\begin{minipage}{0.45\textwidth}
\begin{flushleft} \large
\emph{Author:}\\
S \textsc{K\vspace{2cm}}
\end{flushleft}
\end{minipage}
\begin{minipage}{0.45\textwidth}
\begin{flushright} \large
\emph{Supervisors:} \\
W/Prof. S \textsc{D}\\
A/Prof. A \textsc{R}\\
Dr. L \textsc{D}
\end{flushright}
\end{minipage}

\vfill

 \begin{minipage}{0.7\textwidth}
  \centering
  \includegraphics[width=1\textwidth]{./images/logo.png}
 \end{minipage} \\[0.5cm]

    % Bottom of the page
    {\large \today}

    \end{center}
\end{titlepage}

%----------------------------------------------------------------------------------
%               Preamble
%----------------------------------------------------------------------------------

\clearpage
\include{Preamble}
\cleardoublepage
\pagenumbering{arabic}


%----------------------------------------------------------------------------------
%               Content
%----------------------------------------------------------------------------------
%Chapter One: Introduction
\include{ChapterOne}
%Chapter Two: 
\include{ChapterTwo}
%Chapter Three: 
\include{ChapterThree}
%Chapter Four: 
\include{ChapterFour}
%Chapter Five: 
\include{ChapterFive}
%Chapter Six: 
\include{ChapterSix}


\cleardoublepage
\addcontentsline{toc}{chapter}{References}
\bibliographystyle{mnras}
\bibliography{library}
\appendix
\include{AppendixOne}
\include{AppendixTwo}
\include{AppendixThree}
\printindex{}
\end{document}

and here is the Thesis.cls:

%% This is file `Thesis.cls', based on 'ECSthesis.cls', by Steve R. Gunn  
%% generated with the docstrip utility.
%%
%% Created by Steve R. Gunn, modified by Sunil Patel: www.sunilpatel.co.uk

\NeedsTeXFormat{LaTeX2e}[1996/12/01]

\ProvidesClass{Thesis}
              [2007/22/02 v1.0
   LaTeX document class]
\def\baseclass{book}
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{\baseclass}}
\def\@checkoptions#1#2{
  \edef\@curroptions{\@ptionlist{\@currname.\@currext}}
  \@tempswafalse
  \@tfor\@this:=#2\do{
    \@expandtwoargs\in@{,\@this,}{,\@curroptions,}
    \ifin@ \@tempswatrue \@break@tfor \fi}
  \let\@this\@empty
  \if@tempswa \else \PassOptionsToClass{#1}{\baseclass}\fi
}
\@checkoptions{12pt}{{10pt}{11pt}{12pt}}
\PassOptionsToClass{a4paper}{\baseclass}
\ProcessOptions\relax
\LoadClass{\baseclass}
\newcommand\bhrule{\typeout{------------------------------------------------------------------------------}}

\usepackage{geometry}
\newcommand\Declaration[1]{
\btypeout{Declaration of Authorship}
\addtotoc{Declaration of Authorship}
\thispagestyle{plain}
\null\vfil
%\vskip 60\p@
\begin{center}{\huge\bf Declaration of Authorship\par}\end{center}
%\vskip 60\p@
{\normalsize #1}
\vfil\vfil\null
%\cleardoublepage
}

\newcommand\btypeout[1]{\bhrule\typeout{\space #1}\bhrule}
\def\today{\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}
\usepackage{setspace}
\onehalfspacing
\setlength{\parindent}{0pt}
\setlength{\parskip}{2.0ex plus0.5ex minus0.2ex}
\usepackage{vmargin}
\setmarginsrb           { 4cm}  % left margin
                        { 2cm}  % top margin
                        { 2cm}  % right margin
                        { 2cm}  % bottom margin
                        {  10pt}  % head height
                        {0.25in}  % head sep
                        {   9pt}  % foot height
                        { 0.3in}  % foot sep

\raggedbottom
%\setlength{\topskip}{1\topskip \@plus 5\p@}
\doublehyphendemerits=10000       % No consecutive line hyphens.
\brokenpenalty=10000              % No broken words across columns/pages.
\widowpenalty=9999                % Almost no widows at bottom of page.
\clubpenalty=9999                 % Almost no orphans at top of page.
\interfootnotelinepenalty=9999    % Almost never break footnotes.
\usepackage{fancyhdr}
\lhead[\rm\thepage]{\fancyplain{}{\sl{\rightmark}}}
\rhead[\fancyplain{}{\sl{\leftmark}}]{\rm\thepage}
\chead{}\lfoot{}\rfoot{}\cfoot{}
\pagestyle{fancy}
\renewcommand{\chaptermark}[1]{\btypeout{\thechapter\space #1}\markboth{\@chapapp\ \thechapter\ #1}{\@chapapp\ \thechapter\ #1}}
\renewcommand{\sectionmark}[1]{}
\renewcommand{\subsectionmark}[1]{}
\def\cleardoublepage{\clearpage\if@twoside \ifodd\c@page\else
\hbox{}
\thispagestyle{empty}
\newpage
\if@twocolumn\hbox{}\newpage\fi\fi\fi}
\usepackage{amsmath,amsfonts,amssymb,amscd,amsthm,xspace}
\theoremstyle{plain}
\newtheorem{example}{Example}[chapter]
\newtheorem{theorem}{Theorem}[chapter]
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{axiom}[theorem]{Axiom}
\theoremstyle{definition}
\newtheorem{definition}[theorem]{Definition}
\theoremstyle{remark}
\newtheorem{remark}[theorem]{Remark}
\usepackage[centerlast,small,sc]{caption}
\setlength{\captionmargin}{20pt}
\newcommand{\fref}[1]{Figure~\ref{#1}}
\newcommand{\tref}[1]{Table~\ref{#1}}
\newcommand{\eref}[1]{Equation~\ref{#1}}
\newcommand{\cref}[1]{Chapter~\ref{#1}}
\newcommand{\sref}[1]{Section~\ref{#1}}
\newcommand{\aref}[1]{Appendix~\ref{#1}}
\renewcommand{\topfraction}{0.85}
\renewcommand{\bottomfraction}{.85}
\renewcommand{\textfraction}{0.1}
\renewcommand{\dbltopfraction}{.85}
\renewcommand{\floatpagefraction}{0.75}
\renewcommand{\dblfloatpagefraction}{.75}
\setcounter{topnumber}{9}
\setcounter{bottomnumber}{9}
\setcounter{totalnumber}{20}
\setcounter{dbltopnumber}{9}
\usepackage{graphicx}
\usepackage{epstopdf}
\usepackage[scriptsize]{subfigure}
\usepackage{booktabs}
\usepackage{rotating}
\usepackage{listings}
%\usepackage{lstpatch}
\lstset{captionpos=b,
        frame=tb,
        basicstyle=\scriptsize\ttfamily,
        showstringspaces=false,
        keepspaces=true}
\lstdefinestyle{matlab} {
        language=Matlab,
        keywordstyle=\color{blue},
        commentstyle=\color[rgb]{0.13,0.55,0.13}\em,
        stringstyle=\color[rgb]{0.7,0,0} }
\usepackage[pdfpagemode={UseOutlines},bookmarks=true,bookmarksopen=true,
   bookmarksnumbered=true,hypertexnames=true,
   colorlinks,linkcolor={blue},citecolor={green},urlcolor={blue},
   pdfstartview={FitV},unicode,breaklinks=true]{hyperref}
\usepackage[colorlinks]{hyperref}
\pdfstringdefDisableCommands{
   \let\\\space
}
\newcommand*{\supervisor}[1]{\def\supname{#1}}
\newcommand*{\examiner}[1]{\def\examname{#1}}
\newcommand*{\degree}[1]{\def\degreename{#1}}
\newcommand*{\authors}[1]{\def\authornames{#1}}
\newcommand*{\addresses}[1]{\def\addressnames{#1}}
\newcommand*{\university}[1]{\def\univname{#1}}
\newcommand*{\UNIVERSITY}[1]{\def\UNIVNAME{#1}}
\newcommand*{\department}[1]{\def\deptname{#1}}
\newcommand*{\DEPARTMENT}[1]{\def\DEPTNAME{#1}}
\newcommand*{\group}[1]{\def\groupname{#1}}
\newcommand*{\GROUP}[1]{\def\GROUPNAME{#1}}
\newcommand*{\faculty}[1]{\def\facname{#1}}
\newcommand*{\FACULTY}[1]{\def\FACNAME{#1}}
\newcommand*{\subject}[1]{\def\subjectname{#1}}
\newcommand*{\keywords}[1]{\def\keywordnames{#1}}
\supervisor  {}
\examiner    {}
\degree      {}
\authors     {}
\university  {\texorpdfstring{\href{University Web Site URL Here (include http://)}
                {The University}}
                {The University}}
\UNIVERSITY  {\texorpdfstring{\href{University Web Site URL Here (include http://)}
                {THE UNIVERSITY}}
                {THE UNIVERSITY}}
\department  {\texorpdfstring{\href{Department or School Web Site URL Here (include http://)}
                {School}}
                {School}}
\DEPARTMENT  {\texorpdfstring{\href{Department or School Web Site URL Here (include http://)}
                {SCHOOL OF PHYSICS}}
                {SCHOOL OF PHYSICS}}
\group       {\texorpdfstring{\href{Research Group Web Site URL Here (include http://)}
                {International}}
                {International}}
\GROUP       {\texorpdfstring{\href{Research Group Web Site URL Here (include http://)}
                {INTERNATIONAL}}
                {INTERNATIONAL}}
\faculty     {\texorpdfstring{\href{Faculty Web Site URL Here (include http://)}
                {Physical Science}}
                {Physical Science}}
\FACULTY     {\texorpdfstring{\href{Faculty Web Site URL Here (include http://)}
                {PHYSICAL SCIENCE}}
                {PHYSICAL SCIENCE}}
\addresses   {}
\subject     {}
\keywords    {}
\renewcommand\maketitle{
  \btypeout{Title Page}
  \hypersetup{pdftitle={\@title}}
  \hypersetup{pdfsubject=\subjectname}
  \hypersetup{pdfauthor=\authornames}
  \hypersetup{pdfkeywords=\keywordnames}
  \thispagestyle{empty}
  \begin{titlepage}
    \let\footnotesize\small
    \let\footnoterule\relax
    \let \footnote \thanks
    \setcounter{footnote}{0}
    \null\vfil
    \vskip 60\p@
    \begin{center}
      \setlength{\parskip}{0pt}
      {\large\textbf{\UNIVNAME}\par}
      \vfill
      {\huge \bf \@title \par}
      \vfill
      {\LARGE by \par}
      \smallskip
      {\LARGE \authornames \par}
      \vfill
      {\large This thesis is presented for the degree of \par}
      {\large Doctor of Philosophy \par}
    {\large at the University  \par}
      \bigskip
      \bigskip
      \bigskip
      {\Large \@date \par}
      \bigskip
    \end{center}
    \par
    \@thanks
    \vfil\null
  \end{titlepage}
  \setcounter{footnote}{0}%
  \global\let\thanks\relax
  \global\let\maketitle\relax
  \global\let\@thanks\@empty
  \global\let\@author\@empty
  \global\let\@date\@empty
  \global\let\@title\@empty
  \global\let\title\relax
  \global\let\author\relax
  \global\let\date\relax
  \global\let\and\relax
  \cleardoublepage
}
\newenvironment{abstract}
{
  \btypeout{Abstract Page}
  \thispagestyle{empty}
  \null\vfil
  \begin{center}
    \setlength{\parskip}{0pt}
    {\huge{\textit{Abstract}} \par}
  \end{center}
}
{
  \vfil\vfil\vfil\null
  \cleardoublepage
}
\addtocounter{secnumdepth}{1}
\setcounter{tocdepth}{6}
\newcounter{dummy}
\newcommand\addtotoc[1]{
\refstepcounter{dummy}
\addcontentsline{toc}{chapter}{#1}}
\renewcommand\tableofcontents{
\btypeout{Table of Contents}
\begin{spacing}{1}{
    \setlength{\parskip}{1pt}
    \if@twocolumn
      \@restonecoltrue\onecolumn
    \else
      \@restonecolfalse
    \fi
    \chapter*{\contentsname
        \@mkboth{
           \MakeUppercase\contentsname}{\MakeUppercase\contentsname}}
    \@starttoc{toc}
    \if@restonecol\twocolumn\fi
   \cleardoublepage
}\end{spacing}
}
\renewcommand\listoffigures{
\btypeout{List of Figures}
\addtotoc{List of Figures}
\begin{spacing}{1}{
    \setlength{\parskip}{1pt}
    \if@twocolumn
      \@restonecoltrue\onecolumn
    \else
      \@restonecolfalse
    \fi
    \chapter*{\listfigurename
      \@mkboth{\MakeUppercase\listfigurename}
              {\MakeUppercase\listfigurename}}
    \@starttoc{lof}
    \if@restonecol\twocolumn\fi
    \cleardoublepage
}\end{spacing}
}
\renewcommand\listoftables{
\btypeout{List of Tables}
\addtotoc{List of Tables}
\begin{spacing}{1}{
    \setlength{\parskip}{1pt}
    \if@twocolumn
      \@restonecoltrue\onecolumn
    \else
      \@restonecolfalse
    \fi
    \chapter*{\listtablename
      \@mkboth{
          \MakeUppercase\listtablename}{\MakeUppercase\listtablename}}
    \@starttoc{lot}
    \if@restonecol\twocolumn\fi
    \cleardoublepage
}\end{spacing}
}
\newcommand\listsymbolname{Abbreviations}
\usepackage{longtable}
\newcommand\listofsymbols[2]{
\btypeout{\listsymbolname}
\addtotoc{\listsymbolname}
    \chapter*{\listsymbolname
      \@mkboth{
          \MakeUppercase\listsymbolname}{\MakeUppercase\listsymbolname}}
\begin{longtable}[c]{#1}#2\end{longtable}\par
    \cleardoublepage
}
\newcommand\listconstants{Physical Constants}
\usepackage{longtable}
\newcommand\listofconstants[2]{
\btypeout{\listconstants}
\addtotoc{\listconstants}
    \chapter*{\listconstants
      \@mkboth{
          \MakeUppercase\listconstants}{\MakeUppercase\listconstants}}
\begin{longtable}[c]{#1}#2\end{longtable}\par
    \cleardoublepage
}
\newcommand\listnomenclature{Symbols}
\usepackage{longtable}
\newcommand\listofnomenclature[2]{
\btypeout{\listnomenclature}
\addtotoc{\listnomenclature}
    \chapter*{\listnomenclature
      \@mkboth{
          \MakeUppercase\listnomenclature}{\MakeUppercase\listnomenclature}}
\begin{longtable}[c]{#1}#2\end{longtable}\par
    \cleardoublepage
}
\newcommand\acknowledgements[1]{
\btypeout{Acknowledgements}
\addtotoc{Acknowledgements}
\thispagestyle{plain}
\begin{center}{\huge{\textit{Acknowledgements}} \par}\end{center}
{\normalsize #1}
\vfil\vfil\null

}
\newcommand\dedicatory[1]{
\btypeout{Dedicatory}
\thispagestyle{plain}
\null\vfil
\vskip 60\p@
\begin{center}{\Large \sl #1}\end{center}
\vfil\null
\cleardoublepage
}
\renewcommand\backmatter{
  \if@openright
    \cleardoublepage
  \else
    \clearpage
  \fi
  \addtotoc{\bibname}
  \btypeout{\bibname}
  \@mainmatterfalse}
\endinput
%%
%% End of file `Thesis.cls'.

and finally my Preamble.tex as:

%
% Preamble
%
%----------------------------------------------------------------------------------
%               Abstract
%----------------------------------------------------------------------------------

\cleardoublepage
\begin{minipage}{13cm}
\addcontentsline{toc}{chapter}{Abstract}
\begin{center}
\vspace{0.25in}
{\Huge \bfseries Abstract}
\end{center}
\input{Abstract}
\end{minipage}
\clearpage

%----------------------------------------------------------------------------------
%               Quote
%----------------------------------------------------------------------------------

\thispagestyle{empty}
\begin{minipage}{13cm}
\vspace{3in}
\begin{center}
%{\Large\hfill``This is a terrible choice for a quote!''\hfill }\\
\end{center}
\end{minipage}
\clearpage
\thispagestyle{empty}

%----------------------------------------------------------------------------------
%               Acknowledgements
%----------------------------------------------------------------------------------

%Acknowledgements
\clearpage
\begin{minipage}{13cm}
\addcontentsline{toc}{chapter}{Acknowledgements}
\begin{center}
\vspace{1in}
{\Huge \bfseries Acknowledgements}
\end{center}
\input{Acknowledgements}
\end{minipage}

%----------------------------------------------------------------------------------
%               ToC
%----------------------------------------------------------------------------------

\clearpage
\tableofcontents

%----------------------------------------------------------------------------------
%               LoF
%----------------------------------------------------------------------------------

\clearpage
\listoffigures

%----------------------------------------------------------------------------------
%               LoT
%----------------------------------------------------------------------------------

\clearpage
\listoftables

%----------------------------------------------------------------------------------
%               Preface
%----------------------------------------------------------------------------------

\clearpage
\begin{minipage}{13cm}
\begin{center}
\addcontentsline{toc}{chapter}{Preface}
{\Huge \bfseries Preface}
\end{center}
\input{Preface}
\end{minipage}
  • Welcome to TeX.SX. Scrap that template. But where do you got it from to begin with? – Johannes_B Feb 15 at 15:20
  • This works as a default temp in Uni website, and I wonder because it was working a few hours ago but suddenly stop to compile with no reason! – Soheil Feb 15 at 15:24
  • you haven't given a link to Thesis.cls so no one can test this or comment on the error, nor have you shown the error you got (copy the whole error from ! to ? from the log file and show it in the question, but errors at begin document are normally from the aux file so start by deleting that file. – David Carlisle Feb 15 at 16:08
  • Thanks for your clarification. I added the error and Thesis.cls as attached. – Soheil Feb 15 at 16:38
  • No I do not see the log file error, you have shown a screenshot of a summary of the editor from some editor but that has no useful information. Did you delete the .aux file? – David Carlisle Feb 15 at 17:11
0

You commented out the use of the hyperref package, thus causing the \hypersetup command not to be recognized. Get rid of the %s in front of lines 32--37. See the documentation for the hyperref package regarding setting colors for the various link types.

| improve this answer | |
  • I commented those lines out but still doesn't work and give me a new error as "option clash for package hyperref" on top up the previous one. Actually I didn't have any problem with these lines before. – Soheil Feb 15 at 15:47
  • @Soheil With hyperref package un-commented out, code compiles OK for me. – Cicada Feb 16 at 10:35
  • Thanks @Cicada. It works now. But do you have any idea why it is clashed with hyperref? I only use this package to colorize my citations? Is there any alternative? – Soheil Feb 16 at 12:20
  • @Soheil Nothing clashes when I run the code (but my Thesis.cls is part of MikTek; I'll compare). Colorized citations is a common question: hyperref solution (tex.stackexchange.com/questions/366996/…); biblatex solutions (tex.stackexchange.com/questions/253927/… ; tex.stackexchange.com/questions/369710/beamer-citation-coloring ; tex.stackexchange.com/questions/351379/…; and so on.) – Cicada Feb 17 at 1:13
  • @Soheil The Thesis.cls code you posted is already loading a dozen packages (including hyperref with its own option), and doing a lot of option-processing. Then in your preamble, you are loading a lot of the same packages, with and without options, basically re-wiring how Thesis.cls works. It's not surprising there will be errors. My impression is that Thesis.cls should be doing most of the work for you. Remove all packages from your preamble that Thesis.cls is already calling. Contact the maintainer of the class for instructions on how to use it. – Cicada Feb 17 at 1:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.