0

I am using RMarkdown and Knitr to compile a PDF document. I'm using Natbib and a library.bib file generated with Mendeley in order to make use of references using citation keys such as {Author2017}. It normally displays the references like this in the PDF:

"Here is something I am saying in the text (Author, 2017)."

Now it looks like this:

"Here is something I am saying in the text (?)."

As far as I understand this can be for one of two reasons:

  1. Duplicate citation keys in the .bib file I use
  2. I entered the wrong citation key somewhere in the document

I have already checked for duplicate citation keys in the .bib file. There aren't any. I assume I have entered the wrong citation key somewhere in the .rmd file. How do I find that wrong citation key?

Phil
  • 4,344
  • 2
  • 23
  • 33
vio
  • 137
  • 1
  • 10
  • Without reproducible code or some content (.bib file), it is hard to help you. – Miha Sep 26 '17 at 13:26
  • Can you post a [minimal reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example)? Minimal `.rmd` code and the contents of `library.bib` to reproduce the problem. – Phil Sep 26 '17 at 13:29
  • I don't get your "2. ...*somewhere* in the document" - the wrong key should be exactly there where the "?" appears?! - Anyway, I recommend the [rmarkdown native citation](https://stackoverflow.com/a/44520400/6574038). – jay.sf Sep 27 '17 at 05:11
  • Look in the log file for more details about the error. To get the log file, you may need to add `keep_tex: TRUE` to the YAML header, and process the resulting `.tex` file separately. Then (in RStudio) you'll see the log by clicking on `View log` in the `Compile PDF` output tab. It may also show up in `Issues` in the same output tab. – user2554330 Sep 27 '17 at 18:08
  • Problem solved. Thank you for your help! This question can be closed. – vio Oct 01 '17 at 16:06

0 Answers0