I have defined a \blue command which I often use with subscripts, e.g.

\newcommand{\blue}[1]{{\color{blue} \textup{\textbf{#1}}}}

Question: Is there a way to define \blue in such a way that I can simply write


to get the same result as for \blue{v}_{\blue{ij}}, without changing the behavior of \blue{v}?

  • 1
    why do use use \text... comands (so the text fonts not the math fonts) here? Nov 22, 2023 at 11:08

1 Answer 1


Personally I don't really like this kind of construct which hides its behaviour under an apparently easier syntax, but here you go:



See $\blue{v}$ or $\blue{v}_{ij}$, but $\blue{v}^a$

enter image description here

  • 1
    Why not \mathcolor?
    – egreg
    Nov 22, 2023 at 12:45
  • 1
    @egreg Because I keep forgetting that it's in the kernel now... :-)
    – campa
    Nov 22, 2023 at 12:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .