0

i'm using a template for the Doctoral thesis in TexStudio. I found problems on print the bibliography. This is my code:

   \documentclass[
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[utf8]{inputenc} % Required for inputting international characters
\usepackage[T1]{fontenc} % Output font encoding for international characters
\usepackage[dvips]{epsfig,psfrag}
\usepackage{mathpazo} % Use the Palatino font by default
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{floatrow}
\usepackage[none]{hyphenat} % suppress hyphenation *globally*
\sloppy 
\newcommand{\HY}{\hyphenpenalty=25\exhyphenpenalty=25} 
% re-enable hyphenation locally inside "Z" columns
\newcolumntype{Z}{>{\HY\RaggedRight\arraybackslash\hspace{0pt}}X} 
%\usepackage[autostyle=true]{csquotes} % Required to generate language-dependent quotes in the bibliography
\usepackage{float}
\usepackage{lipsum}
\usepackage{subfig}
\usepackage{adjustbox}
\usepackage{tabularx,booktabs}
\usepackage{mathtools}
\usepackage{array}
\usepackage{dcolumn}
\newcolumntype{P}[1]{>{\centering\arraybackslash}p{#1}}
\newcolumntype{P}{>{\raggedright\arraybackslash}X}
\setlength\tabcolsep{2pt}
\captionsetup{
    justification = centering
}
\usepackage{amsmath}
\usepackage{geometry}
\usepackage{booktabs}
\usepackage{xurl}
\usepackage{hyperref}
\DeclareMathOperator{\Pa}{Pa}
\newcolumntype{d}[1]{D{.}{.}{#1}}
\setlength\tabcolsep{2pt}


\usepackage[backend=bibtex,style=authoryear,natbib=true]{biblatex} % Use the bibtex backend with the authoryear citation style (which resembles APA)
\addbibresource{bibliography.bib}
%----------------------------------------------------------------------------------------
%   MARGIN SETTINGS
%----------------------------------------------------------------------------------------

\geometry{
    paper=a4paper, % Change to letterpaper for US letter
    inner=2.5cm, % Inner margin
    outer=3.8cm, % 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{Thesis Title} % Your thesis title, this is used in the title and abstract, print it elsewhere with \ttitle
\supervisor{} % 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{} % Your degree name, this is used in the title page and abstract, print it elsewhere with \degreename
\author{ \textsc{}} % 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{} % 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{}{}} % Your university's name and URL, this is used in the title page and abstract, print it elsewhere with \univname
\department{\href{}{}} % Your department's name and URL, this is used in the title page and abstract, print it elsewhere with \deptname
\faculty{\href{http://faculty.university.com}{}} % 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{} % Set the PDF's author to your name
\hypersetup{pdfkeywords=\keywordnames} % Set the PDF's keywords to your keywords
}

\begin{document}

\frontmatter % Use roman page numbering style (i, ii, iii, iv...) for the pre-content pages

\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}
{\scshape\LARGE \univname\par}\vspace{1.5cm} % University name
\textsc{\Large Doctoral Thesis}\\[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:}\\
\href{http://www.johnsmith.com}{\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:} \\
\href{http://www.jamessmith.com}{\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]
%\\\deptname\\[2cm] % Research group name and department name

\vfill

{\large \today}\\[4cm] % Date
\includegraphics[width = 40mm]{logo.png}\\[6ex] % University/department logo - uncomment to place it

\vfill
\end{center}
\end{titlepage}
\cleardoublepage


%----------------------------------------------------------------------------------------
%   DECLARATION PAGE
%----------------------------------------------------------------------------------------
\begin{declaration}
\addchaptertocentry{\authorshipname} % Add the declaration to the table of contents
\noindent I, \authorname, declare that this thesis titled, \enquote{\ttitle} and the work presented in it are my own. I confirm that:

\begin{itemize} 
\item This work was done wholly or mainly while in candidature for a research degree at this University.
\item Where any part of this thesis has previously been submitted for a degree or any other qualification at this University or any other institution, this has been clearly stated.
\item Where I have consulted the published work of others, this is always clearly attributed.
\item Where I have quoted from the work of others, the source is always given. With the exception of such quotations, this thesis is entirely my own work.
\item I have acknowledged all main sources of help.
\item Where the thesis is based on work done by myself jointly with others, I have made clear exactly what was done by others and what I have contributed myself.\\
\end{itemize}

\noindent Signed:\\
\rule[0.5em]{25em}{0.5pt} % This prints a line for the signature

\noindent Date:\\
\rule[0.5em]{25em}{0.5pt} % This prints a line to write the date
\end{declaration}

\cleardoublepage

%----------------------------------------------------------------------------------------
%   QUOTATION PAGE
%----------------------------------------------------------------------------------------

%\vspace*{0.2\textheight}

%\noindent\enquote{\itshape ..............}\bigbreak

%\hfill Elisa Mammoliti

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

\begin{abstract}
\addchaptertocentry{\abstractname} % Add the abstract to the table of contents

\end{abstract}

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

\begin{acknowledgements}
\addchaptertocentry{\acknowledgementname} % Add the acknowledgements to the table of contents
At first my acknowledgements are to my family and my friends, to support me in this long and difficult research project.\ldots
\end{acknowledgements}

%----------------------------------------------------------------------------------------
%   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

%----------------------------------------------------------------------------------------
%   ABBREVIATIONS
%----------------------------------------------------------------------------------------

\begin{abbreviations}{ll} % Include a list of abbreviations (a table of two columns)
\textbf{BNs} & \textbf{B}ayesian \textbf{N}etworks\\
\textbf{DEM} & \textbf{D}igital \textbf{E}levation \textbf{M}odel\\ 
\textbf{L} & \textbf{L}eeb number\\ 
\textbf{R} & \textbf{R}ebound number\\
\textbf{SH} & \textbf{S}chmidt \textbf{H}ammer\\
\textbf{RQI} & \textbf{R}ock \textbf{M}ass \textbf{Q}uality  \textbf{I}ndex\\


\end{abbreviations}

%----------------------------------------------------------------------------------------
%   PHYSICAL CONSTANTS/OTHER DEFINITIONS
%----------------------------------------------------------------------------------------

\begin{constants}{lr@{${}={}$}l} % The list of physical constants is a three column table

% The \SI{}{} command is provided by the siunitx package, see its documentation for instructions on how to use it

Speed of Light & $c_{0}$ & \SI{2.99792458e8}{\meter\per\second} (exact)\\
%Constant Name & $Symbol$ & $Constant Value$ with units\\

\end{constants}

%----------------------------------------------------------------------------------------
%   SYMBOLS
%----------------------------------------------------------------------------------------

\begin{symbols}{lll} % Include a list of Symbols (a three column table)

$a$ & distance & \si{\meter} \\
$P$ & power & \si{\watt} (\si{\joule\per\second}) \\
%Symbol & Name & Unit \\

\addlinespace % Gap to separate the Roman symbols from the Greek

$\omega$ & angular frequency & \si{\radian} \\

\end{symbols}

%----------------------------------------------------------------------------------------
%   DEDICATION
%----------------------------------------------------------------------------------------

\dedicatory{} 

%----------------------------------------------------------------------------------------
%   THESIS CONTENT - CHAPTERS
%----------------------------------------------------------------------------------------

\mainmatter % Begin numeric (1,2,3...) page numbering

\pagestyle{thesis} % Return the page headers back to the "thesis" style

% Include the chapters of the thesis as separate files from the Chapters folder
% Uncomment the lines as you write the chapters

\include{Chapters/Introduction}
\include{Chapters/Chapter2} 
\include{Chapters/Chapter3}
\include{Chapters/Chapter4} 
\include{Chapters/Chapter5} 
\include{Chapters/Chapter6} 
\include{Chapters/Chapter7} 

%----------------------------------------------------------------------------------------
%   THESIS CONTENT - APPENDICES
%----------------------------------------------------------------------------------------

\appendix % Cue to tell LaTeX that the following "chapters" are Appendices

% Include the appendices of the thesis as separate files from the Appendices folder
% Uncomment the lines as you write the Appendices

\include{Appendices/AppendixA}
%\include{Appendices/AppendixB}
%\include{Appendices/AppendixC}
Stuff happened and it was cited \cite{hoek1992modified}
%----------------------------------------------------------------------------------------
%   BIBLIOGRAPHY
%----------------------------------------------------------------------------------------
\printbibliography[heading=bibintoc]

%----------------------------------------------------------------------------------------

\end{document}  

And this is an example of the bibliography. My file is called bibliography.bib

@inproceedings{hoek1992modified,
    title={A modified Hoek--Brown failure criterion for jointed rock masses},
    author={Hoek, E and Wood, D and Shah, S},
    booktitle={Rock Characterization: ISRM Symposium, Eurock'92, Chester, UK, 14--17 September 1992},
    pages={209--214},
    year={1992},
    organization={Thomas Telford Publishing}
}
@article{bieniawski1973engineering,
    title={Engineering classification of jointed rock masses},
    author={Bieniawski, ZT},
    journal={Civil Engineer in South Africa},
    volume={15},
    number={12},
    year={1973}
}

Latex say:

There were undefined references.

I tried avoid the problem looking to similar questions but the suggestions don't help me to solve the problem.

Thanks in advance

  • 1
    If at all possible do yourself a favour and abandon MastersDoctoralThesis: It is too complex for most uses, load too many unnecessary packages and is not properly maintained. Start from a standard, KOMA-Script or memor class and only load the packages you need. – moewe Aug 28 '19 at 17:51
  • The symptoms you describe are consistent with not running BibTeX on your document, see tex.stackexchange.com/q/63852/35864. – moewe Aug 28 '19 at 17:52
  • @moewe thanks for your suggestion, i'm not an expert using latex but i found difficult to use this template. I will try to build a new document. Thanks!! – Elisa m Aug 28 '19 at 18:05
  • I can assure you MastersDoctoralThesis is a mystery even for people who have been playing with LaTeX for quite some time. Throwing away this template and starting small is certainly a very good decision. See also tex.stackexchange.com/q/390683/35864 – moewe Aug 28 '19 at 18:24
  • 1
    ... Then there is something wrong with one of your tables. Check the table in l. 364 (or thereabouts) of Chapters/Chapter5.tex: something is wrong there. Fix all those errors, then delete the .aux, .bbl and .bcf files (if present) and compile again. – moewe Aug 30 '19 at 8:32
0

I opened the template from latextemplates.com in Overleaf directly from the website.

I copied your code and bibliography file into the Overleaf doc.

I tried to compile, it broke.

I added the lines:

\begin{document}
Stuff happened and it was cited \cite{hoek1992modified}

so that the entire thing read:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Masters/Doctoral Thesis 
% LaTeX Template
% Version 2.5 (27/8/17)
%
% This template was downloaded from:
% http://www.LaTeXTemplates.com
%
% Version 2.x major modifications by:
% Vel (vel@latextemplates.com)
%
% This template is based on a template by:
% Steve Gunn (http://users.ecs.soton.ac.uk/srg/softwaretools/document/templates/)
% Sunil Patel (http://www.sunilpatel.co.uk/thesis-template/)
%.
% Template license:
% CC BY-NC-SA 3.0 (http://creativecommons.org/licenses/by-nc-sa/3.0/)
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%----------------------------------------------------------------------------------------
%   PACKAGES AND OTHER DOCUMENT CONFIGURATIONS
%----------------------------------------------------------------------------------------
\documentclass[
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[utf8]{inputenc} % Required for inputting international characters
\usepackage[T1]{fontenc} % Output font encoding for international characters
\usepackage[dvips]{epsfig,psfrag}
\usepackage{mathpazo} % Use the Palatino font by default
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{floatrow}
\usepackage[none]{hyphenat} % suppress hyphenation *globally*
\sloppy 
\newcommand{\HY}{\hyphenpenalty=25\exhyphenpenalty=25} 
% re-enable hyphenation locally inside "Z" columns
\newcolumntype{Z}{>{\HY\RaggedRight\arraybackslash\hspace{0pt}}X} 
\usepackage[backend=bibtex,style=authoryear,natbib=true]{biblatex} % Use the bibtex backend with the authoryear citation style (which resembles APA)
\addbibresource{bibliography.bib}

\begin{document}
Stuff happened and it was cited \cite{hoek1992modified}

\printbibliography[heading=bibintoc]

\end{document} 

... and it compiled happily (with a couple of warnings).

  • thank you for your reply! i tried but it doesn't work again... however i have many other raw of code that you can now see above cause i have modified the question. I hope we will solve this problem soon... thank you very much! – Elisa m Aug 30 '19 at 7:34
0

Just so this gets an answer.

The .log file you kindly posted of the document you are trying to run shows several errors. These errors can have consequences for the auxiliary files and may mean that the bibliography will not show up as expected.

In general the rule is that you have to run LaTeX, Biber/BibTeX, LaTeX, LaTeX on your document as explained in Question mark or bold citation key instead of citation number. Each run must complete without errors before you can go over to the next command. The first and second LaTeX run may produce warnings about undefined references or changed labels, but if there are errors, they must be resolved before you can continue with the next compilation steps.

In particular this .log complains about at least three things

  1. ! Undefined control sequence.
    <argument> \Elisa 
                      Mammoliti
    l.115 \begin{document}
    

    This is probably a simple typo: The \Elisa is supposed to be Elisa.

  2. ! Undefined control sequence.
    l.176 ...declare that this thesis titled, \enquote
                                                      {\ttitle} and the work pre...
    

    The document uses the csquotes command \enquote, but the package is not loaded. Indeed the preamble shown in the question has the line loading csquotes (\usepackage[autostyle=true]{csquotes}) commented out.

  3. The final error has a lot of knock-on effects. The complaint logged by LaTeX is

    Runaway argument?
    >{\raggedright \arraybackslash }p{P}\relax \NC@do d\@iwhilesw {\if@tempswa \ETC
    .
    ! Forbidden control sequence found while scanning use of \NC@find.
    <inserted text> 
                    \par 
    l.364 \end{tabularx}
    

    The line number refers to the file Chapters/Chapter5.tex. This looks as though there is an issue with a table column declaration, but it could be a bit more subtle.

All of those errors must be resolved before you can go over to running BibTeX/Biber.

Ideally you would remove the temporary files (.aux, .bbl, .bcf) after the errors are resolved and re-run the sequence LaTeX, Biber/BIbTeX, LaTeX, LaTeX.

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.