Specify CSL styles on RMarkdown
Asked Answered
A

3

9

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.

Ahn answered 9/12, 2014 at 18:41 Comment(5)
the error is very helpful. where is the file? you need to use the path if it's not in the same directoryCrept
the CSL file is under the Pandoc folder ~\AppData\Local\PandocAhn
do you still get error if you use csl: ~/appdata/local/pandoc/biomed-central.csl?Crept
pandoc-citeproc.exe: InvalidUrlException "~/appdata/local/pandoc/biomed-central.csl" "Invalid scheme" Ahn
Thanks @Crept It works if I put the biomed-central.csl on the same folder with the .RMD fileAhn
A
6

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

Ahn answered 15/12, 2014 at 7:29 Comment(2)
+1. This works. Is it a bug that I cannot specify a path to the .csl in a location other than the working directory?Irritable
just like LaTeX everything is within the working directory path.Ahn
R
2

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.

Resorcinol answered 10/2, 2019 at 13:11 Comment(0)
B
1

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

Boise answered 4/10, 2016 at 15:10 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.