R markdown: Why Rmarkdown displays no references?

Viewed 1562

I am trying to use reference in the R Markdown. When I try to export the markdown to pdf or anything, I receive no error!

But the references do not appear:

I have it as this in the beginning:

---
title: "Gap"
author: "xyz"
date: "19/09/2018"
bibliography: ref.bib
output: pdf_document
---

I changed the name to ref2.bib (only in the R file) and in that case I do get an error saying it does not find a file... So based on that I do know it is finding the file but it is not displaying the references... (I have also tried using different references). What could I be doing wrong?

If there would be an error it would be easier to reproduce, but I see nothing that's the issue: It's a pretty dumb example enter image description here And the bib file is in the same folder enter image description here

And I don't see the bib.ref

2 Answers

I was not citing it. It is my first time using this, I wanted to do a quick example, but apparently if you do not cite it with the @ symbol, there reference will not appear; and it makes sense you don't want to reference stuff you don't cite at all.

Related