Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Specify CSL styles on RMarkdown

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.

like image 951
Keniajin Avatar asked Dec 09 '14 18:12

Keniajin


3 Answers

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

like image 79
Keniajin Avatar answered Oct 05 '22 16:10

Keniajin


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.

like image 27
jay.sf Avatar answered Oct 05 '22 18:10

jay.sf


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

like image 40
Johannes Ranke Avatar answered Oct 05 '22 17:10

Johannes Ranke