0

I am trying to learn how to cite in LaTex using the natbib package. I have created a bib file (containing only one reference) named "rakthan" using Mendeley for practice and placed in the same folder where my tex file is. Then I have tried the following codes. But compiling the tex file using TexMaker produces a pdf file with a "[?]" where the in-text citation should be. Also, no bibliography appears at the end of the document. I will be grateful if anyone could help!

P.S. I have already followed the instructions given here. But it yielded no result. Also, my problem is with Natbib, not with biblatex package as mentioned in that link.

\documentclass[12]{article}
\usepackage[left=1in, bottom=1in]{geometry}
\usepackage{amsmath}
\usepackage{natbib}
\usepackage[nottoc]{tocbibind}

\begin{document}

\tableofcontents

\section{Introduction}
\citep{rakthan} %The citation key is "rakthan".

\bibliographystyle{plainnat}
\bibliography{rakthan}

\end{document}

The following is what's inside the bib file:

@inproceedings{rakthanmanon2012searching,
  title={Searching and mining trillions of time series subsequences under dynamic time warping},
  author={Rakthanmanon, Thanawin and Campana, Bilson and Mueen, Abdullah and Batista, Gustavo and Westover, Brandon and Zhu, Qiang and Zakaria, Jesin and Keogh, Eamonn},
  booktitle={Proceedings of the 18th ACM SIGKDD international conference on Knowledge discovery and data mining},
  pages={262--270},
  year={2012},
  organization={ACM}
}
13
  • Have you tried checking the console log to find the issue?
    – Victor Z
    Commented Jul 19, 2017 at 5:31
  • Have you run pdflatex, bibtex, and then again pdflatex, pdflatex?
    – CarLaTeX
    Commented Jul 19, 2017 at 5:33
  • @VictorZ This is what I have found in the log console: Package natbib Warning: Citation 'rakthan' on page 1 undefined on input line 11 . ("pratice with biblio.bbl" Package natbib Warning: Empty thebibliography' environment on input line 8. ) Package natbib Warning: There were undefined citations. [1 {C:/ProgramData/MiKTeX/2.9/pdftex/config/pdftex.map}] ("pratice with biblio.aux") )
    – TRa
    Commented Jul 19, 2017 at 5:38
  • What's the name of the bib file? Is it rakhtan.bib, biblio.bib, or something else?
    – Mico
    Commented Jul 19, 2017 at 5:41
  • @CarLaTeX after your comment, I did. But nothing changed.
    – TRa
    Commented Jul 19, 2017 at 5:42

1 Answer 1

0

Thanks a lot to everyone who tried to help me. The problem is finally fixed. First of all, I wasn't running the bibtex after pdflatex. After I ran that, the problem still persisted. It turned out that for some reason, the citation key for my reference file was different from what Mendeley suggested me to use. After recompiling the bib file, everything is working perfectly now. Thank you all again for your valuable time. I am very grateful.

6
  • 1
    Glad to hear that you were able to find a solution. Do note that the expression "after recompiling the bib file" is, unfortunately, quite misleading: The bib file is never "compiled". It would be more accurate to state that BibTeX uses various pieces of information that LaTeX has written to the aux file -- the name of the bib file, the name of the bibliography style, and the citation keys of the entries that are to be listed in the references section -- to create a bbl file. The bbl file is, in turn, read by LaTeX during its next run and is used to create the formatted bibliography.
    – Mico
    Commented Jul 19, 2017 at 6:47
  • Thank you @Mico for enlightening me. By "compile" I actually wanted to mean that I created the bib file again from Mendeley with the appropriate citation key.
    – TRa
    Commented Jul 19, 2017 at 7:21
  • Please don't add "thank you" as an answer. Instead, accept the answer that you found most helpful. - From Review
    – Zarko
    Commented Jul 19, 2017 at 20:17
  • @Zarko there was no answer from anyone, just comments. How do I accept a comment as an answer?
    – TRa
    Commented Jul 19, 2017 at 23:56
  • text in my comment is default text appearing if someone vote that your answer is rather comment then answer. this means, that instead of answer you should write a comment.
    – Zarko
    Commented Jul 20, 2017 at 5:47

Not the answer you're looking for? Browse other questions tagged .