- 已编辑
问题描述
我昨天把电脑中安装的R包全部更新到最新后,发现使用bookdown总是出现编译失败,而在R包升级之前是没有出现的。初步判断,应该是.Rmd文件中的标题使用了中文,因为标题全部改为英文后就能正常编译;但是少量中文又能编译成功。不知道哪里出现问题了,我该怎样修正这个问题。还请大佬指教(能召唤益辉大哥吗?@yihui),不胜感激!
index.Rmd文件内容
---
title: "A Minimal Book Example"
author: "LHX"
date: "`r Sys.Date()`"
site: bookdown::bookdown_site
output: bookdown::gitbook
documentclass: book
bibliography: [book.bib, packages.bib]
biblio-style: apalike
link-citations: yes
description: ""
---
# 总体介绍{-}
# 三国人物
## 魏国
### 曹操
东汉丞相。
## 蜀国
# 唐宋名将
编译失败提示结果
processing file: bookdown-demo.Rmd
|.................................................................| 100%
inline R code fragments
output file: bookdown-demo.knit.md
"E:/EngSoft/R/RStudio/bin/pandoc/pandoc" +RTS -K512m -RTS bookdown-demo.utf8.md --to html4 --from markdown+autolink_bare_uris+tex_math_single_backslash+smart --output bookdown-demo.html --email-obfuscation none --wrap preserve --standalone --section-divs --table-of-contents --toc-depth 3 --template "E:\EngSoft\R\library\bookdown\templates\gitbook.html" --highlight-style pygments --number-sections --css style.css --include-in-header "C:\Users\Administrator\AppData\Local\Temp\RtmpqgKzLU\rmarkdown-str22dc11395c39.html" --mathjax --lua-filter "E:/EngSoft/R/library/rmarkdown/rmd/lua/pagebreak.lua" --lua-filter "E:/EngSoft/R/library/rmarkdown/rmd/lua/latex-div.lua" --filter "E:/EngSoft/R/RStudio/bin/pandoc/pandoc-citeproc.exe"
Error in file.exists(f) : 转换文件名时出了问题--名字太长了?
Calls: <Anonymous> ... move_files_html -> local_resources -> grep -> unique -> file.exists
Please delete bookdown-demo.Rmd after you finish debugging the error.
停止执行
_bookdown.yml文件内容
book_filename: "bookdown-demo"
language:
label:
fig: "图"
tab: "表"
ui:
edit: "编辑"
chapter_name: ["第", "章"]
rmd_files: ["index.Rmd"]
我的系统环境
R version 3.6.1 (2019-07-05)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1
Matrix products: default
locale:
[1] LC_COLLATE=Chinese (Simplified)_People's Republic of China.936
[2] LC_CTYPE=Chinese (Simplified)_People's Republic of China.936
[3] LC_MONETARY=Chinese (Simplified)_People's Republic of China.936
[4] LC_NUMERIC=C
[5] LC_TIME=Chinese (Simplified)_People's Republic of China.936
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] compiler_3.6.1 bookdown_0.14 htmltools_0.4.0 tools_3.6.1 yaml_2.2.0
[6] Rcpp_1.0.2 rmarkdown_1.16 knitr_1.25 xfun_0.10 digest_0.6.21
[11] rlang_0.4.0 evaluate_0.14
我用的bookdown模板已上传至百度网盘中。
另外,将index.Rmd内容中的## 蜀国
改为## 郭嘉
又能编译成功,所以我很迷惑。