Handle auto returned from supplement function
Description
For example, wants to set the default supplement of math.equation to "Formula" rather than "Equation", this is my approach:
set ref(supplement: it => {
if it.func() == math.equation {
"Formula"
} else {
auto
}
})
It auto returned by the function is directly outputed into the PDF rather than using the default supplement. Have i misunderstood the auto keyword?
Reproduction URL
No response
Operating system
Windows
Typst version
- [X] I am using the latest version of Typst
The auto keyword only has meaning where it is given, so it's likely that this fallback behavior wasn't implemented. Doesn't sound that bad of an idea though. But you could have something like it.func() == table to default to Table, and otherwise default to Figure.
If you already know what the auto indicates (may browser code with Smart:Auto), you can use it instead.
For example, ref(supplement: auto) is equal to ref(supplement: it => {it.supplement})
The original use case should be covered by #set math.equation(supplement: [Formula])
In general, supplement functions will likely be removed since they are now better covered by show-set rules.