R 登记:是否有更改报告章节名称的选项?

R 登记:是否有更改报告章节名称的选项?,r,r-markdown,bookdown,R,R Markdown,Bookdown,在报告输出documentclass:report中,是否有将章节标签从章节更改为主题的选项?上述变化没有产生预期的产出 这里是索引文件和yml index.Rmd: --- title: "Report" author: "P" date: "`r Sys.Date()`" site: bookdown::bookdown_site documentclass: report bibliography: [book.bib, packages.bib] biblio-style: apal

在报告输出
documentclass:report
中,是否有将章节标签从章节更改为主题的选项?上述变化没有产生预期的产出

这里是索引文件和yml

index.Rmd

--- 
title: "Report"
author: "P"
date: "`r Sys.Date()`"
site: bookdown::bookdown_site
documentclass: report
bibliography: [book.bib, packages.bib]
biblio-style: apalike
link-citations: yes
description: "This is a minimal example of using the bookdown package to write a book. The output format for this example is bookdown::gitbook."
header-includes:
  - \AtBeginDocument{\renewcommand{\chaptername}{Topic}}
---
\u output.yml

bookdown::gitbook:
  css: style.css
  config:
    toc:
      before: |
        <li><a href="./">A Minimal Book Example</a></li>
      after: |
        <li><a href="https://github.com/rstudio/bookdown" target="blank">Published with bookdown</a></li>
    download: ["pdf", "epub"]
bookdown::pdf_book:
  includes:
    in_header: preamble.tex
  latex_engine: xelatex
  citation_package: natbib
  keep_tex: yes
bookdown::epub_book: default
book_filename: "Report"
delete_merged_file: true
language:
  ui:
    chapter_name: 'Topic'

序言.tex
中进行以下更改后,章节标签已从章节更改为主题

旧文件:

\usepackage{booktabs}
新文件:

\usepackage{booktabs}
\AtBeginDocument{\renewcommand{\chaptername}{Topic}}

解决方案由Ralf Stubner给出。谢谢你,拉尔夫

可能重复@RalfStubner,谢谢链接。我已经做了更改,但没有得到预期的输出。请检查更新的内容。
\renewcommand
是否已写入生成的
tex
文件?您是否尝试将该命令放入
preamble.tex
?@RalfStubner不,它没有进入
tex
文件,后者也不起作用。我可以在完整的
预订项目中使用
标题包含
重现该问题。不过,使用preamble.tex对我来说确实有效,c.f。