Skip to content
Snippets Groups Projects
Verified Commit a5312585 authored by Lars Frost's avatar Lars Frost
Browse files

Fix spaces around captions

parent 5853fdf5
No related branches found
No related tags found
No related merge requests found
......@@ -24,22 +24,33 @@ codly()
show table.header: strong
show raw.where(block: false): r => {
let e = 0.25em
let f = "DejaVu Sans Mono" // I think this is the default mono font. See https://github.com/typst/typst/issues/2870
// highlight(fill: gray, radius: 3pt, extent: e, {
// h(e)
// text(font: f, r)
// h(e)
// })
box(inset: (x: e, y: e), fill: gray, radius: 3pt, baseline: e, text(font: f, r))
}
show figure.caption: it => block({
let content = align(left, {
strong[#it.supplement #context(it.counter.display(it.numbering))#it.separator]
it.body
layout(size => {
// Add borders, so the caption is better distinguishable from the below paragraph.
grid(columns: (0.02 * size.width, auto, 0.02 * size.width),
[],
align(center, {
block({
align(left, {
strong[#it.supplement #context(it.counter.display(it.numbering))#it.separator]
it.body
})
})
let size = measure(content)
// Add borders, so the caption is better distinguishable from the below paragraph.
grid(columns: (0.02 * size.width, auto, 0.02 * size.width),
[],
align(center, {
block({
content
})
}),
[],
)
}),
[],
)
})
})
set text(lang: lang)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment