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,23 +24,34 @@ codly() ...@@ -24,23 +24,34 @@ codly()
show table.header: strong 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({ show figure.caption: it => block({
let content = align(left, { layout(size => {
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. // Add borders, so the caption is better distinguishable from the below paragraph.
grid(columns: (0.02 * size.width, auto, 0.02 * size.width), grid(columns: (0.02 * size.width, auto, 0.02 * size.width),
[], [],
align(center, { align(center, {
block({ block({
content align(left, {
strong[#it.supplement #context(it.counter.display(it.numbering))#it.separator]
it.body
})
}) })
}), }),
[], [],
) )
}) })
})
set text(lang: lang) 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