Color matrix entries
#4202
-
Consider the following code:
Is it possible to color the background of entries 1, 2, 4, 5 ? |
Beta Was this translation helpful? Give feedback.
Answered by
TS60
May 29, 2024
Replies: 2 comments
-
It's not possible in math mode and not possible without hacks in text mode, I think. #math.mat(
table(
stroke: none,
columns: (10pt, 10pt, 10pt),
inset: 3pt,
align: center,
fill: (x, y) =>
if x <= 1 and y <= 1 { luma(240) }
else { none },
[1],
[2],
[3],
[4],
[5],
[6],
[7],
[8],
[9],
)
) |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
psads-git
-
Nice trick, @TS60! Thanks! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It's not possible in math mode and not possible without hacks in text mode, I think.
#math.mat( table( stroke: none, columns: (10pt, 10pt, 10pt), inset: 3pt, align: center, fill: (x, y) => if x <= 1 and y <= 1 { luma(240) } else { none }, [1], [2], [3], [4], [5], [6], [7], [8], [9], ) )