My .rmd file fails to compile when including citations as a .bib file. 
I attached the code and error message here and very appreciate if someone could help. 

My .rmd file fails to compile when including citations as a .bib file. 
I attached the code and error message here and very appreciate if someone could help. 

 
    
     
    
    The indentation of the YAML options is important. You currently have bibliography within the output section, but it should be placed in as a top-level YAML.
title: "Title"
author: "Author"
output: 
  pdf_document:
    keep_tex: true
bibliography: bib.bib
Edit: Make sure you have moved the bibliography out of the pdf_document options completely, as follows:
author: "Author"
output: 
  pdf_document:
    keep_tex: true
    fig_caption: yes
    number_sections: yes
bibliography: bib.bib
---
