手册中的手动编号

Manual numbering in bookdown

是否可以在 bookdown 中控制 chapter/section 编号?

例如

# Introduction {1}
# Theory {14}
# Methods {3}

将在输出中给出以下内容...

1. Introduction
14. Theory
3. Methods

我不确定您要做什么:页眉末尾的大括号不用于控制节编号。你可以用它来 manually assign an ID to a section header

例如# Introduction {#intro}

and/or 到 exclude the header from numbering

例如# Introduction {-}同时分别# Introduction {- #intro}

抱歉回答晚了,但我刚遇到同样的问题。

如果您全局关闭编号,添加行

number_sections: false

bookdown::gitbook: 下到您的 _output.yml 文件,然后您可以按照您喜欢的任何方式对章节和部分进行编号:

# 1. Introduction

# 14. Theory

# 3. Methods

重复:我的 _output.yml 文件包含行

bookdown::gitbook:
  number_sections: false