Color citation content but not brackets #4143
-
Beta Was this translation helpful? Give feedback.
Answered by
EpicEricEE
May 16, 2024
Replies: 1 comment 1 reply
-
Something like this should work. As #show cite: it => {
// Only color the number, not the brackets.
show regex("\d+"): set text(fill: green)
// or regex("[\p{L}\d+]+") when using the alpha-numerical style
it
}
#show ref: it => {
if it.element == none {
// This is a citation, which is handled above.
return it
}
// Only color the number, not the supplement.
show regex("[\d.]+"): set text(fill: blue)
it
} |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
TheZoq2
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Something like this should work. As
cite
elements are also references, you need to exclude them when coloring other references, so you don't end up with differently colored brackets:...or alpha-numerical with
regex("[\p{L}\d+]+")