英文:
Asciidoctor: Is it possible to activate section numbering in themes yml
问题
我知道我可以在标题后使用:sectnums: all
来启用节和子节的编号。但是否可以在主题的yml中定义这个?我有很多文档都使用相同的主题文件,只定义一次会很方便。
英文:
I know that I can use :sectnums: all
after the title to enable section and subsection numbering. But is it possible to define this in the theme yml? I have a lot documents which use the same theme file, and it would be nice to have it defined only once.
答案1
得分: 1
PDF的theme.yml
不支持设置AsciiDoc属性,所以那种方法行不通。
然而,你可以通过命令行来指定属性:
asciidoctor-pdf -a sectnums=all file.adoc
也许最好创建一个仅定义属性的AsciiDoc文件,比如attributes.adoc
。你可以在其中指定你想要全局使用的属性:
:sectnums: all
:toc: left
然后,在每个需要使用这些属性的文档中:
= 我的文档
include::attributes.adoc[]
Lorem ipsum...
一旦你为所有文档完成了这些操作,只需要编辑attributes.adoc
文件即可调整属性。
英文:
The PDF theme.yml
does not support setting AsciiDoc attributes, so that approach won't work.
However, you can specify attributes on the command-line:
asciidoctor-pdf -a sectnums=all file.adoc
It might be better to create an AsciiDoc file that only defines attributes, say attributes.adoc
. You would specify any attributes that you want to use globally:
:sectnums: all
:toc: left
Then, in every document that needs to use those attributes:
= My document
include::attributes.adoc[]
Lorem ipsum...
Once you've done that for all documents, adjusting the attributes requires editing only the attributes.adoc
file.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论