bookdown 引用以 pdf 格式工作,但不是 html

bookdown references working in pdf but not html

我有一个 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