Commands\color

\colorCommand

Switches the current color for the rest of the enclosing group, used to highlight terms in a formula; an optional model argument such as rgb, RGB, or gray gives the color numerically.

{\color{red} x} + y
Available in
color
Kind
declarative
Allowed mode
both
Frequency
0.01% of corpus formulasrank 166 of 263
Commonality
medium
Tags
presentation
Renderer support
PackageMathJaxKaTeXXeTeX
colorMathJax: FullKaTeX: PartialXeTeX: Full
About the test scope

Syntax#

\coloro:N[\cs]optional control sequencem:N{\cs}control sequence

Argspec o:N m:N — one optional and one mandatory argument. Reading argspecs

Examples#

a + {\color{blue} b + c} = d
{\color[rgb]{0.2,0.4,0.8} \sum_{i=1}^{n} x_i}
x + {\color[gray]{0.5} \varepsilon}

In TeXForm#

TeXForm parses this entry as declarative syntax; the package determines its argument specification.

Test cases#

color
InputCaseMathJaxKaTeXXeTeX
{\color{red} a}Positive · baselinePassPassPass
{\color[rgb]{1,0,0} a}Positive · vary:o[0]PassFailPass
{\color[\alpha]{1,0,0} a}Negative · neg:N[0]FailFailFail
{\color{\alpha} a}Negative · neg:N[1]PassFailFail