rmarkdownで出版物を書くことに慣れてきました。.html ファイルまたは .docx ファイルの生成にはまったく問題はありませんが、.pdf ファイルを生成すると、引用が .csl ファイルで定義されたスタイルを継承していないようです。
たとえば、番号付きの .csl スタイルでは、次のようになります。
[@Author_Title_2003]
-> (1)
.html および .docx ファイルでは成功しますが、.pdfs では次のようになります。
[@Author_Title_2003]
-> [著者、2003]
角かっこも印刷されています。
例:
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
参考文献.よだれかけ:
@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:リンク
実行すると次のrmarkdown::render("test.Rmd", "pdf_document")
ようになります:
/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
出力ファイルは次のとおりです。
不適切な形式の引用を参照してください。また、この形式は、ヘッダーの csl 引数に関係なく生成されることに注意してください。どんな助けでも大歓迎です。
pandoc バージョン 1.15.2.1、pandoc-citeproc バージョン 0.8.1.3。