I want to create a consistent way to colorize math symbols and operators, and (hopefully) create a package with such functionality.
#let color_palette = (
greek: rgb("#cc517a"),
letters: rgb("#3f83a6"),
brackets: rgb("#2d539e"),
overline: rgb("#668e3d"),
operator: rgb("#c57339"),
logic: rgb("#7759b4"),
palette7: rgb("#33374c"),
palette8: rgb("#8389a3"),
integrals: rgb("#cc3768"),
palette10: rgb("#598030"),
palette11: rgb("#b6662d"),
variables: rgb("#22478e"),
palette13: rgb("#6845ad"),
palette14: rgb("#327698"),
palette15: rgb("#262a3f"),
)
I tried to
- redefine existing functions:
#let alpha = text(color_palette.greek, $alpha$) #let integral = text(color_palette.greek, $integral$) #let dif = text(color_palette.greek, $dif$) #let sup = $op(text(fill: #color_palette.operator, "sup"), limits: #true)$ - Use
show:#show math.equation: it => { show sym.lt.eq: set text(color_palette.logic) show math.in: set text(color_palette.logic) show math.forall: set text(color_palette.logic) show sym.arrow.double.l.r.long: set text(color_palette.logic) show math.lt: set text(color_palette.logic) show "t": set text(color_palette.letters) show "x": set text(color_palette.variables) show "y": set text(color_palette.variables) show "a": set text(color_palette.palette14) show "b": set text(color_palette.palette14) set overline(stroke: color_palette.overline) it }
which produces something like this
How to make max operator not accept the show a: ..., show x: ... etc.? And how to properly colorize symbols and operators without writing 50+ let statements?

