# References links have question marks

I am working on the bibliography of my thesis document and I am using XeTex and JabRef.When I compile the code, I get a question mark in place of the hyperlink even after compiling the code twice.I have added the below 2 packages to the class file:

\RequirePackage{natbib}
\RequirePackage{cite}


In the main .tex file, before the end document I have placed the following 2 commands:

\bibliographystyle{plainnat}
\bibliography{thesis}


I am using texmaker as the editor. The .bib file in jabref contains the following code:

@Article{einstein,
Title                    = {{Zur Elektrodynamik bewegter K{\"o}rper}.        ({German})
[{On} the electrodynamics of moving bodies]},
Author                   = {Albert Einstein},
Journal                  = {Annalen der Physik},
Year                     = {1905},
Number                   = {10},
Pages                    = {891--921},
Volume                   = {322},

Doi                      = {http://dx.doi.org/10.1002/andp.19053221004}
}


I am not sure if I am making a mistake in including the bib file or in compiling the code. Please let me know what other information I should provide to help find a solution to this problem.

A minimum working code for this is :

\documentclass{report}
\usepackage{fontspec}
\usepackage{cite}
\usepackage{natbib}

\begin{document}
\title{test}
\author{test}
\maketitle

\tableofcontents{}

\listoffigures

\listoftables

\bibliographystyle{plainnat}
\bibliography{thesis}
\section{Author's Message}

Howdy! This is my honor to organize the LATEX Thesis Template

\section{Reference usage and example}
This subsection test the usage of Reference. Paper \cite{einstein} is referred in this way.

\end{document}

• Did you run bibtex? – Bernard Aug 18 '15 at 13:59
• @Bernard Yes I ran XeLaTex 1st and then BibTex and then again XeLatex again. – Shray Sharan Aug 18 '15 at 14:02
• Also I'm not sure a blank line in a .bib file does no harm. Otherwise a minimal code showing the problem would be helpful. – Bernard Aug 18 '15 at 14:05
• You don't need the bib file, you need the bbl file. – John Kormylo Aug 18 '15 at 14:13
• did the bibtex run create a .bbl file? that's the file that latex will be looking for. if bibtex didn't create it (using the data in the .bib file), then something else is wrong. – barbara beeton Aug 18 '15 at 14:23

You forgot in your post to load hyperref (load it as a the last package, as a general rule – though there are some exceptions). This codes runs fine with me:

    \documentclass{report}
\usepackage{fontspec}
\usepackage{cite}
\usepackage{natbib}
\usepackage{filecontents}
\begin{filecontents}{thesis.bib}
@Article{einstein,
Title = {{Zur Elektrodynamik bewegter K{\"o}rper}. ({German})
[{On} the electrodynamics of moving bodies]},
Author = {Albert Einstein},
Journal = {Annalen der Physik},
Year = {1905},
Number = {10},
Pages = {891--921},
Volume = {322},
Doi = {http://dx.doi.org/10.1002/andp.19053221004}
}
\end{filecontents}
\begin{document}
\title{test}
\author{test}
\maketitle

\tableofcontents{}

\listoffigures

\listoftables

\bibliographystyle{plainnat}
\bibliography{thesis}
\newpage
\section{Author's Message}

Howdy! This is my honor to organize the LATEX Thesis Template

\section{Reference usage and example}
This subsection test the usage of Reference. Paper \cite{einstein} is referred in this way.

\end{document}