In slide presentations and elsewhere, it can be handy to have math text color and math background color. In fact, Presentation MathML has the attributes “mathcolor” and “mathbackground”. This post describes the operators Noah Doersing added to his UnicodeMathML implementation to enter text and background color using UnicodeMath. I subsequently added them to the RichEdit math converters.
Inputting math using UnicodeMath into Word and other applications typically doesn’t require special text and background color syntax since these applications have user interfaces (UI) to color text. But UnicodeMath is a useful format for persisting math in files and in plain-text scenarios that don’t have rich UI. I use UnicodeMath to represent math in many math tests because it’s so much easier to input and read than MathML, LaTeX, RTF, and OMML. So, it’s valuable to be able to include text coloring in UnicodeMath.
Following the UnicodeMath tradition of using non-math UnicodeMath symbols to represent operations, Noah chose ✎ (U+270E) as the text color operator and ☁ (U+2601) for background color. The syntax is like that for nth root \root(n&x). For example, “a+✎(red&q^2)+☁(lime&r^2)” converts to OfficeMath in RichEdit as
You can specify a color using the #RRGGBB or #RGB syntax or by the name of a standard HTML color (aqua, black, blue, fuchsia, gray, green, lime, maroon, navy, olive, purple, red, silver, teal, white, yellow). We still need to implement the ITextFont::SetForeColor() and SetBackColor() methods in Word and OfficeArt to get the UnicodeMath color operators to work in Word, PowerPoint and Excel. The color operators work now in OneNote since OneNote uses RichEdit’s TOM implementation.
The TeX-like names for foreground and background color operators are \color and \backcolor, respectively. The latter is easier to enter with math autocomplete.
Noah also added the delimiters ⫷ and ⫸ to hide text appearing inside the delimiters, and the monospace operator ￗ to use monospace characters within ￗ(…). I haven’t added these to the RichEdit implementation yet. Also, we need an operator for the forthcoming MathML “intent” attribute, since UnicodeMath should be interoperable with Presentation MathML.
Thank you very much. This color support is very important!
(Note: This year I’ve sent some reports to the feedback hub. Please contact me if they have not arrived.)