我知道我可以通过将{.unnumbered}添加到一个标题中来指定各个节没有编号。我怎样才能把它作为一个全球选项,使我书中的章节都没有编号呢?
如果我在yaml头中设置number-sections: false,如下所示:
format:
html:
theme: cosmo
css: styles.css
number-sections: false它不禁止导航栏中的编号。
也就是说,使用number-sections: false集和我的qmd中的这个:
# CSS Combinators
## CSS Combinators
- Defines relationship between selectors.
- There are four它呈现如下:

在qmd中使用{.unnumbered}:
# CSS Combinators {.unnumbered}
## CSS Combinators
- Defines relationship between selectors.
- There are four它呈现如下:

发布于 2022-07-31 12:55:16
如果要删除书中的所有节号,只需将输出格式选项number-sections设置为false。
project:
type: book
book:
title: "Section Unnumbering"
author: "Shafee"
date: "7/31/2022"
chapters:
- index.qmd
- intro.qmd
- summary.qmd
- references.qmd
bibliography: references.bib
format:
html:
theme: cosmo
css: styles.css
number-sections: false更新
因此,当屏幕变宽时,将number-sections指定为false似乎有效,但是当屏幕缩小时,编号仍然保留在缩小的章节标题中。
为了强制隐藏章节号,我们需要修改相应的CSS类,即.chapter-number。
styles.css
.chapter-number {
display: none;
}

https://stackoverflow.com/questions/73171943
复制相似问题