【发布时间】:2016-07-12 03:38:45
【问题描述】:
[我的环境:Win 7 Pro / R 3.2.1 / knitr_1.12.3 / R Studio Version 0.99.892]
我正在尝试使用 R Studio、Knit -> PDF 以 .Rmd 格式写一篇文章,我一直在关注 http://rmarkdown.rstudio.com/authoring_bibliographies_and_citations.html 以获取有关如何获取 pandoc 和 pandoc-citeproc 以生成参考的详细信息部分和引文
在正文中。
我的 BibTeX 参考文献在几个不同的 .bib 文件中,当使用
.Rnw 文件中的 LaTeX 都可以在 我的本地 texmf 树 通过
\bibliography{statistics, graphics}
我似乎无法使用pandoc-citeproc 完成这项工作。我的 YAML 标头
具有以下内容,适用于 one .bib 文件,只要它是
在与源.Rmd 文件相同的目录中:
---
title: "Notes on Testing Equality of Covariance Matrices"
author: "Michael Friendly"
date: '`r format(Sys.time(), "%B %d, %Y")`'
output:
pdf_document:
fig_caption: yes
keep_tex: yes
number_sections: yes
csl: apa.csl
bibliography: statistics.bib
---
按照上面给出的链接中的建议,我尝试了:
bibliography: [statistics.bib,graphics.bib]
这给出了:
pandoc-citeproc.exe: "stdin" (line 50, column 12):
unexpected ":"
expecting letter, digit, white space or "="
pandoc.exe: Error running filter pandoc-citeproc
Filter returned error status 1
[编辑:为了完整起见,我展示了生成的pandoc 命令,看起来两个 .bib 文件都正确传递了]:
"C:/Program Files/RStudio/bin/pandoc/pandoc" +RTS -K512m -RTS EqCov.utf8.md --to latex --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash --output EqCov.pdf --template "C:\R\R-3.2.1\library\rmarkdown\rmd\latex\default-1.15.2.tex" --number-sections --highlight-style tango --latex-engine pdflatex --variable graphics=yes --variable "geometry:margin=1in" --bibliography statistics.bib --bibliography graphics.bib --filter pandoc-citeproc
output file: EqCov.knit.md
以下所有形式也是如此:
bibliography: ["statistics.bib","graphics.bib"]
bibliography:
- "statistics.bib"
- "graphics.bib"
bibliography:
- statistics.bib
- graphics.bib
理想情况下,我希望能够使用以下形式之一,而不必将 .bib 文件复制到文档目录。
bibliography: ["C:/Dropbox/localtexmf/bibtex/bib/statistics.bib","C:/Dropbox/localtexmf/bibtex/bib/graphics.bib"]
bibliography:
- "C:/Dropbox/localtexmf/bibtex/bib/statistics.bib"
- "C:/Dropbox/localtexmf/bibtex/bib/graphics.bib"
【问题讨论】:
-
请注意 - 这似乎在 HTML 输出中没有问题。 pdf问题有更新吗?
标签: r rstudio knitr r-markdown pandoc