论文模板含糊错误

论文模板含糊错误

我将在我的论文中使用以下模板,但该模板有一个我无法修复的错误,错误标题为“未定义的控制序列”。我正在使用 pdfLatex 编译器。

<argument> \LaTeX3 error: 
                           Invalid use \IfBooleanTF {-NoValue-}
l.69 \thesistitle{}
                    % Your thesis title, this is used in the title and abstr...
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.

(/usr/local/texlive/2020/texmf-dist/tex/latex/hyperref/hyperref.sty
Package: hyperref 2020-05-15 v7.00e Hypertext links for LaTeX
(/usr/local/texlive/2020/texmf-dist/tex/generic/kvdefinekeys/kvdefinekeys.sty
Package: kvdefinekeys 2019-12-19 v1.6 Define keys (HO)
) (/usr/local/texlive/2020/texmf-dist/tex/generic/pdfescape/pdfescape.sty
Package: pdfescape 2019/12/09 v1.15 Implements pdfTeX's escape features (HO)
) (/usr/local/texlive/2020/texmf-dist/tex/latex/hycolor/hycolor.sty
Package: hycolor 2020-01-27 v1.10 Color options for hyperref/bookmark (HO)
) (/usr/local/texlive/2020/texmf-dist/tex/latex/letltxmacro/letltxmacro.sty
Package: letltxmacro 2019/12/03 v1.6 Let assignment for LaTeX macros (HO)
) (/usr/local/texlive/2020/texmf-dist/tex/latex/auxhook/auxhook.sty
Package: auxhook 2019-12-17 v1.6 Hooks for auxiliary files (HO)
)
\@linkdim=\dimen188
\Hy@linkcounter=\count412
\Hy@pagecounter=\count413
(/usr/local/texlive/2020/texmf-dist/tex/latex/hyperref/pd1enc.def
File: pd1enc.def 2020-05-15 v7.00e Hyperref: PDFDocEncoding definition (HO)
) (/usr/local/texlive/2020/texmf-dist/tex/generic/intcalc/intcalc.sty
Package: intcalc 2019/12/15 v1.3 Expandable calculations with integers (HO)
) (/usr/local/texlive/2020/texmf-dist/tex/generic/etexcmds/etexcmds.sty
Package: etexcmds 2019/12/15 v1.7 Avoid name clashes with e-TeX commands (HO)
)
\Hy@SavedSpaceFactor=\count414
Package hyperref Info: Option `colorlinks' set `true' on input line 4338.
Package hyperref Info: Hyper figures OFF on input line 4464.
Package hyperref Info: Link nesting OFF on input line 4469.
Package hyperref Info: Hyper index ON on input line 4472.
Package hyperref Info: Plain pages OFF on input line 4479.
Package hyperref Info: Backreferencing OFF on input line 4484.
Package hyperref Info: Implicit mode ON; LaTeX internals redefined.
Package hyperref Info: Bookmarks ON on input line 4717.
\c@Hy@tempcnt=\count415
LaTeX Info: Redefining \url on input line 5076.
\XeTeXLinkMargin=\dimen189
(/usr/local/texlive/2020/texmf-dist/tex/generic/bitset/bitset.sty
Package: bitset 2019/12/09 v1.3 Handle bit-vector datatype (HO)
(/usr/local/texlive/2020/texmf-dist/tex/generic/bigintcalc/bigintcalc.sty
Package: bigintcalc 2019/12/15 v1.5 Expandable calculations on big integers (HO)
))
\Fld@menulength=\count416
\Field@Width=\dimen190
\Fld@charsize=\dimen191
Package hyperref Info: Hyper figures OFF on input line 6347.
Package hyperref Info: Link nesting OFF on input line 6352.
Package hyperref Info: Hyper index ON on input line 6355.
Package hyperref Info: backreferencing OFF on input line 6362.
Package hyperref Info: Link coloring ON on input line 6365.
Package hyperref Info: Link coloring with OCG OFF on input line 6372.
Package hyperref Info: PDF/A mode OFF on input line 6377.
LaTeX Info: Redefining \ref on input line 6417.
LaTeX Info: Redefining \pageref on input line 6421.
(/usr/local/texlive/2020/texmf-dist/tex/generic/atbegshi/atbegshi.sty
Package: atbegshi 2019/12/05 v1.19 At begin shipout hook (HO)
)
\Hy@abspage=\count417
\c@Item=\count418
\c@Hfootnote=\count419
)
Package scrhack Info: hyperref hack deactivated because of
(scrhack)             detection of hyperref version, that doesn't
(scrhack)             need that hack, on input line 91.
Package hyperref Info: Driver (autodetected): hxetex.
(/usr/local/texlive/2020/texmf-dist/tex/latex/hyperref/hxetex.def
File: hxetex.def 2020-05-15 v7.00e Hyperref driver for XeTeX
(/usr/local/texlive/2020/texmf-dist/tex/latex/hyperref/puenc.def
File: puenc.def 2020-05-15 v7.00e Hyperref: PDF Unicode definition (HO)
) (/usr/local/texlive/2020/texmf-dist/tex/generic/stringenc/stringenc.sty
Package: stringenc 2019/11/29 v1.12 Convert strings between diff. encodings (HO)
)
\pdfm@box=\box62
\c@Hy@AnnotLevel=\count420
\HyField@AnnotCount=\count421
\Fld@listcount=\count422
\c@bookmark@seq@number=\count423
(/usr/local/texlive/2020/texmf-dist/tex/latex/rerunfilecheck/rerunfilecheck.styPackage: rerunfilecheck 2019/12/05 v1.9 Rerun checks for auxiliary files (HO)
(/usr/local/texlive/2020/texmf-dist/tex/latex/atveryend/atveryend.sty
Package: atveryend 2019-12-11 v1.11 Hooks at the very end of document (HO)
) (/usr/local/texlive/2020/texmf-dist/tex/generic/uniquecounter/uniquecounter.sty
Package: uniquecounter 2019/12/15 v1.4 Provide unlimited unique counter (HO)
)
Package uniquecounter Info: New unique counter `rerunfilecheck' on input line 286.
)
\Hy@SectionHShift=\skip85
) (/usr/local/texlive/2020/texmf-dist/tex/latex/polyglossia/polyglossia.sty
Package: polyglossia 2020/04/08 v1.49 Modern multilingual typesetting with XeLaTeX and LuaLaTeX
(/usr/local/texlive/2020/texmf-dist/tex/latex/makecmds/makecmds.sty
Package: makecmds 2009/09/03 v1.0a extra command making commands
) (/usr/local/texlive/2020/texmf-dist/tex/latex/xkeyval/xkeyval.sty
Package: xkeyval 2014/12/03 v2.7a package option processing (HA)
(/usr/local/texlive/2020/texmf-dist/tex/generic/xkeyval/xkeyval.tex (/usr/local/texlive/2020/texmf-dist/tex/generic/xkeyval/xkvutils.tex
\XKV@toks=\toks25
\XKV@tempa@toks=\toks26
)
\XKV@depth=\count424
File: xkeyval.tex 2014/12/03 v2.7a key=value parser (HA)
)) (/usr/local/texlive/2020/texmf-dist/tex/latex/fontspec/fontspec.sty
Package: fontspec 2020/02/21 v2.7i Font selection for XeLaTeX and LuaLaTeX
(/usr/local/texlive/2020/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty
Package: fontspec-xetex 2020/02/21 v2.7i Font selection for XeLaTeX and LuaLaTeX
\l__fontspec_script_int=\count425
\l__fontspec_language_int=\count426
\l__fontspec_strnum_int=\count427
\l__fontspec_tmp_int=\count428
\l__fontspec_tmpa_int=\count429
\l__fontspec_tmpb_int=\count430
\l__fontspec_tmpc_int=\count431
\l__fontspec_em_int=\count432
\l__fontspec_emdef_int=\count433
\l__fontspec_strong_int=\count434
\l__fontspec_strongdef_int=\count435
\l__fontspec_tmpa_dim=\dimen192
\l__fontspec_tmpb_dim=\dimen193
\l__fontspec_tmpc_dim=\dimen194
(/usr/local/texlive/2020/texmf-dist/tex/latex/base/fontenc.sty
Package: fontenc 2020/02/11 v2.0o Standard LaTeX package
) (/usr/local/texlive/2020/texmf-dist/tex/latex/fontspec/fontspec.cfg))) (/usr/local/texlive/2020/texmf-dist/tex/generic/iftex/ifluatex.sty
Package: ifluatex 2019/10/25 v1.5 ifluatex legacy package. Use iftex instead.
) (/usr/local/texlive/2020/texmf-dist/tex/generic/iftex/ifxetex.sty
Package: ifxetex 2019/10/25 v0.7 ifxetex legacy package. Use iftex instead.
) (/usr/local/texlive/2020/texmf-dist/tex/latex/filehook/filehook.sty
Package: filehook 2020/02/03 v0.7 Hooks for input files
(/usr/local/texlive/2020/texmf-dist/tex/latex/filehook/filehook-scrlfile.sty
Package: filehook-scrlfile 2020/02/02 v0.2 filehook patch for scrlfile package
Package filehook Info: Package 'scrlfile' detected and compensated for on input line 107.
))
\xpg@normalclass=\XeTeXcharclass1
(/usr/local/texlive/2020/texmf-dist/tex/latex/polyglossia/gloss-latex.ldf
File: gloss-latex.ldf polyglossia: module for default language
The property list \polyglossia@langsetup contains the pairs (without outer
braces):
>  {latex/script}  =>  {latin}
>  {latex/lcscript}  =>  {latin}
>  {latex/scripttag}  =>  {}
>  {latex/language}  =>  {Latex}
>  {latex/langtag}  =>  {ENG}
>  {latex/bcp47}  =>  {}
>  {latex/hyphennames}  =>  {english}
>  {latex/direction}  =>  {LR}
>  {latex/hyphenmins}  =>  {2,3}
>  {latex/frenchspacing}  =>  {false}
>  {latex/indentfirst}  =>  {false}
>  {latex/fontsetup}  =>  {true}
>  {latex/envname}  =>  {latex}
>  {latex/babelname}  =>  {latex}
>  {latex/localnumeral}  =>  {polyglossia@C@localnumeral}
>  {latex/Localnumeral}  =>  {polyglossia@C@localnumeral}.
)
Package polyglossia Info: Default language is latex.
) (/usr/local/texlive/2020/texmf-dist/tex/latex/polyglossia/gloss-english.ldf
File: gloss-english.ldf polyglossia: module for english
The property list \polyglossia@langsetup contains the pairs (without outer
braces):
>  {latex/script}  =>  {latin}
>  {latex/lcscript}  =>  {latin}
>  {latex/scripttag}  =>  {}
>  {latex/language}  =>  {Latex}
>  {latex/langtag}  =>  {ENG}
>  {latex/bcp47}  =>  {}
>  {latex/hyphennames}  =>  {english}
>  {latex/direction}  =>  {LR}
>  {latex/hyphenmins}  =>  {2,3}
>  {latex/frenchspacing}  =>  {false}
>  {latex/indentfirst}  =>  {false}
>  {latex/fontsetup}  =>  {true}
>  {latex/envname}  =>  {latex}
>  {latex/babelname}  =>  {latex}
>  {latex/localnumeral}  =>  {polyglossia@C@localnumeral}
>  {latex/Localnumeral}  =>  {polyglossia@C@localnumeral}
>  {english/script}  =>  {latin}
>  {english/lcscript}  =>  {latin}
>  {english/scripttag}  =>  {}
>  {english/language}  =>  {English}
>  {english/langtag}  =>  {ENG}
>  {english/bcp47}  =>  {en-US}
>  {english/hyphennames}  =>  {english,american,usenglish,USenglish}
>  {english/direction}  =>  {LR}
>  {english/hyphenmins}  =>  {2,3}
>  {english/frenchspacing}  =>  {false}
>  {english/indentfirst}  =>  {false}
>  {english/fontsetup}  =>  {true}
>  {english/envname}  =>  {english}
>  {english/babelname}  =>  {english}
>  {english/localnumeral}  =>  {polyglossia@C@localnumeral}
>  {english/Localnumeral}  =>  {polyglossia@C@localnumeral}.
Package polyglossia Info: Option: English, variant=american.
)
Package polyglossia Info: Default language is english.


    The compiler is having trouble understanding a command you have used. Check that the command is spelled correctly. If the command is part of a package, make sure you have included the package in your preamble using \usepackage{...}.
    [visit Thesis Template][1]

有人可以帮忙解释一下这个问题吗?

Latex Main.text 代码如下:

%----------------------------------------------------------------------------------------
%   PACKAGES AND OTHER DOCUMENT CONFIGURATIONS
%----------------------------------------------------------------------------------------

\documentclass[
oneside,
11pt, % The default document font size, options: 10pt, 11pt, 12pt
%oneside, % Two side (alternating margins) for binding by default, uncomment to switch to one side
english, % ngerman for German
singlespacing, % Single line spacing, alternatives: onehalfspacing or doublespacing
%draft, % Uncomment to enable draft mode (no pictures, no links, overfull hboxes indicated)
%nolistspacing, % If the document is onehalfspacing or doublespacing, uncomment this to set spacing in lists to single
%liststotoc, % Uncomment to add the list of figures/tables/etc to the table of contents
%toctotoc, % Uncomment to add the main table of contents to the table of contents
%parskip, % Uncomment to add space between paragraphs
%nohyperref, % Uncomment to not load the hyperref package
headsepline, % Uncomment to get a line under the header
%chapterinoneline, % Uncomment to place the chapter title next to the number on one line
%consistentlayout, % Uncomment to change the layout of the declaration, abstract and acknowledgements pages to match the default layout
]{MastersDoctoralThesis} % The class file specifying the document structure
\usepackage{array}
\newcolumntype{P}[1]{>{\centering\arraybackslash}p{#1}}
\usepackage[flushleft]{threeparttable}
\usepackage[utf8]{inputenc} % Required for inputting international characters
\usepackage[T1]{fontenc} % Output font encoding for international characters

\usepackage{palatino} % Use the Palatino font by default

\usepackage{biblatex} 

\usepackage{enumitem}

\addbibresource{bibfile.bib} % The filename of the bibliography
\usepackage{amsfonts}
\usepackage[autostyle=true]{csquotes} % Required to generate language-dependent quotes in the bibliography

\usepackage{graphicx}

\usepackage{titlesec}    
\titleformat{\chapter}[display]
{\normalfont%
    \huge% %change this size to your needs for the first line
    \bfseries}{\chaptertitlename\ \thechapter}{20pt}{%
    \huge %change this size to your needs for the second line
    }

    
%----------------------------------------------------------------------------------------
%   MARGIN SETTINGS
%----------------------------------------------------------------------------------------


\geometry{
    paper=a4paper, % Change to letterpaper for US letter
    inner=2.5cm, % Inner margin
    outer=2.5cm, % Outer margin
    bindingoffset=.5cm, % Binding offset
    top=1.5cm, % Top margin
    bottom=1.5cm, % Bottom margin
    %showframe, % Uncomment to show how the type block is set on the page
}

%----------------------------------------------------------------------------------------
%   THESIS INFORMATION
%----------------------------------------------------------------------------------------


\thesistitle{Insert the Title of your Thesis} % Your thesis title, this is used in the title and abstract, print it elsewhere with \ttitle
\supervisor{Dr. Yousef   \textsc{Hassouneh}} % Your supervisor's name, this is used in the title page, print it elsewhere with \supname
\examiner{} % Your examiner's name, this is not currently used anywhere in the template, print it elsewhere with \examname
\degree{Master of Software Engineering (SWEN)} % Your degree name, this is used in the title page and abstract, print it elsewhere with \degreename
\author{Yaman \textsc{Nasser} (1155002)} % Your name, this is used in the title page and abstract, print it elsewhere with \authorname
\addresses{} % Your address, this is not currently used anywhere in the template, print it elsewhere with \addressname

\subject{Software Engineering} % Your subject area, this is not currently used anywhere in the template, print it elsewhere with \subjectname
\keywords{} % Keywords for your thesis, this is not currently used anywhere in the template, print it elsewhere with \keywordnames
\university{\href{https://birzeit.edu}{BIRZEIT UNIVERSITY}} % Your university's name and URL, this is used in the title page and abstract, print it elsewhere with \univname
\department{{Software Engineering}} % Your department's name and URL, this is used in the title page and abstract, print it elsewhere with \deptname
\group{{Research Group Name}} % Your research group's name and URL, this is used in the title page, print it elsewhere with \groupname
\faculty{{Faculty of Engineering and Technology}} % Your faculty's name and URL, this is used in the title page and abstract, print it elsewhere with \facname

\AtBeginDocument{
\hypersetup{pdftitle=\ttitle} % Set the PDF's title to your title
\hypersetup{pdfauthor=\authorname} % Set the PDF's author to your name
\hypersetup{pdfkeywords=\keywordnames} % Set the PDF's keywords to your keywords
}

\begin{document}

\hypersetup{linkcolor=black}

\pagestyle{plain} % Default to the plain heading style until the thesis style is called for the body content

%----------------------------------------------------------------------------------------
%   TITLE PAGE
%----------------------------------------------------------------------------------------

\begin{titlepage}
\begin{center}

\vspace*{.06\textheight}



\begin{figure}[th]
\centering
\includegraphics[scale=5.0]{img/Birzeit}
\end{figure}


{\scshape\LARGE \univname\par}\vspace{1.5cm} % BIRZEIT UNIVERSITY
\textsc{\Large Detailed Proposal}\\[0.5cm] % Thesis type

\HRule \\[0.4cm] % Horizontal line
{\huge \bfseries \ttitle\par}\vspace{0.4cm} % Thesis title
\HRule \\[1.5cm] % Horizontal line
 
\begin{minipage}[t]{0.4\textwidth}
\begin{flushleft} \large
\emph{Author:}\\
{\authorname} % Author name - remove the \href bracket to remove the link
\end{flushleft}
\end{minipage}
\begin{minipage}[t]{0.4\textwidth}
\begin{flushright} \large
\emph{Supervisor:} \\
{\supname} % Supervisor name - remove the \href bracket to remove the link  
\end{flushright}
\end{minipage}\\[3cm]
 
\vfill

%\large \textit{A thesis submitted in fulfillment of the requirements\\ for the degree of \degreename}\\[0.3cm] % University requirement text
%\textit{in the}\\[0.4cm]
%\groupname\\\deptname\\[2cm] % Research group name and department name
 
\vfill

{\large \today}\\[4cm] % Date
%\includegraphics{Logo} % University/department logo - uncomment to place it
 
\vfill
\end{center}
\end{titlepage}

%----------------------------------------------------------------------------------------
%   ABSTRACT PAGE
%----------------------------------------------------------------------------------------

\begin{abstract}
\addchaptertocentry{\abstractname} % Add the abstract to the table of contents
Brief Summary of the topic,
what have you done so far,
achievements

\end{abstract}




\newpage
%----------------------------------------------------------------------------------------
%   LIST OF CONTENTS/FIGURES/TABLES PAGES
%----------------------------------------------------------------------------------------

\tableofcontents % Prints the main table of contents

\listoffigures % Prints the list of figures

\listoftables % Prints the list of tables


\newpage

%----------------------------------------------------------------------------------------
%   ACKNOWLEDGEMENTS
%----------------------------------------------------------------------------------------

\begin{acknowledgements}
\addchaptertocentry{\acknowledgementname} % Add the acknowledgements to the table of contents
Put an acknowledgment statement, to whom you are in debt of this work, is there any fund provided, facilities used by externals, sources of data.
\end{acknowledgements}

\newpage
\chapter{Introduction}
about half page to introduce this chapter
\section{Introduction and Motivation}

\subsection{Definition}




\subsection{Background}


\subsection{Insert section title }


\subsection{ Insert another section }

\subsection{Highlight the gap of knowledge }

\subsection{   }

\subsection{ Summary  }

\chapter{Research Methodology}
The main focus of the research 
How to conduct the research (the research approach)
A quantitative research is commonly large-scale research based on substantial samples. The data obtained from a quantitative method is usually descriptive, providing data which illustrates frequencies \cite{collins2003business}

A qualitative research is based on methods of data generation, which are flexible and sensitive to the social context in which data re produces \cite{robinson1998methods}. The nature of reality is defined by the interaction of the researcher with the phenomenon under study. Qualitative research usually emphasizes words rather than quantification in the collection and analysis data. \cite{collins2003business} summarized the main features of the two approaches in Table.\ref{table:Main_Features}.


\begin{table}[!htbp]
\centering
\caption{The main features of the quantitative and qualitative research}
\label{table:Main_Features}
\begin{tabular}{|p{6cm}| P{6cm}|}
\hline
\centering
Qualitative &   Quantitative \\\hline
Concerned with generating theories &Concerned with hypothesis testing \\\hline
Uses small samples& Uses Large Samples\\\hline
Data is rich and subjective& Data is highly specific\\\hline
Validity is high& Validity is low\\\hline
Reliability is low& Reliability is high\\\hline
Generalizes from one setting to another& Generalize from sample to population\\\hline
\end{tabular}
\end{table}

\cite{robinson1998methods} says, “The prime determinant of the methodological approach is the nature of the problem under investigation.” So, the selection of methodology depends on the nature of resources available such as questionnaires, case studies and interviews. The first step is a comprehensive research and reviews the texts that address the subject. The literature review will primarily be focused on the previous research work on this topic. A quantitative approach will be used through self administrated questionnaires with customers, and the findings will provide a quantitative survey analysis. 

\section{Data Collection }
This section describes the way data will be collected. 
\section{Data Analysis}
All these data will be carefully analyzed and the results will be clearly presented . what tools will be used i.e. Matlab, SPSS  etc.

\chapter{Implementation}
Conceptualization   and   Analysis \newline

What have you done  until now,\newline

What are the results achieved so far\newline

\chapter{Conclusions }
\section{Conclusion}
\section{Difficulties and Obstacles faced throughout your research}
\section{Recommendations}
\section{Project Planning}
The following Gantt chart shows how/when the aforementioned activities will be obtained. The literature review has been commenced and the project proposal has been already submitted to the supervisor. The Interim report or the mini dissertation have been already prepared and will be submitted in the allotted date.  After that we will continue with the literature review in parallel with the constructing of the model and collecting the data to simulate the scenarios.
\begin{figure}[th]
\centering
\includegraphics[scale=0.5]{img/Research_Gannt_Chart}
\caption{Research Gannt Chart}
\label{Fig.Research_Gannt_Chart}
\end{figure}
\printbibliography

\end{document}

答案1

我的建议:不要使用MastersDoctoralThesis.cls,它有缺陷。

这是一个说明该问题的最小(非)工作示例。

\documentclass{book}
\makeatletter
% the following six lines are verbatim from MastersDoctoralThesis.cls
\DeclareDocumentCommand{\thesistitle} { o m }{
    \IfBooleanTF{#1} {\DeclareDocumentCommand{\shorttitle}{ }{#1}
    {\DeclareDocumentCommand{\shorttitle}{}{#2}}}
    \DeclareDocumentCommand{\@title}{ }{#2}
    \DeclareDocumentCommand{\ttitle}{ }{#2}
}
\makeatother      
\begin{document}
\thesistitle{The Title}
\end{document}

问题 1: \IfBooleanTF应该是IfNoValueTF(then 和 else 分支交换)

问题2:该行中的最后一个右括号

    {\DeclareDocumentCommand{\shorttitle}{}{#2}}}

实际上应该终止其上方的行。

修正后的代码:

\documentclass{book}
\makeatletter
% Use the following lines instead of the original definition
\DeclareDocumentCommand{\thesistitle} { o m }{
    \IfNoValueTF{#1} {\DeclareDocumentCommand{\shorttitle}{}{#2}}
    {\DeclareDocumentCommand{\shorttitle}{}{#1}}
    \DeclareDocumentCommand{\@title}{ }{#2}
    \DeclareDocumentCommand{\ttitle}{ }{#2}
}
\makeatother      
\begin{document}
\thesistitle{The Title}
\end{document}

相关内容