mirror of
https://github.com/typst/typst
synced 2025-05-14 04:56:26 +08:00
Error for parent-scoped figures without placement (#5151)
This commit is contained in:
parent
db9debca6d
commit
1d2a222818
@ -351,6 +351,12 @@ impl Show for Packed<FigureElem> {
|
||||
.with_float(true)
|
||||
.pack()
|
||||
.spanned(self.span());
|
||||
} else if self.scope(styles) == PlacementScope::Parent {
|
||||
bail!(
|
||||
self.span(),
|
||||
"parent-scoped placement is only available for floating figures";
|
||||
hint: "you can enable floating placement with `figure(placement: auto, ..)`"
|
||||
);
|
||||
}
|
||||
|
||||
Ok(realized)
|
||||
|
@ -77,6 +77,11 @@ We can clearly see that @fig-cylinder and
|
||||
|
||||
#lines(15)
|
||||
|
||||
--- figure-scope-without-placement ---
|
||||
// Error: 2-27 parent-scoped placement is only available for floating figures
|
||||
// Hint: 2-27 you can enable floating placement with `figure(placement: auto, ..)`
|
||||
#figure(scope: "parent")[]
|
||||
|
||||
--- figure-theorem ---
|
||||
// Testing show rules with figures with a simple theorem display
|
||||
#show figure.where(kind: "theorem"): it => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user