在尝试构建一个大约两周前工作的 PDF 后,没有大惊小怪,在一台全新安装了 R、R studio 的新机器上,bookdown
等等,我有这个错误:
Error: Input files not all in same directory, please supply explicit wd
我有以下章节.Rmd
文件排序到目录中,所以如果我改变rmd_subdir
from true
to false
,错误消失了,但是...我无法处理项目根目录中每个场景包含 4-7 个场景的 100 多个章节;我会发疯的。
I have new_session: no https://github.com/rstudio/bookdown/issues/887#issuecomment-627136120 in my _bookdown.yml
,但这并没有帮助。
我对 R 的了解还不够,甚至无法开始诊断 -谷歌回报4(!) 结果 https://www.google.com/search?q=%22Input%20files%20not%20all%20in%20same%20directory%2C%20please%20supply%20explicit%20wd%22并且全部都是源代码。因此,我不确定此处要包含哪些文件,所以请告诉我,我会将它们粘贴进去。
我如何构建
我按下上面写着的按钮Build Book
在 RStudio 中,它会随着滴答作响并退出status 1
过了一会儿就出现上面的错误。
确切的错误消息
==> rmarkdown::render_site(output_format = 'bookdown::gitbook', encoding = 'UTF-8')
processing file: book-book.Rmd
|......................................................................| 100%
ordinary text without R code
output file: book-book.knit.md
Error: Input files not all in same directory, please supply explicit wd
Execution halted
Exited with status 1.
索引.Rmd
---
title: "F"
author: "TTil"
site: bookdown::bookdown_site
fontsize: 10pt
geometry: paperwidth=6in,paperheight=9in,margin=0.5in,heightrounded,twoside,includehead,includefoot,heightrounded
output:
bookdown::gitbook:
split_by: section
config:
toolbar:
position: static
bookdown::pdf_book:
keep_tex: yes
latex_engine: lualatex
includes:
in_header: preamble.tex
before_body: before_body.tex
documentclass: book
link-citations: yes
linestretch: 1.15
links-as-notes: true
mainfont: "Inter"
---
_bookdown.yml
book_filename: 'book-book'
language:
ui:
chapter_name: ''
delete_merged_file: true
new_session: no
rmd_subdir: true
# Before We Begin {-}
test test replace me
我的文件结构如下所示:
index.Rmd
- part-1/
- ch01/
- sc01.Rmd
- sc02.Rmd
...
- ch02/
...
- part-2/
...
因此我期望sc01.Rmd
and sc02.Rmd
成为第一章,然后它和它的兄弟姐妹第一部分,等等等等第二部分, 第三部分, ...
正如我上面所说,这个 PDF 大约两周前就可以正常工作(尽管是在另一台机器上)。
Cheers.