Search code examples
latexbibtex

How can I import bib File to Latex?


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}
\bibliographystyle{plainnat}
\bibliography{reference}
\end{document}

But nothing happens when i run my Latex. Can anyone help me. Thanks in Advance ^^


Solution

  • There is a separate platform to ask LateX-related questions. Apart from that, the question is really vague.

    Let's start with your document having no content. Assuming that your LateX environment has been set up properly, adding something to your document should do something.

    Compile, run BibteX twice, compile again a few times and you should be set. EDIT: removed screenshot output file, as it was needlessly taking up space.

    BibTeX build is usually found in your interpreter:

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

    \usepackage{natbib}
    
    \begin{document}
    Blablabla happened because I need to cite \cite{lin1973}..
    \bibliographystyle{plainnat}
    \bibliography{reference}
    \end{document}