首页 > 解决方案 > 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: 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}}
---

_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

_bookdown.yml

book_filename: "Report"
delete_merged_file: true
language:
  ui:
    chapter_name: 'Topic'

标签: rr-markdownbookdown

解决方案


. _ _ _ preamble.tex_

旧文件:

\usepackage{booktabs}

新文件:

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

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


推荐阅读