Replies: 1 comment
|
Thanks for the detailed write-up, in particular the list of what you already tried. I cannot reproduce the
|
|
Thanks for the detailed write-up, in particular the list of what you already tried. I cannot reproduce the
|
Uh oh!
There was an error while loading. Please reload this page.
Description
In a Quarto book, appendix sections get letter-based numbering (A.1, B.2…). I want
@sec-apppointing into an appendix to render as "Appendix A.1" while regular section refs keep "Chapter 3.2". PDF/Typst output is solved via a Typstshow ref:rule, in HTML its a bit harder.Minimal example
_quarto.yml:index.qmd:appendix.qmd:Renders as: See Chapter A.1 for details.
Desired: See Appendix A.1 for details.
What we tried
Lua
Linkfilter atpost-quarto— the filter fires, butel.contentis still the raw section ID (sec-app), not the resolved text. The supplement ("Chapter A.1") is generated after all filter stages.Lua
Linkfilter atpost-render— same result, still raw ID.crossref-sec-title: "Appendix"— changes all section refs, not just appendix ones.Current workaround
A
post-quartoLua filter addsclass="appendix-ref"to links whose target URL contains the appendix section ID (the URL is available at that stage even though the display text isn't). A JS snippet ininclude-after-bodythen swaps the word onDOMContentLoaded:Question
Is there a Quarto-native way to customise section cross references, similar to the custom floats? Or is there a filter stage where the resolved display text is available as an AST element? Something like a
crossref-apx-sec-titlelanguage key would be the ideal solution.All reactions