I'm getting to grips with writing publications in rmarkdown. No issues at all generating .html files, or .docx files, but when I generate .pdf files the citations don't seem to inherit the style defined in the .csl file.
For example, with a numbered .csl style I expect:
[@Author_Title_2003]
-> (1)
Which is successful in .html and .docx files, but in .pdfs I get:
[@Author_Title_2003]
-> [Author, 2003]
With square brackets printed as well.
An example:
test.rmd:
---
title: 'My Title'
author: "Me me me me!"
output: pdf_document
bibliography: references.bib
csl: elsevier-vancouver.csl
---
Application written in the R programming language [@RCoreTeam] using the Shiny framework [@Chang2015].
# REFERENCES
references.bib:
@Misc{Chang2015,
Title = {shiny: Web Application Framework for R. R package version 0.12.1},
Author = {Chang, W. and Cheng, J. and Allaire, JJ. and Xie, Y. and McPherson, J. },
Year = {2015},
Type = {Computer Program},
Url = {http://CRAN.R-project.org/package=shiny}
}
@Article{RCoreTeam,
Title = {R: A Language and Environment for Statistical Computing},
Author = {{R Core Team}},
Year = {2015},
Type = {Journal Article},
Url = {http://www.R-project.org}
}
elsevier-vancouver.csl: link
running rmarkdown::render("test.Rmd", "pdf_document")
gives:
/home/jordan/.cabal/bin/pandoc +RTS -K512m -RTS paper.utf8.md --to latex --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash-implicit_figures --output paper.tex --template /home/jordan/R/x86_64-pc-linux-gnu-library/3.2/rmarkdown/rmd/latex/default-1.14.tex --highlight-style tango --latex-engine pdflatex --natbib --variable graphics=yes --variable 'geometry:margin=1in' --bibliography references.bib
And the output file is:
See the incorrectly formatted citations. Also note this format is generated regardless of the csl argument in the header. Any help would be much appreciated.
pandoc version 1.15.2.1, pandoc-citeproc version 0.8.1.3.