25.6.11

How to color math symbols?


\textcolor from the xcolor package also works in mathmode, even if the name says otherwise. You can also use $ \color{} C^2 $. It sets the color for the rest of the current scope (group).
Examples:
\documentclass{article}
\usepackage{xcolor}
\begin{document}
$ \color{red} C^2 $
$ \color{yellow} A = \textcolor{blue}{B} \textcolor{red}{-} \textcolor{green} C $
\end{document}

No hay comentarios:

Publicar un comentario