add: figure plugin
This commit is contained in:
parent
d1a96e1362
commit
4fc4922256
1 changed files with 15 additions and 0 deletions
15
prepends/quote.typ
Normal file
15
prepends/quote.typ
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
// Typst version 14.0.2 outputs a block quote as a <blockquote> followed by
|
||||||
|
// a <p> for the attribution. This makes it difficult to target the
|
||||||
|
// attribution for styling. This snippet instead uses a <blockquote> and
|
||||||
|
// a <figcaption> wrapped in a <figure> block.
|
||||||
|
#show quote.where(block: true): it => {
|
||||||
|
let inner = html.elem("blockquote", it.body)
|
||||||
|
if it.attribution != none {
|
||||||
|
html.elem("figure", {
|
||||||
|
inner
|
||||||
|
html.elem("figcaption", it.attribution)
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
inner
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue