我正在使用Quarto创建一个长的PDF报告。我想包含两种交叉引用格式:
- 到节/图表编号,例如:
如在第3.1节中所讨论
- 到节/图表标题,例如:
如在我的精彩章节中所述。
可以通过以下方式实现其中任何一种:
---
format:
pdf:
number-sections: true
---
# Why Stack Overflow is so great {#sec-stack}
I can use style 1, the section number, with the explicit ID, e.g. as seen in @sec-stack.
I can use style 2, the section title, with a link [Why Stack Overflow is so great].
I can also custom text with [Custom text before the link][Why Stack Overflow is so great].
这将产生所需的输出:
问题
问题在于该文档正在被多位作者重新起草。如果将一个章节标题从为什么Stack Overflow如此伟大更改为我为什么喜欢Stack Overflow,它会破坏使用第二种样式(章节标题)的交叉引用。
我正在寻找一种使用显式标识符@sec-stack
引用一个部分并显示标题而不是节号的方法。 这将类似于[@sec-stack]
而不是@sec-stack
。
在Quarto交叉引用文档中有各种选项。但是,如果更新了部分标题,我看不到使交叉引用文本更新的方法,只要显式标识符保持不变即可。
这个存在吗?