0

I have a .txt file exported from endnote with references that I am trying to insert to an r markdown document. The file is saved in my working directory with the title ref.bib.txt, but when I try to knit my r markdown file to a pdf, I get the following error: Could not determine bibliography format for ref.bib.txt Error: pandoc document conversion failed with error 4 Execution halted

Has anyone else encountered this error and if so how did you solve it?

Example reference: @article{RN20, author = {Fang, Yi-Ya and Yamaguchi, Takashi and Song, Soomin C and Tritsch, Nicolas X and Lin, Dayu}, title = {A hypothalamic midbrain pathway essential for driving maternal behaviors}, journal = {Neuron}, volume = {98}, number = {1}, pages = {192-207. e10}, ISSN = {0896-6273}, year = {2018}, type = {Journal Article}

LL21
  • 1
  • 1
    I get a somewhat more useful error "the format of the bibliographic database could not be recognized from the file extension". What happens if you rename the file to `ref.bib` ... ?? – Ben Bolker Dec 05 '21 at 22:18
  • Ah yep, that solved it thanks! At least its an easy fix! – LL21 Dec 05 '21 at 22:44

1 Answers1

0

It appears that pandoc tries to recognize bibliographic formats by file extension, so renaming the file to ref.bib should fix the problem.

(There are some settings on Windows/MacOS that hide file extensions, so this could be slightly confusing.)

Ben Bolker
  • 211,554
  • 25
  • 370
  • 453