I have defined a function that acts as a template for a table such that I can have the same style easily in my whole document. In this template, I want the entries of the first line to be bold face and white, both text and math.
Using the code below, the math part doesn’t “inherit” the bold face of the text but it does inherit the white fill of the font. Why doesn’t it inherit the bold property? And how can I make that happen?
#let my_table(..args) = {
show table.cell.where(y:0): set text(fill: white, weight: "bold")
show table.cell: set align(horizon)
table(
rows: (2.5em, 1.5em),
inset: 5pt,
fill: (x,y) => (if y == 0 {(rgb("#984A9C"))} else {}),
stroke: (x,y) => ( bottom: if y > 0 {0.5pt + rgb("#984A9C")} else {0pt}),
..args,
)
}
#{
my_table(
columns: 5,
align: center,
[$n$], [$α$], [$β_"i"$],[four\ (-)], [five],
[1],[55.72],[2.15e-4], [54.28 ],[7.3e-5],
[2],[22.72],[1.424e-3], [23.04 ],[6.26e-4],
)
}