I have downloaded the fantastic template for doctoral thesis available in
https://www.latextemplates.com/template/masters-doctoral-thesis.
I have used it before I had already adapted the contents for my thesis. However, when I tried to compile it with MiKTeX after the last update I got this problem:
("C:\Users\XXXX\AppData\Local\Programs\MiKTeX 2.9\tex\generic\oberdiek\atbegshi.sty"))
! Missing number, treated as zero.
<to be read again>
-
l.81 ...end of thesis title}
% Your thesis title, this...
?
The problem seems to be within the \thesistitle
command. However I have checked the .cls file and I can't see any problem with it. I downloaded the original from LaTeXtemplates and got the same results:
("C:\Users\XXXX\AppData\Local\Programs\MiKTeX 2.9\tex\latex\csquotes\csquotes.cfg"))
! Missing number, treated as zero.
<to be read again>
-
l.70 \thesistitle{Thesis Title}
% Your thesis title, this is used in the tit...
?
This is a minimal working example that gives the same error. I couldn't get rid of the class dependency though:
\documentclass[11pt, english, singlespacing, headsepline]{MastersDoctoralThesis}
\usepackage[utf8]{inputenc} % Required for inputting international characters
\usepackage[T1]{fontenc} % Output font encoding for international characters
\thesistitle{Resilience of wastewater resource recovery to multiple stress conditions}
\begin{document}
\begin{titlepage}
\HRule \\[0.4cm] % Horizontal line
{\huge \bfseries \ttitle\par}\vspace{0.4cm} % Thesis title
\HRule \\[1.5cm] % Horizontal line
\end{titlepage}
\end{document}
Crosspost on LaTeX.org
UPDATE: The provisional solution would be to replace the \thetitle
command part in the .tex file, with:
\newcommand{\ttitle}{Thesis title}
\makeatletter
\renewcommand{\@title}{Thesis title}
\makeatother
Best Answer
The class abuses
\DeclareDocumentCommand
for defining variables. Anyway, the obvious error is in the second line ofwhere
\IfBooleanTF
makes no sense and should be\IfValueTF
.The code should be
or, in a slicker way,
You can avoid modifying the class by using in the preamble
My preference would go to
\def
instead of\DeclareDocumentCommand
. However, fixing the class would need weeks of work (for example,\null\vfill
has no place and the number of unprotected end-of-lines is huge), so I let it go.