R Markdown Not Rendering Citation

2020-04-15 15:24发布

问题:

I am trying to use the bibtex feature of RMarkdown for citations, but my citations are not being rendered.

I am using the latest versions of R, RStudio, and RMarkdown.

My rmd file looks like this:

---
title: "Music Recommender Systems"
output:
  html_document:
    theme: united
    toc: yes
  pdf_document:
    toc: yes
  word_document: default
bibliography: bibliography.bib
---

Blah blah @778431

My bibtex file "bibliography.bib" is saved adjacent to the .rmd file and looks like this:

@inproceedings{778431,
    author = {Lesaffre, Micheline and Leman, Marc and Martens, Jean-Pierre},
    booktitle = {Dagstuhl Seminar Proceedings},
    editor = {Crawford, T. and Veltkamp, R.C.},
    issn = {1862-4405},
    language = {eng},
    location = {Dagstuhl, Germany},
    pages = {1--11},
    publisher = {Internationales Begegnungs- und Forschungszentrum fur Informatik (IBFI), Schloss},
    title = {A user-oriented approach to music information retrieval},
    url = {http://drops.dagstuhl.de/vollt...},
    year = {2006},
}

Instead of rendering the citation, the output just says:

Blah blah @778431

What's going on? To review format recommendations, see http://rmarkdown.rstudio.com/authoring_bibliographies_and_citations.html I believe that my setup is all correct, but if there is a small mistake that I have missed, I'm happy to have it pointed out.

Note, I originally tried [@778431] in my file.

回答1:

After some testing, I will answer my own question. Unfortunately RStudio/RMarkdown does not allow you to use numerical citation identifiers. I replaced 778431 with a778431 and the code above worked. I have heard that Endnote produces numerical identifiers, so for the sake of endnote users, I hope the issue gets some attention.