gpt4 book ai didi

r - Bookdown 在编织时生成带有章节标题而不是 "index.html"的索引文件

转载 作者:行者123 更新时间:2023-12-05 03:57:52 25 4
gpt4 key购买 nike

我正在使用 Bookdown 将一份长报告编译成一个 html 文档,直到最近才用 bookdown::gitbook 编写它没有任何问题。不确定发生了什么。

代码运行没有错误,所有的图表和文件都是根据需要生成的,但是 index.rmd 生成到一个以第一个标题的 id(“chapter00.html”)命名的 .html 文件中,而不是“index.html”。 HTML”。这意味着网站在上传到 github 时无法正常工作。

如果手动将文件名更改为“index.html”,一切都很好。

我的 index.rmd 文件如下所示:

--- 
title: "Eesti inimarengu aruanne 2019"
author: "Eesti Koostöö Kogu"
date: "`r Sys.Date()`"
site: bookdown::bookdown_site
documentclass: book
bibliography: [bibliography/bib_chapter23.bib, bibliography/bib_chapterXY.bib]
biblio-style: authoryear
biblatexoptions: [refsegment=chapter]
csl: keel-ja-kirjandus.csl
link-citations: yes
description: "Eesti inimarengu aruanne 2019"
css: eia.css
lang: et
---

# Sissejuhatus {-#chapter00 .chapter_section .intro_section}

_bookdown.yml文件如下:

book_filename: "EIA_2019_digi"
language:
label:
fig: 'Joonis '
tab: 'Tabel '
eq: 'Valem '
ui:
chapter_name: ""
delete_merged_file: true

_output.yml如下:

bookdown::gitbook:
split_by: section
split_bib: yes
config:
toc:
collapse: subsection
scroll_highlight: yes
before: null
after: null
toolbar:
position: fixed
edit : null
download: null
search: yes
sharing:
facebook: no
twitter: no
google: no
linkedin: no
weibo: no
instapaper: no
vk: no
all: ['facebook', 'google', 'twitter', 'linkedin', 'weibo', 'instapaper']
bookdown::pdf_book:
includes:
in_header: preamble.tex
latex_engine: xelatex
citation_package: natbib
keep_tex: yes
bookdown::epub_book: default

对可能导致问题的原因有任何见解吗?谢谢!

最佳答案

问题是您正在编织您的 bookdown 项目,而您应该使用 bookdown 渲染它。在 R 控制台中:

bookdown::render_book("index.Rmd")

检查你的输出的最后一行是这样的

Output created: docs/index.html
[1] "/my/path/mybook/docs/index.html"

这应该从您的 index.rmd 文件生成一个 index.html 文件

(如果您使用 github.io 发布,请记住在设置 > Github 页面下设置来源 ma​​ster 分支/文档文件夹)

关于r - Bookdown 在编织时生成带有章节标题而不是 "index.html"的索引文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58340924/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com