Renderer support
| Package | MathJax | KaTeX | XeTeX |
|---|---|---|---|
color | MathJax: Full | KaTeX: Partial | XeTeX: Full |
textmacros | MathJax: Full | KaTeX: Partial | XeTeX: Full |
Syntax#
\textcoloro:N[\cs]optional control sequencem:N{\cs}control sequencem{a}math contentArgspec o:N m:N m — one optional and two mandatory arguments. In color. Reading argspecs
\textcoloro:N[\cs]optional control sequencem:N{\cs}control sequencem:T{a}text contentArgspec o:N m:N m:T — one optional and two mandatory arguments. In textmacros. Reading argspecs
Examples#
Package variants#
| Package | Signature | Allowed mode | Notes |
|---|---|---|---|
color | o:N m:N m | math | Colors a single argument, used to highlight one term in a formula without affecting what follows; an optional model argument such as rgb, RGB, or gray gives the color numerically. |
textmacros | o:N m:N m:T | text | Colors a span of text inside text-mode content such as \text; the colored argument is text and may contain inline math, and an optional model argument gives the color numerically. |
In TeXForm#
TeXForm parses this entry as prefix syntax; the package determines its argument specification.
See also#
\colorcolor\colorboxcolor\fcolorboxcolor
Test cases#
| Input | Case | MathJax | KaTeX | XeTeX |
|---|---|---|---|---|
\textcolor{blue}{a} | Positive · baseline | Pass | Pass | Pass |
\textcolor[RGB]{0,0,255}{a} | Positive · vary:o[0] | Pass | Fail | Pass |
\textcolor{blue}a | Positive · bare[2] | Pass | Pass | Pass |
\textcolor[\alpha]{0,0,255}{a} | Negative · neg:N[0] | Fail | Fail | Fail |
\textcolor{\alpha}{a} | Negative · neg:N[1] | Pass | Fail | Fail |
| Input | Case | MathJax | KaTeX | XeTeX |
|---|---|---|---|---|
\textcolor{blue}{a} | Positive · baseline | Pass | Pass | Pass |
\textcolor[RGB]{0,0,255}{a} | Positive · vary:o[0] | Pass | Fail | Pass |
\textcolor{blue}a | Positive · bare[2] | Pass | Pass | Pass |
\textcolor[\alpha]{0,0,255}{a} | Negative · neg:N[0] | Fail | Fail | Fail |
\textcolor{\alpha}{a} | Negative · neg:N[1] | Pass | Fail | Fail |
\textcolor{blue}{a^2} | Negative · neg:T[2] | Fail | Fail | Fail |