Specify CSL styles on RMarkdown

6.2k views Asked by At

I am trying to specify a CSL style on my RMarkdown Document as below

---
documentclass: article
fontsize: 12pt
linkcolor: blue
output: pdf_document
bibliography: bibliography.bib
csl: biomed-central.csl
---

but it gives me an error

pandoc-citeproc.exe: biomed-central.csl: openBinaryFile: does not exist (No such file or directory)
pandoc.exe: Error running filter pandoc-citeproc
Error: pandoc document conversion failed with error 83

On Windows 7 64 bit and R Version 3.1.2 and RStudio 0.98.1091 How can I specify a CSL style.

3

There are 3 answers

2
Keniajin On

Include the .csl file in your working directory. you can download the .csl file from here

0
jay.sf On

In addition to @Keniajin's answer, we can specify an absolute or relative path if we put it in quotes, e.g.

csl: "<folder>/biomed-central.csl"  # path to child folder
csl: "../biomed-central.csl"  # path to parent folder
csl: "X:/<folder>/biomed-central.csl"  # absolute path (in windows)

Besides, the same we can do with other linked files like *.bib or *.tex.

0
Johannes Ranke On

You can also specify an absolute path. This works, at least on my Linux system.