0

I am using texlive on ubuntu and getting

LaTeX Warning: Citation `texbook' on page 1 undefined on input line 9.

And in the output file no reference is showing. I have followed the examples from http://www.bibtex.org/Using/ and https://www.youtube.com/watch?v=KS9GvK7cvmo

My main.tex file:

\documentclass[a4paper]{article}
\title{ demo bibtex}
\author{kazi}

\begin{document} \maketitle

some claim \cite{texbook}.

\bibliographystyle{plain} \bibliography{refs} \end{document}

And my refs.bib file:

@book{texbook,
  author = {Donald E. Knuth},
  year = {1986},
  title = {The {\TeX} Book},
  publisher = {Addison-Wesley Professional}
}

@book{latex:companion, author = {Frank Mittelbach and Michel Gossens and Johannes Braams and David Carlisle and Chris Rowley}, year = {2004}, title = {The {\LaTeX} Companion}, publisher = {Addison-Wesley Professional}, edition = {2} }

@book{latex2e, author = {Leslie Lamport}, year = {1994}, title = {{\LaTeX}: a Document Preparation System}, publisher = {Addison Wesley}, address = {Massachusetts}, edition = {2} }

kazi_m
  • 1
  • 2
    Did you actually run bibtex? You need to run, pdflatex, bibtex, pdflatex, pdflatex or similar. – daleif Mar 25 '22 at 17:00
  • 1
    As daleif says: You need to run BibTeX on your document. A full compilation sequence would then involve LaTeX, BibTeX, LaTeX, LaTeX (where "LaTeX" is your favourite flavour of LaTeX: pdfLaTeX, LuaLaTeX, XeLaTeX, ...). See https://tex.stackexchange.com/q/63852/35864 for more details. Your editor probably has a button to do that. – moewe Mar 25 '22 at 17:13
  • 1
    Thanks. First I ran "pdflatex main" then this happened so did not go forward. Now it is okay, I tried "pdflatex main && bibtex main && pdflatex main && pdflatex main". It worked – kazi_m Mar 25 '22 at 17:28
  • 1
    Even better: just use latexmk -pdf file.tex and it will run them for you – daleif Mar 25 '22 at 20:37

0 Answers0