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}
}
TRa
  • 361
  • Have you tried checking the console log to find the issue? – Victor Z Jul 19 '17 at 05:31
  • Have you run pdflatex, bibtex, and then again pdflatex, pdflatex? – CarLaTeX Jul 19 '17 at 05: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 Jul 19 '17 at 05:38
  • What's the name of the bib file? Is it rakhtan.bib, biblio.bib, or something else? – Mico Jul 19 '17 at 05:41
  • @CarLaTeX after your comment, I did. But nothing changed. – TRa Jul 19 '17 at 05:42
  • @Mico The name of the bib file is "rakthan". Citation key is also the same. – TRa Jul 19 '17 at 05:42
  • Is the file name just rakthan, or is it rakthan.bib? – Mico Jul 19 '17 at 05:42
  • @Mico Inside the Windows folder, the filename is rakthan.bib – TRa Jul 19 '17 at 05:44
  • I'm not a Windows user. What does "inside the Windows folder" mean? – Mico Jul 19 '17 at 05:45
  • Please see the notes in the linked question. It explains in detail what you should try. – TeXnician Jul 19 '17 at 05:46
  • @Mico yes, the file name is rakthan.bib. – TRa Jul 19 '17 at 05:47
  • @TeXnician Thanks a lot. I am taking a look at it now. – TRa Jul 19 '17 at 05:48
  • @TeXnician I read the notes in that link. Didn't really get much help. According to their instruction, I did run PDFLaTex, BibTeX, PDFLaTeX, PDFLaTeX. But still getting the same messages in the log console. – TRa Jul 19 '17 at 06:01

1 Answers1

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.

TRa
  • 361
  • 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 Jul 19 '17 at 06: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 Jul 19 '17 at 07:21
  • Please don't add "thank you" as an answer. Instead, accept the answer that you found most helpful. - From Review – Zarko Jul 19 '17 at 20:17
  • @Zarko there was no answer from anyone, just comments. How do I accept a comment as an answer? – TRa Jul 19 '17 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 Jul 20 '17 at 05:47
  • @TRa if you do feel a comment has answered your question you can always ping that user and invite them to write/extend their comment into an answer. To me though, this seems like a (just about) coherent enough answer, highlighting that Mendeley was also confusing you with the citation keys (in addition to running BibTeX as highlighed duplicate). – Dai Bowen Jul 20 '17 at 11:50