r - bookdown 引用在 pdf 中工作但不是 html

标签 r pandoc bookdown

我有一个 bookdown 项目,其中一些引用文献被正确处理为 pdf 但不是 html。例如,此标记:

Authors and modelers have successfully used this framework to derive models that have won Kaggle competitions [@Raimondi2010], have been implemented in diagnostic tools [@jahani2016comparison,@luo2016automatically], are being used as the backbone of investment algorithms [@stankovic2015investment], and are being used as a screening tool to assess the safety of new pharmaceutical products [@thomson2011not].

在 html 中生成此内容

Authors and modelers have successfully used this framework to derive models that have won Kaggle competitions (Raimondi 2010), have been implemented in diagnostic tools (Jahani and Mahdavi 2016,@luo2016automatically), are being used as the backbone of investment algorithms (Stanković, Marković, and Stojanović 2015), and are being used as a screening tool to assess the safety of new pharmaceutical products (Thomson et al. 2011).

还有这个pdf

Authors and modelers have successfully used this framework to derive models that have won Kaggle competitions (Raimondi, 2010), have been implemented in diagnostic tools (Jahani and Mahdavi, 2016, Luo (2016)), are being used as the backbone of investment algorithms (Stanković et al., 2015), and are being used as a screening tool to assess the safety of new pharmaceutical products (Thomson et al., 2011).

可以找到一个 reprex here我的系统使用:

## R version 3.6.0 (2019-04-26)
## Platform: x86_64-apple-darwin15.6.0 (64-bit)
## Running under: macOS High Sierra 10.13.6
## 
## Locale: en_US.UTF-8 / en_US.UTF-8 / en_US.UTF-8 / C / en_US.UTF-8 / en_US.UTF-8
## 
## Package version:
##   base64enc_0.1.3 bookdown_0.11.1 digest_0.6.19   evaluate_0.14  
##   glue_1.3.1      graphics_3.6.0  grDevices_3.6.0 highr_0.8      
##   htmltools_0.3.6 jsonlite_1.6    knitr_1.23      magrittr_1.5   
##   markdown_1.0    methods_3.6.0   mime_0.7        Rcpp_1.0.1     
##   rmarkdown_1.13  stats_3.6.0     stringi_1.4.3   stringr_1.4.0  
##   tinytex_0.13    tools_3.6.0     utils_3.6.0     xfun_0.7       
##   yaml_2.2.0

> rmarkdown::pandoc_version()
[1] ‘2.0.5’

(编辑 - pandoc 版本)

最佳答案

多次引用必须用分号而不是逗号分隔,例如,

[@jahani2016comparison; @luo2016automatically]

参见 Pandoc's manual获取官方文档和示例。

关于r - bookdown 引用在 pdf 中工作但不是 html,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56703295/

相关文章:

r - Bookdown 中的图编号消失

javascript - 使用 rhandsontable 进行数字和条件格式设置

在 r 中水平旋转直方图

r - 如何使用pandoc将目录添加到R Markdown HTML文件中?

yaml - 使用 YAML 元数据 block 声明用于 pandoc 转换的任意变量

r - Bookdown 文档未正确呈现输出

r - 构建一个包含总值(value)、最大值、最小值、平均值和类别百分比的数据框

删除暂停的 session 数据有风险吗?

Pandoc - HTML to Markdown - 删除所有属性

r-markdown - 在 R Bookdown 中每个 GitBook 风格的网页章节之后重新启动尾注编号