问题描述
之前一个 bookdown 项目在 RStudio v1.3.959 下是可以编译成功的,可是升级到 v1.4.1103 后出现了问题,卸载 RStudio v1.4.1103 重新安装 RStudio v1.3.959 后可以成功编译。
RStudio v1.4 下报错信息如下:
! LaTeX Error: Environment CSLReferences undefined.
测试文件
以下下载地址选择其中一个即可。
地址1:https://gitlab.com/chuxinyuan/test_pandoc
地址2:https://cloud.189.cn/t/QfiIRvu6rMBj
地址3:https://gitee.com/rbind/rbind/blob/master/static/book/test_pandoc.rar
初步诊断
因为 RStudio 升级后我的相关 R 包没有更新,所以应该和 R 包没有关系,所以初步判断是 pandoc 的问题。比较升级前后C:\Program Files\RStudio\bin\pandoc
路径下文件,发现 RStudio v1.4.1103 版本下少了 pandoc-citeproc.exe文件。
系统环境
# 该系统环境下可成功编译
xfun::session_info()
R version 4.0.2 (2020-06-22)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19042), RStudio 1.3.959
Locale:
LC_COLLATE=Chinese (Simplified)_China.936 LC_CTYPE=Chinese (Simplified)_China.936
LC_MONETARY=Chinese (Simplified)_China.936 LC_NUMERIC=C
LC_TIME=Chinese (Simplified)_China.936
Package version:
base64enc_0.1.3 bookdown_0.21 compiler_4.0.2 digest_0.6.27
evaluate_0.14 glue_1.4.2 graphics_4.0.2 grDevices_4.0.2
highr_0.8 htmltools_0.5.1 jsonlite_1.7.2 knitr_1.30
magrittr_2.0.1 markdown_1.1 methods_4.0.2 mime_0.9
packrat_0.5.0 RevoUtils_11.0.2 RevoUtilsMath_11.0.0 rlang_0.4.10
rmarkdown_2.6 stats_4.0.2 stringi_1.5.3 stringr_1.4.0
tinytex_0.29 tools_4.0.2 utils_4.0.2 xfun_0.20
yaml_2.2.1