0

I'm new to using Latex. I want to import File reference.bib to my File document.tex. Above is my Code

reference.bib

@article{lin1973,
   author = "Shen Lin and Brian W. Kernighan",
   title = "An Effective Heuristic Algorithm for the Travelling-Salesman Problem",
   journal = "Operations Research",
   volume = 21,
   year = 1973,
   pages = "498-516"
}

And here is my document.tex

\documentclass[a4paper,12pt, fleqn]{scrreprt}

\usepackage{natbib}

\begin{document}
Blablabla happened because there was a need to cite \cite{lin1973}..
\bibliographystyle{plainnat}
\bibliography{reference}
\end{document}

I just received : Blablabla happened because there was a need to cite ? . Can anyone help me. Thanks in Advance ^^

moewe
  • 175,683

1 Answers1

0

First, take care of putting your reference.bib file in the same folder as your document.tex file. This is essential!

Also, as Manuel Weinkauf told in his comment, when compiling, ensure that you first run (pdf)latex once, then bibtex once, then again (pdf)latex at least once. (Some graphical user interfaces will do all of that by just clicking on one button, but I do not know if we are using one (and which).

Important notice: if you are using command-line interface, you shall run BibTeX on the auxiliary file, i.e. document.aux, which was generated by the first compilation (so the command is bibtex document.aux).

Then normally everything should work fine. In any case, one does not have to import the *.bib file to the *.tex file: these are just two different files, that you put in connexion by placing them in the same folder ;-)

Kind regards, /Nancy-N