0

I have a tikz node \node[] {blah};

and I want to set the color of half the text, such as "ah" to a different color without having to create a new node and try to make everything stick together through positioning. (My text is more complicated, it involves formulas where I want to color some things in it to specify additional information).

Peter Grill
  • 223,288

1 Answers1

2

Change the color inside the node's text with \textcolor (thanks to TeXnician):

\documentclass[tikz,border=2mm]{standalone}
\begin{document}
\begin{tikzpicture}
\node[text=red]{bl\textcolor{blue}{ah}};
\end{tikzpicture}
\end{document}

enter image description here

Ignasi
  • 136,588
  • 3
    Shouldn't it be \textcolor? \color works on the group and doesn't take a second argument. – TeXnician Sep 11 '19 at 07:45
  • @TeXnician Ups! Yes, you're right. Thank you for correcting me. – Ignasi Sep 11 '19 at 09:23
  • Thanks, I guess I should have tried it... It works in math. Seems one should use mathcolor though @Peter Grill –  Sep 11 '19 at 23:47