I’m doing a questionnaire and want to mark the correct answer (an item of a numbered list) in bold. But my current approach (shown below) makes only the text, not the marker, bold:
#set enum(numbering: "a)")
#let correct(answer) = {
show enum.item: strong
answer
}
What is the best number?
+ one
#correct[+ two]
+ three
I guess there exists a better solution, but at least this works:
#show enum: it => {
if it.at("label", default: none) == <processed> {
return it
}
let args = it.fields()
let children = args.remove("children")
let correctness = children.map(c => c.body.at("label", default: none) == <correct>)
show <correct>: set text(weight: "bold")
[#enum(
..args,
numbering: n => {
set text(weight: "bold") if correctness.at(n - 1)
numbering("a)", n)
},
..children,
)<processed>]
}
What is the best number?
+ one
+ two<correct>
+ three