The post RichEdit Hot Keys appeared first on Math in Office.

]]>This post summarizes the hot keys built into RichEdit. A previous post published a summary of all RichEdit hot keys as of 2013, but that post got truncated, it’s missing some hot keys that were added recently, and the hyperlinks need updating. Note that RichEdit clients, e.g., OneNote, often handle all hot keys with RichEdit never seeing the corresponding keyboard messages. Since the client receives the keyboard input, it can do whatever it wants to with that input. This flexibility is valuable particularly for localizing hot keys. RichEdit is “globalized”, but not localized. A number of the hot keys described in this post are English-centric and should be localized by the client. Other hot keys are global by nature and can be used in any locale.

The post Entering Unicode Characters explains several ways to enter arbitrary Unicode characters into applications. My favorite general-purpose way is via Alt+x, which works in Word, Outlook, OneNote, and RichEdit-based programs like WordPad. It ought to work in *all* editors! (Sadly, it doesn’t work in PowerPoint, Excel or Visual Studio, although it’d be easy for these programs to implement it ). It works by entering the Unicode hex code for the character followed by Alt+x. So, entering 2260 Alt+x enters ≠. Entering 1d44e Alt+x enters 𝑎, which is math-italic a. I use this hot key almost as often as I use Ctrl+c (copy) and Ctrl+v (paste). When I’m writing code in Visual Studio, I keep a program running RichEdit handy for entering Unicode symbols. Programs are easier to read with real Unicode characters instead of workarounds using the \xXXXX notation. You can also copy the symbols from appropriate web pages such as Mathematical operators and symbols in Unicode which has most math symbols. But if you know the Unicode code point, the Alt+x hot key is faster. It also lets you find out a character’s Unicode hex value from the character since Alt+x is a toggle: convert hex to character; convert character to hex. Try it, you will like it!

A pair of globalized hot keys set the BiDi directionality of a paragraph. These hot keys depend on knowing the difference between right and left. The WM_KEYDOWN message passes information in the message lparam that specifies right Shift or left Shift. Specifically, byte 2 of the lparam gives the key’s scan code and the value 0x36 is the scan code for the right-shift key ever since IBM shipped its first PC in August, 1981. This information lets RichEdit handle the Ctrl+RightShift hot key to switch the BiDi paragraph directionality to RTL (right to left). Similarly, Ctrl+LeftShift switches to LTR (left to right). RichEdit tracks which Alt, Shift, and Ctrl keys are depressed at any given time. This enables it to differentiate between left Alt for menus and right Alt (AltGr) for keyboard commands. But the most important use is for the Ctrl+RightShift and Ctrl+LeftShift hot keys. Lots of other Word hot keys are implemented in RichEdit.

RichEdit supports Word’s standard subscript and superscript hot keys: Ctrl+= and Ctrl+Shift+=, respectively. These hot keys toggle their respective states. For example, if you type some text, Ctrl+=, and some more text, the latter will be subscripted up until you type Ctrl+= again to go back on the base line. If you type one of these hot keys while some text is selected, that text’s script character will be toggled accordingly. In UnicodeMath, subscripts and superscripts are usually entered with the _ and ^ operators as in [La]TeX, or via the ribbon. But the standard hot keys can be handy provided the scripts are not nested. These hot keys have different meanings in a math zone: Ctrl+= builds up LaTeX or UnicodeMath into OfficeMath and Ctrl+Shift+= builds OfficeMath down into LaTeX or UnicodeMath.

The Ctrl+} hot key is copied from the Visual Studio program editor. Ctrl+} moves the insertion point from one end of a bracketed expression (…), […], {…} to the other end. This is very handy for examining text with nested parentheses or curly braces (RTF, LaTeX, computer programs, JSON, etc.).

Arrow, PgUp/PgDn, and Home/End key behavior is summarized in the following table for ordinary text (behavior in math zones may differ). A depressed state of the Shift, Ctrl, and Alt keys is given by ✓; else the key isn’t depressed.

Key |
Shift |
Ctrl |
Action |

← | Move left char | ||

← | ✓ | Move left word | |

← | ✓ | Select left char | |

← | ✓ | ✓ | Select left word |

↑ | Move up line | ||

↑ | ✓ | Move to start of paragraph | |

↑ | ✓ | Select up line | |

↑ | ✓ | ✓ | Select to start of paragraph |

→ | Move right char | ||

→ | ✓ | Move right word | |

→ | ✓ | Select right char | |

→ | ✓ | ✓ | Select right word |

↓ | Move down line | ||

↓ | ✓ | Move to end of paragraph | |

↓ | ✓ | Select down line | |

↓ | ✓ | ✓ | Select to end of paragraph |

PgUp | Move up one screen | ||

PgUp | ✓ | Move to start of screen | |

PgUp | ✓ | Select up one screen | |

PgUp | ✓ | ✓ | Select to start of screen |

PgDn | Move down one screen | ||

PgDn | ✓ | Move to end of screen | |

PgDn | ✓ | Select down one screen | |

PgDn | ✓ | ✓ | Select to end of screen |

Home | Move to start of line | ||

Home | ✓ | Move to start of story | |

Home | ✓ | Select to start of line | |

Home | ✓ | ✓ | Select to start of story |

End | Move to end of line | ||

End | ✓ | Move to end of story | |

End | ✓ | Select to end of line | |

End | ✓ | ✓ | Select to end of story |

Arrow-key behavior in vertical text corresponds to the different direction. For example, ↓ goes to the next character instead of going to the next line. See Math Selection for a discussion of how the navigation keys work in a math zone. An important point is that if you select a math structure character (start of object, end of object, or end of argument), the whole object is automatically selected.

Typically typing the Tab key inserts a Tab character (U+0009). But depending on context, the Tab key may turn into a navigation key. For example, in a table cell, the Tab key goes to the next cell and Shift+Tab goes to the previous cell (if any). If the selection is in the last cell of a table, the Tab key inserts a new row after the last row with the insertion point in the first cell of the new row.

In math zones, the Tab key goes to the next argument of the current math function and the Shift+Tab key goes to the previous argument. This behavior was originally scheduled for Word as well, but got postponed.

In dialog window controls, Tab characters are ignored. This allows dialogs to use the Tab character to move from control to control.

The Enter key usually inserts an end-of-paragraph character (U+000D—carriage return) and the Shift+Enter key inserts an end-of-line character (U+000B—VT). See Paragraphs and Paragraph Formatting for a discussion of the differences between these kinds of insertions. At the end of a table row, the Enter key inserts a new row after the current row. Inside a math object argument, an Enter key inserts an equation array. This is handy for the lower limit of n-ary objects like summations, which may have more than one subscript range. In a display math zone, Shift+Enter starts a new equation (see The Math Paragraph for details).

If the current selection is nondegenerate (selects one or more characters), the Delete key deletes the selected characters. If the current selection is degenerate, i.e., an insertion point (IP), the Delete key usually deletes the character immediately following the IP. If the character is followed by one or more combining marks, the Delete key deletes the whole combining-mark sequence. Similarly if the character is followed by a variation selector, the Delete key deletes the whole variation-selector sequence. If the Ctrl key is pressed for an insertion point, the Delete key deletes the word following the IP. See Math Selection for a discussion of how the Delete and Backspace keys work in math zones. In particular, the math object is selected if you type Delete at the start of the object or Backspace at the end the object. A second Delete or Backspace then deletes the object. This behavior exists so that you don’t delete things by mistake. If you do so anyway, you can always undo your deletion by typing Ctrl+Z.

The Backspace key is similar to the Delete key but has some differences in addition to operating on the character preceding the insert point. If the current selection is nondegenerate, the Backspace key acts the same as the Delete key and deletes the selected characters. If the current selection is degenerate, i.e., an insertion point, the Backspace key usually deletes the character immediately preceding the insertion point. If that character is a combining mark, the Backspace key deletes that combining mark alone. This differs from the Delete key at the start of a combining-mark sequence, which deletes the whole combining-mark sequence. If the preceding character is a variation selector, the Backspace key deletes the whole variation-selector sequence. If the Ctrl key is pressed for an insertion point, the Backspace key deletes the word preceding the IP. See Math Selection for a discussion of how the Backspace key works in math zones. In particular, the math object is selected if you type Backspace at the end the object. A second Backspace then deletes the object. Alt+Backspace is an alias for Ctrl+Z (undo).

The following table lists additional hot keys handled by RichEdit

Key |
Shift |
Ctrl |
Alt |
Action |

= | ✓ | Toggle subscript mode (not in math zone) Build up selected math text (in math zone) | ||

= | ✓ | ✓ | Toggle superscript mode (not in math zone) Build down selected math text (in math zone) | |

= | ✓ | Insert math zone | ||

= | ✓ | ✓ | Build down selected math text | |

= | ✓ | ✓ | ✓ | Build up selected math text (doesn’t have to be in math zone) |

– | ✓ | Insert soft hyphen (U+00AD) | ||

– | ✓ | ✓ | Insert nonbreaking hyphen (U+20✓✓) | |

, | ✓ | Cedilla accent dead key (English only) | ||

‘ | ✓ | Acute accent dead key (English only) | ||

“ | ✓ | ✓ | Smart quotes (English only) | |

~ | ✓ | ✓ | Tilde accent dead key (English only) | |

; | ✓ | Dieresis accent dead key (English only) | ||

` | ✓ | Grave accent dead key (English only) | ||

> | ✓ | ✓ | Make font bigger | |

< | ✓ | ✓ | Make font smaller | |

! | ✓ | ✓ | ✓ | Insert ¡ (inverted !, English only) |

? | ✓ | ✓ | ✓ | Insert ¿ (English only) |

} | ✓ | Move to other end of bracketed expression (…), […], {…} | ||

1 | ✓ | Single spacing | ||

2 | ✓ | Double spacing | ||

5 | ✓ | 1.5 spacing | ||

6 | ✓ | Caret accent dead key (English only) | ||

A | ✓ | Select All | ||

A | ✓ | ✓ | Toggle all caps | |

B | ✓ | Toggle bold | ||

C | ✓ | Copy selection (Ctrl+Insert is an alias) | ||

E | ✓ | Center selected paragraph(s) | ||

E | ✓ | ✓ | Insert € (except for languages noted below) | |

I | ✓ | Toggle italic | ||

J | ✓ | Justify selected paragraphs(s) | ||

L | ✓ | Left align selected paragraph(s) | ||

L | ✓ | ✓ | Cycle through bullet/numbering types | |

Q | ✓ | Alias for alt+= | ||

R | ✓ | Right align selected paragraph(s) | ||

U | ✓ | Toggle underline | ||

V | ✓ | Paste (Shift+Insert is an alias) | ||

X | ✓ | Copy selection and delete it | ||

X | ✓ | Convert from hex to Unicode and vice versa | ||

Y | ✓ | Redo | ||

Z | ✓ | Undo | ||

F3 | ✓ | If first selected letter is lower-case, change to title case; else change to lower case | ||

F8 | ✓ | ✓ | ✓ | Turn on table autofit |

F12 | ✓ | ✓ | ✓ | Same as Alt+X |

The Euro (€) isn’t inserted by Ctrl+Alt+E for the following languages: UK English, Eire English, Polish, Portuguese, Hungarian, Vietnamese, New Tai Lue, Ogham, Hawaiian, Gaelic, Sesotho, Twana, Kyrgyz, Igbo, Latvian, Georgian, Hebrew, Pashto, Latin, Maltese, Cherokee, Myanmar, Sinhalese, Syriac, Inuktitut, Khmer, Tibetan, and Hindi.

The post RichEdit Hot Keys appeared first on Math in Office.

]]>The post MathML and OMML User Selection Attributes appeared first on Math in Office.

]]>A user selection can be degenerate, that is, an insertion point, or nondegenerate in which case it selects one or more ranges of characters. Multiple disjoint selections (multiple ranges) can be made by using the Ctrl key and clicking appropriately. For math editing, multiple selections aren’t generally very useful, and this post doesn’t treat them. A nondegenerate selection has an *active* end, the end that moves when you enter Shift + an arrow key, and an *anchor* end. The two ends coincide for an insertion point.

To specify the locations of the selection ends in any MathML/OMML content, we define the attribute names selActiveEnd, selAnchorEnd, and selIP (insertion point). The values for these attributes are given in the table

“before” | Before math zone |

“after” | After math zone |

“n“ |
At offset n into an element |

The most common attribute is selIP with the value “0”, i.e., an insertion point at the start of the element, such as the MathML <mi selIP=”0″>a</mi> or the OMML <m:t selIP=”0”>𝑎</m:t>.

With elements containing more than one character like the MathML <mi>sin</mi>, the insertion point might be in between the ‘s’ and the ‘i’, in which case one has <mi selIP=”1″>sin</mi> and the OMML <m:t selIP=“1”>sin</m:t>. If the user then enters Shift+→ to select the ‘i’, the MathML is <mi selAnchorEnd=”1″ selActiveEnd=”2″>sin></mi> and the OMML is <m:t selAnchorEnd=”1″ selActiveEnd=”2″>sin</m:t>.

Another case is for an IP at the end of an object argument. For example, in the MathML fraction <mfrac><mn>1</mn><mn>2</mn></mfrac>, if the IP follows the ‘2’ in the denominator, the selIP attribute appears in MathML as <mn selIP=”1″>2</mn>. This IP is at the end of the denominator, not at the end of the fraction, and entering a character puts the character in the denominator following the ‘2’. The corresponding OMML is <m:t selIP=”1″>2</m:t>.

The offset *n* is given in code units of the Unicode encoding in use. Microsoft Office apps use UTF-16 for which most math alphanumerics are surrogate pairs, that is, 2 code units. If a fraction denominator is 𝑥, an IP following the 𝑥 is specified for a UTF-16 implementation by the MathML as <mi selIP=”2″>x</mi> even though MathML uses the single-unit ASCII letter x to represent the surrogate-pair math-alphabetic 𝑥 (U+1D465). This choice is synchronized with the selection in memory. In OMML, math alphanumerics aren’t translated to ASCII, so this size difference doesn’t occur.

An IP or selection end can follow the last element of a parent element such as being after the parenthesized expression in (𝑎 + 𝑏)² but still in the base of the superscript object. For an IP, this is given in MathML by an empty <mrow selIP=”0″/>:

<msup> <mrow> <mrow><mo>(</mo><mi>a</mi><mo>+</mo><mi>b</mi><mo>)</mo></mrow> <mrow selIP="0"/></mrow> <mn>2</mn></msup>

In OMML, it’s given by an empty run <m:r selIP=”0″/>. The empty <mrow> or empty <m:r> is also used for an IP at the end of the math zone, but still in the math zone.

If an IP is at the start of a math object, such as a fraction, but before the first argument, the selection attribute goes in the math-object element. For example, for the fraction “1 over 2”, an IP at the start of the fraction is indicated by <mfrac selIP=”0″> in MathML and by <m:f selIP=”0″> in OMML.

A selection may start before a math zone and select part or all of the math zone. Similarly, it can start inside the math zone and extend beyond it. The attribute values “before” and “after” are used for such cases, respectively. For example, the math in the statement (selection is highlighted) “the Pythagorean Theorem is 𝑎² + 𝑏² = 𝑐²” is represented by the MathML

<math selAnchorEnd="before"> <msup><mi>a</mi><mn>2</mn></msup> <mo selActiveEnd="0">+</mo> <msup><mi>b</mi><mn>2</mn></msup> <mo>=</mo> <msup><mi>c</mi><mn>2</mn></msup> </math>

where the active end follows the 𝑎². If the whole math zone is embedded in a selection with the active end at the selection end, <math selAnchorEnd=”before” selActiveEnd=”after”> is used. A selected empty math-zone place holder can be represented in MathML by <math selIP=”0″/>.

Although it would be possible to allow selection attributes on most any element, it’s simpler to process and nevertheless general enough to restrict the elements that take selection attributes to

- Character elements: MathML <mi>, <mn>, <mo>, <mtext> and OMML <m:t>
- MathML <mrow> and OMML <m:r>
- Math object elements like MathML <mfrac> and OMML <m:f>
- Math zone element: MathML <math> and OMML <oMath>

The post MathML and OMML User Selection Attributes appeared first on Math in Office.

]]>The post Displaying Enlarged Images in Popup Window appeared first on Math in Office.

]]>Enable the EN_IMAGE notification by sending an EM_SETEVENTMASK message with lParam equal to an event mask that includes the ENM_IMAGE flag defined by

#define ENM_IMAGE 0x00000400 // Event mask for mouse over image

In RichEdit window controls, the notification is sent to the parent window packaged in a WM_NOTIFY message with lParam being a pointer to an ENIMAGE struct defined by

typedef struct _enimage { NMHDR nmhdr; // Notification header UINT msg; // Message causing notification, e.g. WM_LBUTTONDOWN WPARAM wParam; // Msg wParam LPARAM lParam; // Msg lParam IMAGEDATA ImageData; // Image Data } ENIMAGE;

where nmhdr.code = EN_IMAGE defined by

#define EN_IMAGE 0x0721 // Notification when mouse is over an image

IMAGEDATA is defined by

typedef struct _imagedata { LONG cp; // cp of image in RichEdit control IMAGETYPE Type; // Image type LONG Width; // Image width in HIMETRIC units LONG Height; // Image height in HIMETRIC units } IMAGEDATA;

and IMAGETYPE is defined by

typedef enum _IMAGETYPE { IT_NONE, IT_BMP, IT_GIF, IT_JPEG, IT_PNG, IT_ICO, IT_TIFF, IT_WMP, IT_UNKNOWN // User installed WIC codec } IMAGETYPE;

In windowless RichEdit controls, EN_IMAGE is passed to the host via an ITextHost::TxNotify() call. If the image is singly selected, RichEdit doesn’t send EN_IMAGE notifications so that users can use the mouse to resize the image.

Clients can display an enlarged image whenever desired by sending the EM_DISPLAYIMAGE message defined by

#define EM_DISPLAYIMAGE (WM_USER + 386)

The message wParam is a pointer to an IMAGEDATA structure defined above. The message lParam is an ID2D1RenderTarget* for the target window. The client should supply the desired new IMAGEDATA::Width and Height in HIMETRIC units. For example, on receipt of an EN_IMAGE notification, the client can use the data in the IMAGEDATA struct included in the ENIMAGE notification struct. The Width and Height values determine the image aspect ratio, which should be maintained in the enlarged image.

Here is an example with an image of the Matterhorn in the edit control (upper image) and an enlarged image below it

The post Displaying Enlarged Images in Popup Window appeared first on Math in Office.

]]>The post RichEditD2D Window Controls appeared first on Math in Office.

]]>In January 2020, the Microsoft 365 RichEdit introduced a D2D/DirectWrite RichEdit window control with the new window class “RichEditD2D”. It uses D2D/DirectWrite for text and images and the window’s HDC for rendering embedded objects. It doesn’t support printing yet, since printing requires GDI. Fortunately, many applications don’t need to print anymore. On my laptop, the Microsoft 365 RichEdit is housed in C:\Program Files\Microsoft Office\root\vfs\ProgramFilesCommonX64\Microsoft Shared\OFFICE16\riched20.dll.

The RichEditD2D window class is implemented using the ID2D1Factory::CreateDCRenderTarget() method to create a highly functional ID2D1RenderTarget for an HDC. Image display doesn’t need an HDC and is rendered correctly on the D2D/DirectWrite path. OLE objects need an HDC and are queued up for rendering after the D2D/DirectWrite rendering finishes. It’s important to support OLE objects partly because the desktop Outlook To and Cc resolved email addresses are OLE objects.

The RichEditD2D window class works well with the Win32 Outlook To, Cc, and subject lines, rendering emoji in color on the subject line. Released versions of Outlook don’t use the RichEditD2D window class, so you’ll still see black and white emoji’s on Outlook’s Subject line . Also, the RichEditD2D implementation hasn’t been ported to Window’s msftedit.dll used by WordPad and other non-Office programs.

RichEdit *windowless* controls have supported the D2D/DirectWrite code path for years now. For such controls, the client has to implement the ITextHost or ITextHost2 interface, which are more complicated than simply calling CreateWindowEx(). They’re also more flexible, so many programs use windowless RichEdit controls in Office and in Windows. For example, the XAML TextBox and RichTextBox controls use windowless controls running in the D2D/DirectWrite mode and automatically enable color emoji.

For windowless controls, color fonts aren’t enabled by default. To enable them, send the message EM_SETTYPOGRAPHYOPTIONS with wparam = lparam = TO_DEFAULTCOLOREMOJI | TO_DISPLAYFONTCOLOR, where TO_DEFAULTCOLOREMOJI = 0x1000 and TO_DISPLAYFONTCOLOR = 0x2000. In a windowless control, you can do this by calling

ITextServices::TxSendMessage(EM_SETTYPOGRAPHYOPTIONS, TO_DEFAULTCOLOREMOJI | TO_DISPLAYFONTCOLOR, TO_DEFAULTCOLOREMOJI | TO_DISPLAYFONTCOLOR, nullptr);

The post RichEditD2D Window Controls appeared first on Math in Office.

]]>The post MathML mfenced element deprecated on web appeared first on Math in Office.

]]>The MathML <mfenced> element is handy for representing a variety of delimited expressions, such as parenthesized, braced, and bracketed expressions. The expressions can contain separators. Examples are (𝑎 + 𝑏), (𝑎 + 𝑏], and the quantum mechanical expectation value ⟨𝜓|ℋ|𝜓⟩, in which the ‘|’ is a separator. The <mfenced> element corresponds quite closely to the OMML delimiters element <d> used in Office app files, which is why the OfficeMath MathML writers use it.

To show how <mfenced> can be emulated by an <mrow>, consider (𝑎 + 𝑏]. Using <mfenced>, it is represented by

`<mfenced close="]">`

`<mi>a</mi><mo>+</mo><mi>b</mi>`

`</mfenced>`

Since left parenthesis is the default start delimiter, the <mfenced> doesn’t need the attribute open=”(“, although it could have it. The equivalent <mrow> representation is

`<mrow>`

`<mo>(</mo>`

`< mi>a</mi><mo>+</mo><mi>b</mi>`

`<mo>]</mo>`

`</mrow>`

Here the <mo> fence=”true” attribute isn’t needed since the MathML operator dictionary assigns fence=”true” to parentheses, brackets, braces and other Unicode characters that are fences by default. You need the attribute fence=”false” or stretchy=”false” if you don’t want the delimiters to grow to fit their content.

Comparing these representations, we see that <mfenced> is more compact. On the other hand, the <mrow> emulation is more general in that you can include attributes like different math colors on the individual delimiters and you can embellish the delimiters with accents. If you want a delimited expression with just the open delimiter, e.g., {𝑎 + 𝑏, you omit the <mo> for the close delimiter. Similarly, a delimited expression with no open delimiter, e.g., 𝑎 + 𝑏}, omits the open delimiter. For more discussion of <mfenced> and <mrow>, see the MathML 3.0 spec.

The <mfenced> element is an example of Polish prefix notation: you know up front what kind of math object is involved. In contrast, you must parse an <mrow> emulation of <mfenced> to figure out what it represents. The parsing is a little tricky, but it’s not that hard since the delimiter roles are implied by the order in which the delimiters appear inside the <mrow>.

The basic principle is that the start and end delimiters are fences, and any delimiters in between are separators. The main OfficeMath MathML reader uses a SAX parser, which cannot look ahead. But the reader can store information for looking behind. The algorithm is: the first delimiter of an <mrow> is a start delimiter <mo> and other delimiters are marked as separators. When the parser comes to the end of the delimiter expression (</mrow>), it remarks the last delimiter as an end delimiter. If there are only two delimiters, there are no separators. If there’s only one delimiter, it’s a start delimiter unless it comes at the end. This algorithm converts <mrow> delimiter elements into the OfficeMath <d> equivalent. It will be used soon in Office apps since FireFox removed support of <mfenced> (OneNote counted on it in FireFox!) and the Chromium code base won’t support it either. Yes, Chromium will support “core” Presentation MathML. Many browsers are based on Chromium, e.g., Chrome and Edge.

Some MathML elements are “inferred mrow’s” in that they treat multiple children as a single argument and the algorithm works with them as well. Such elements include <math>, <msqrt>, <menclose>, <mphantom>, <mpadded> and <mtd>.

Best practice <mrow> delimiter emulation restricts the contents of the <mrow> to the contents of the delimited expression. But what if there are other things inside an <mrow> such as in (note: <math> is an inferred <mrow>)

<math > <mo>(</mo> <mi>a</mi> <mo>+</mo> <mi>b</mi> <mo>)</mo> <mo>+</mo> <mo>|</mo> <mi>a</mi> <mo>+</mo> <mi>b</mi> <mo>|</mo> </math>

Two tricks are useful: with no form-disambiguating attribute like “form”=”prefix” on the delimiter <mo>’s (as in this example), use the default form value given in the MathML operator dictionary. This works for all default delimiter pairs, but not for ‘|’ which can be used as a separator (infix), open delimiter (prefix), or close delimiter (postfix). For ‘|’ use the algorithm above with a small twist: when there is an active ‘|’ start delimiter, treat a ‘|’ as an end delimiter. When finished processing any delimiter expression, reset the state to “no delimiters”. As such ‘|’ is alternately a start delimiter and end delimiter. This algorithm cannot produce nested absolute-value expressions. To nest an absolute value, use appropriate form attributes, or, best practice, put the absolute value in its own <mrow>.

The post MathML mfenced element deprecated on web appeared first on Math in Office.

]]>The post How I got into technical word processing appeared first on Math in Office.

]]>When I finished my PhD in 1967, I went to Bell Labs to continue working on laser physics and after a year got seduced by the idea of labeling graphs with real built-up, i.e., 2D, mathematical expressions. To this end, I created the SCROLL language (**s**tring and **c**haracter **r**ecording **o**riented **l**ogogrammatic **l**anguage), which was the first language capable of “typesetting” mathematical equations on a computer. I published it in AFIPS Conf. Proc. **35**:525-536, AFIPS Press, Montvale, N.J. (1970). Admittedly SCROLL’s typography was limited. For example, the user had the responsibility of spacing the math, in contrast with TeX, Word 2007, and other sophisticated systems. But it was the first program capable of displaying built-up math, and it was fine for that time to be able to show nicely labeled results at various conferences.

After my two-year stint at Bell Labs, one of my fellow graduate students at Yale, Marlan Scully, suggested coming to the Optical Sciences Center at The University of Arizona to work on lasers and things and in particular to write *Laser Physics*, a book we had talked about writing some day with Willis. Well for a North Easterner, Tucson, Arizona was a most fabulous and interesting place and certainly one way to start seeing the rest of the world. So instead of going to Bell Labs in Murray Hill to work with the great computer science group there (and maybe later on eqn/troff, a TeX competitor), I went to Tucson. Marlan, Willis, and I (well mostly me, with two excellent consultants!) wrote the book and I personally typed over two/thirds of it using a superb new kind of typewriter called the IBM Selectric. It had handy type balls that you could exchange, so you could have italic, symbols, script, and other typefaces. What a huge improvement over the swapping out of keys which we had to do with the older IBM typewriters. The reason I had to type so much of the book was because even with the Selectric our secretaries couldn’t type math very well, especially with subscripted superscripts, integrals, and the like common in the laser theories we were writing about.

*Laser Physics *was typeset in South Korea and the drafts confused *α* and *a,* *ν* and *v* (nu and vee, since Times New Roman also confuses them), and other symbols. It took me over a month to straighten things out, even though the original manuscript was correct. Such problems tweaked my interest in preparing technical documents on computers. Publishing in physics journals was much easier, but you still had to spend significant time proof reading galley proofs.

Around 1978 I got a Diablo daisy-wheel printer to go with my IMSAI Z80 microcomputer. Not only was it much faster than the Selectric, it had many daisies some of which were proportionally spaced, and it was designed to work as a computer printer. I had gotten into microcomputing thinking that by computerizing my house I’d learn something about experimental physics, since Willis taught me that a real physicist needs to know something about both experiment and theory. To handle the proportional spacing, I wrote a printer driver. My colleague Rick Shoemaker, another microcomputer addict, and I decided to write a book called *Interfacing Microcomputers to the Real World*, and we “typeset” it using my printer driver and a daisy-wheel printer. Addison-Wesley published the book, just as it had published *Laser Physics*, but this time using our nice proportionally spaced camera-ready proofs.

Well clearly, we needed to be able to typeset math, so I generalized the printer driver to do so using algorithms like those for the SCROLL language. Another physicist, Mike Aronson, who had written the PMATE editor I was using, suggested that the input format should resemble real linearized math as in the C language rather than the Polish prefix format used in SCROLL. So I wrote a translator to accept a simplified linear format, the forerunner of UnicodeMath which we use in Office apps today. The translator was coded so tightly in Z80 assembly language that it along with the rest of the formatter fitted into 16KB of ROM for a controller some friends of mine created for Diablo daisy-wheel printers. When used with a tractor feed, it could print the whole document with one daisy, roll the document back, print with the next daisy, etc. It was positively wild watching the printer type the symbols in place after printing the main text.

As a laser physicist, I was naturally symbiotically attached to the idea of laser printers, so when HP came out with their early laser printers, I converted the program to 8086 code for use on IBM PCs and HP LaserJets. The editor and formatter ran just fine in MS-DOS in the PC’s incredibly roomy 640KB. Rick and I updated our microcomputer book to *The IBM-PC from the Inside Out*, once again published by Addison-Wesley from our camera-ready copy. I called the program the PS Technical Word Processor, and my users and I wrote many papers and books using it. Well many by a typical professor’s standards, i.e., not by Knuth’s (!), and essentially none by Microsoft’s standards. I really wanted to distribute the approach more widely. With myriad improvements, e.g., LineServices, we now have OfficeMath. And yet there’s still much to do!

The post How I got into technical word processing appeared first on Math in Office.

]]>The post Unicode Math Calligraphic Alphabets appeared first on Math in Office.

]]>1) Here’s an example of chancery and roundhand F’s being used in the same document:

2) Here are examples featuring P’s and C’s in which script letters denote infinity categories

3) Still another paper has the following

4) Both script styles are in the OMS encoding for LaTeX as illustrated by

\documentclass{article} \usepackage{calrsfs} \DeclareMathAlphabet{\pazocal}{OMS}{zplm}{m}{n} \newcommand{\La}{\mathcal{L}} \newcommand{\Lb}{\pazocal{L}} \begin{document} $\La\Lb$ \end{document}

This LaTeX snippet displays a roundhand L followed by a chancery L

Accordingly, the need for both chancery and roundhand alphabets is attested.

Complicating the addition of new alphabets is the fact that the current math-script alphabets may be chancery in one font and roundhand in another. Cambria Math, the first widely used Unicode math font, has chancery letters at the math-script code points, while the Unicode Standard has roundhand letters at those code points. For example, here’s the upper-case math-script H (U+210B) in Cambria Math followed by the one in the Unicode Standard:

The STIX math fonts have also had roundhand letters at the math-script codepoints, but in the STIX Two Math font, they have been changed to chancery. This removes the worst conflict in defining the new alphabets, although other math fonts might have roundhand letters at the current math-script codepoints.

We discuss two unambiguous ways to allow math-chancery and math-roundhand symbols to appear in the same plain-text document:

- Follow a character in the current math-script alphabets with one of two variation selectors much as we use variation selectors (U+FE0E, U+FE0F) for emoji to force text and emoji glyphs, respectively. Specifically, to ensure use of the math-chancery alphabet, follow the current math-script letter with U+FE00. To ensure use of the math roundhand alphabet, follow the current math-script letters with U+FE01.
- Add the missing bold and regular script alphabets

The variation selector approach has the advantages

- Contemporary software supports variation selectors for East Asia and emoji, so adding new variation selector usage shouldn’t be much of a burden
- The variation selector U+FE00 is already used with a number of math operators
- No new code points need to be allocated
- Typical documents can continue to do what they have been doing: ignore the distinction
- If a math font doesn’t support the variation selectors, it falls back naturally to the current script letters instead of displaying the missing-glyph box (but the style difference is lost)

Adding two variation selectors for the math script letters may make people ask why we didn’t use variation selectors for the math alphabets in the first place, but we all know the arguments in favor of what we did (see the blog post on Math Font Binding). Adding two variation selectors seems to solve the script quandary quite well, although the use of variation selectors is generally a poor one for situations where symbol shapes need to be used in a contrastive manner—this case should therefore not serve as a general precedent, but should be seen as an exception, tailored to fit this specific case. One way to implement the variation-selector combinations is to use the OpenType feature tags ‘cv01’ and ‘cv02’.

The second approach adds the missing normal and bold script alphabets. These two new alphabets could go in the 1D380…1D3FF block which is reserved for math alphabets. Programs continue to display what they currently display by default.

It might be worthwhile for programs like Microsoft Word to have a math document-level property that specifies which script alphabet to use for the whole document. Then a user who wants the fancy script glyphs could get them without making any changes except for choosing the desired document property setting. A similar setting could be used for choosing sans-serif alphabets as the default. Such alphabets are often used in chemical formulas.

The choice of chancery glyphs for the math script letters in Cambria Math is partly my fault. I had expected to see roundhand letters in Cambria Math as in the Unicode code charts. In my physics career I used math-script letters a lot, starting with my PhD thesis on Zeeman laser theory (1967) and followed by many papers published in the Physical Review and elsewhere and in my three books on lasers and quantum optics. Occasionally in a review article, chancery letters were substituted for roundhand letters because the publishers didn’t have the latter. And in the early days, the IBM Selectric Script ball and the script daisy wheels only had chancery letters. So I kind of got used to this substitution. Cambria Math was designed partly to look really good on screens, which didn’t have the resolution to display the narrow stem widths of Times New Roman and roundhand letters well. ClearType rendering certainly helped, but it seemed like a good idea to use less resolution demanding chancery letters. (Later Word 2013 disabled ClearType for various reasons and many readers of this blog have complained passionately ever since! With high resolution screens as on my Samsung laptop or the Surface Book, even Times New Roman looks crisp and nice with only gray-scale antialiasing, so hopefully this problem will diminish in time.)

LaTeX has the \mathsf{} and \mathsfit{} control words for math sans-serif upright and italic characters, respectively, and they work with Greek letters. Unlike the chancery/roundhand distinction, which is seldom used contrastively, upright and italic are usually used contrastively in mathematics. The Unicode Standard has upright and italic sans-serif math alphabets corresponding to the ASCII letters, but not for the Greek letters. Accordingly, these two math Greek alphabets should probably be added. The STIX Two Math font has them in the Private Use Area for the time being since users requested them.

Thanks to Asmus Freytag, John Hudson, Rick McGowan and Ken Whistler for enlightening discussions that substantially improved this post.

The post Unicode Math Calligraphic Alphabets appeared first on Math in Office.

]]>Contents

Math Autocomplete. 6

Math Zone Navigation. 6

Using MathML-Based Speech to Edit Math in Different Math Models.

The post Math in Office 2006—2019 Listing appeared first on Math in Office.

]]>Contents

Using MathML-Based Speech to Edit Math in Different Math Models. 7

Using Math Alphanumerics in Code and Web Pages. 7

UI Automation Math Text Support 7

Converting Microsoft Equation Editor Objects to OfficeMath. 8

Integrands, Summands, and Math Function Arguments. 8

Copying Equations from Wikipedia into Office Applications. 8

Equation-Editor Office-Math Feature Comparison. 9

Representation of Math Accents. 9

Other Office Math Editing Facilities. 10

Setting and Getting Math Speech, Braille, UnicodeMath, LaTeX….. 10

Recognizing LaTeX Input in UnicodeMath Input Mode. 10

Math STIX Fonts 2.0 and UTR #25 Updates. 11

Editing Math using MathML for Speech. 11

Microsoft Office Math Speech. 12

Unicode – Nemeth Character Mappings. 12

Speaking Subscripts, Superscripts, and Fractions. 12

Nemeth Braille Alphanumerics and Unicode Math Alphanumerics. 13

Nemeth Braille—the first math linear format 13

Unicode Math Calligraphic Alphabets. 14

Wingdings with Cyrillic, Greek, etc., Characters. 14

Inserting and Getting Math Text in RichEdit 15

RichEdit Language Tag Handling. 15

Single Line RichEdit Performance Runs. 15

Equation Numbering in Office 2016. 16

Two Phonetic Scripts: Vietnamese and Korean. 17

Entering Unicode Characters. 17

RichEdit Plain-Text Controls. 18

Math Greek Letter Bug Fixed. 18

More on Equation Numbering. 19

Book on Technical Writing in Word. 19

RichEdit 8 Feature Additions. 20

Flyweight RichEdit Controls. 20

Arabic and Mathematical Enclosures. 20

MathML on the Windows Clipboard. 20

RichEdit 8 Performance Improvements. 21

Inserting Tables Using the Keyboard. 22

RichEdit 8.0 Accessibility. 22

RichEdit Spell Checking, Autocorrection and Prediction. 22

Office Adopts New Windows Display Technology. 23

Ligatures, Clusters, Combining Marks and Variation Sequences. 23

RichEdit 8.0 TOM Table Interfaces. 23

RichEdit Character Formatting. 24

Keyboard Operator Shortcuts. 24

Klinke’s Streamlined Math Input Notation. 24

Office Insert Symbol Dialog. 25

Sans Serif Mathematical Symbols. 25

Two Math Typography Niceties. 26

Plain Text Math in Bidirectional Contexts. 26

Linear Format Notations for Mathematics. 27

Which Languages a Font Supports. 27

Article/Video on Murray Sargent and Math in Office. 28

Bidi Paragraph with Parenthesized Text 28

Tailoring the Unicode Bidi Algorithm.. 28

Math Ribbon Entry of Subscripts and Superscripts. 29

Keyboard Entry of Subscripts and Superscripts. 29

RichEdit Versions 1.0 through 3.0. 29

Special Capabilities of a Math Font 29

Directionality in Math Zones. 30

Equation Numbering Prototype. 30

RichEdit Friendly Name Hyperlinks. 30

RichEdit Versions Update to 7.0. 30

Automatic RichEdit Hyperlinks. 31

Math Handwriting Recognition. 31

Entering Math via the Linear Format 32

Empty Math Zone Place Holders. 32

Restricted Math Zone Character Formatting. 32

RichEdit Paragraph Indents. 32

OMML Specification, Version 2. 32

Paragraphs and Paragraph Formatting. 33

More on Math Context Menus. 33

Default Document Math Properties. 33

RichEdit’s Nested Table Facility. 33

Improved MathML support in Word 2007. 34

Subscript and Superscript Bases. 34

Extracting OMML from Word 2003 Math Zone Images. 34

Word EQ Field and East Asian Formatting. 35

Hidden Math Features in Word 2007. 35

Weird F020-F0FF characters in Word’s RTF. 35

Rick Shoemaker, quantum magician and microcomputer whiz. 36

Some of My Favorite Sayings. 36

Using RichEdit 6.0 for Math. 36

Using Left/Right Arrow Keys in Mathematical Text 37

Breaking Equations into Multiple Lines. 37

Getting Word 2007 Technical Files into Publisher Pipelines. 37

Science and Nature have difficulties with Word 2007 mathematics. 38

Using Math Italic and Bold in Word 2007. 38

When Formula Autobuildup Occurs. 38

Creating Math Web Documents using Word 2007. 38

Math Find/Replace and Rich Text Searches. 38

Cool Equation Number Macros for Word 2007. 39

Converting Equations from MathType to Word 2007’s Equation Format 39

Office Math RTF and OMML Documentation. 39

Saving Windows from the OS/2 Bulldozer 39

MathML and Ecma Math (OMML) 40

How I got into technical WP. 41

High-Quality Editing and Display of Mathematical Text in Office 2007. 41

Formula Autobuildup in Word 2007. 41

Users of OfficeMath note that entering math symbols using a keyboard can be hard because they don’t know the symbol keywords to type and/or the control words are long. To ease these problems, we create a math autocomplete listbox that displays the control words that match what the user types…

June 14, 2019

This post compares the math-zone edit navigation in Microsoft Office apps to the structured child/parent/next/previous tree navigation provided by MathPlayer and other systems. Combining both approaches results in rich navigation and editing experiences for blind and sighted users alike….

April 30, 2019

This post discusses how an Assistive Technology program (AT) can use Presentation MathML to create consistent speech for editing equations created with different math models, such as OfficeMath and MathType. A goal is to make the speech and editing experience be as similar as possible, even though the underlying math models differ in significant ways…

March 28, 2019

The post UTF-8 RTF shows how much easier it is to read the rich text format (RTF) with Unicode characters instead of the RTF \u*N* notation. You see the real characters instead of signed 16-bit decimal numbers. The same readability improvement occurs in computer programs and web source…

February 27, 2019

Six years have passed since the post RichEdit 8 Feature Additions and a lot has happened in between. Along the way, several versions have shipped, but we might as well call the current one RichEdit 9, This covers RichEdit up through Office 2019 and includes some features of more recent Office 365 versions. ….

January 18, 2019

RichEdit has many character-format properties, most of which are documented for ITextFont2 and CHARFORMAT2. Nevertheless, the OpenType specification defines many more character-format properties called OpenType features consisting of a 32-bit identifier (id) and a 32-bit value. For example, the Gabriola font has stylistic set 6, which displays “Gabriola is graceful” as Variable fonts are the…

December 22, 2018

Microsoft products expose their contents for accessibility purposes via a set of interfaces known as UI Automation (UIA). Currently UIA has no special support for math text. Either the assistive technology program (AT) has to figure out if math is involved or the application has to return math-specific speech text as done with Office math…

November 16, 2018

The post OfficeMath describes the history, model, file format, typography and math font of the native math facility introduced in Office 2007. That post refers to the present post for discussion of OfficeMath user interfaces (UI). OfficeMath UI can be grouped into keyboard, menu/ribbon, ink, and accessibility categories. Let’s consider each of these in turn….

October 17, 2018

Microsoft Word 2007 and RichEdit 6.0 introduced the native Office math facility. PowerPoint, Excel, and OneNote followed suit in 2010, and Mac Word followed in 2011. But ironically the native math facility hasn’t had a recognizable name. “Microsoft Equation Editor” (MEE) seems natural, but it’s the name of the Design Science math editor that shipped…

September 30, 2018

As discussed in the post Editing equations created using the Microsoft Equation Editor, the Microsoft Equation Editor 3.0 (MEE) was removed from Office installations because it has security problems and no maintenance. Microsoft doesn’t have access to the MEE source code and MEE’s author, Design Science, doesn’t maintain it, instead offering the more powerful, upward-compatible…

August 31, 2018

The Microsoft OfficeMath object model (OMML) dedicates explicit arguments for integrands, summands and other N-aryands, as well as for math functions such as trigonometric functions and subscript/superscript bases. Having such arguments aids in calculating the correct math spacing and reveals the math content more precisely. However, other math models, such as LaTeX, Presentation MathML and…

July 31, 2018

The post LaTeX Math in Office describes how to switch between UnicodeMath and LaTeX in Office apps. One handy use of this facility is in copying equations from Wikipedia into a Word document. The process isn’t as simple as selecting the equation, typing Ctrl+C to copy it and Ctrl+V to paste it into your document,…

June 19, 2018

This post compares the Design Science Equation Editor and MathType features with the Microsoft Office native math features (Office Math). Some comparison is given in the post Other Office Math Editing Facilities. Most math constructs are supported by all three environments. Notably missing in Office Math are long division and matrix row/column lines. We start…

May 14, 2018

OneNote Universal has a nifty built-in math facility that lets you solve and graph equations. Enter an equation with pen or keyboard, click on the Insert tab and hit the Math icon. A math panel opens on the right-hand side displaying the equation along with a list box of options depending on the equation. One…

April 29, 2018

The post Math Accents discusses how accent usage in math zones differs from that in ordinary text, notably in the occurrence of multicharacter bases. Even with single character bases, the accents may vary in width while in ordinary text the accent widths are the same for all letters. The present post continues the discussion by…

March 31, 2018

The post RichEdit 8.0 Image Support describes how RichEdit supports popular image formats, such as jpeg’s, png’s and GIF’s. RichEdit 8.1 added direct support for jpeg’s and png’s in the Rich Text Format (RTF) instead of using RichEdit’s proprietary blob format. Even so, GIFs were treated as second-class images in two ways. First, they were…

February 21, 2018

Word’s first math editing facility was the EQ field. Some description of the EQ field and comparison to the Equation Editor, MathType and native math zones is given in Other Office Math Editing Facilities. For mathematical purposes, the native equation facility built into Word and other Office apps is better than the EQ field as…

January 23, 2018

This post describes three ways RichEdit may clip text along with possible solutions. Clipping can occur due to inadequate line height, lack of font vertical padding or insufficient painting of selected text. In some cases, improved rendering code could avoid clipping. Typographic compromises can avoid clipping in other cases. Selection clipping Acetate selection is discussed…

December 28, 2017

Many posts of this blog are about the native Office math facility introduced in Microsoft Word in 2007 and added to PowerPoint, OneNote, and in Excel Text Boxes in 2010. But the first native math-text facility in Microsoft Word was the EQ field, one of many fields, such as time and date. Design Science designed…

November 30, 2017

Greek letters often appear as variables in mathematical text. This post describes their support in [La]TeX and Unicode and how their math usage sometimes differs from modern Greek text. For example, the upper-case upsilon looks like a Latin Y in modern Greek, but a curvy Υ in math zones. Similarly, in math zones the two…

October 31, 2017

This post augments the post Inserting and Getting Math Text in RichEdit by documenting the RichEdit options for ITextRange2::SetText2(options, bstr) and ITextRange2::GetText2(options, pbstr) including those for math speech and math braille. As such, this post is for programmers. But more generally, it reveals that RichEdit supports Nemeth math braille (!). All options work in the…

September 28, 2017

In offering a LaTeX math input mode, we’ve run into the problem that a user might type some LaTeX while the UnicodeMath input mode is active and get something unintended and confusing. This post reveals ways in which the build-up engine can recognize this situation and maybe cue the user to switch to the LaTeX…

August 31, 2017

For a while now it’s been possible to switch Word’s math input mode from UnicodeMath to LaTeX. We didn’t advertise this highly requested feature since it needed more work. I wrote the original conversion routines back in Fall, 2007 and used them in preparing PowerPoint physics presentations since they’re handy for copying equations from Wikipedia…

July 30, 2017

For sighted users, Microsoft Office applications like Word, PowerPoint and OneNote have user interface (UI) cues that reveal math zones, selected text, the insertion point (IP) if no text is selected, and the argument of the innermost math object (fraction, subscript, integral, matrix, …) that contains the IP. Math speech also reveals these properties. These…

June 21, 2017

Two math updates have happened: 1) the STIX math fonts have been upgraded to Version 2.0, which works well with Microsoft Word, and 2) Unicode Technical Report #25, Unicode Support Mathematics has been updated to include discussion of slashed-zero and empty-set variations. This post discusses these updates. STIX Fonts 2.0 We compare STIX 2 Math…

June 1, 2017

Mathematical text in modern technical documents appears in math zones. This is true for LaTeX, Microsoft Office math, MathType, Open Office, HTML5, etc. The main reason is that the typography of mathematical text differs from that for ordinary text (see, for example, User Spaces in Math Zones) and has special layout constructs such as square…

April 18, 2017

The posts Microsoft Office Math Speech and Speaking of math… describe two kinds of math-speech granularities: coarse-grained (navigate by words), which speaks math expressions fluently in a natural language, and fine-grained (navigate by characters), which reveals the content at the insertion point (IP) in sufficient detail to enable editing. Several Assistive Technologies (ATs) use MathML…

March 19, 2017

Microsoft Office math-aware applications can now speak math in over 18 different languages! Try it out with native math zones in Word by enabling Narrator (type CapsLock + Enter) and navigate a math zone as described in the post Speaking of math… There are two math-speech granularities: coarse-grained (navigate by words), which speaks math expressions…

February 27, 2017

In addition to handling 2D arrangements such as fractions, root, subscripts and superscripts, math layout programs need to be able to display the myriad math symbols discussed in Unicode Technical Report #25 Unicode Support for Mathematics. To interoperate with Nemeth braille, such programs need to map between Unicode characters and Nemeth braille sequences. Since Unicode…

January 31, 2017

People often ask questions about the nature of the text insertion point (IP), the blinking vertical bar in between two characters on screen. This post attempts to address some of these questions, notably about where the IP is, what it means, how it works in BiDi text, how to control it programmatically and how it…

December 28, 2016

A new version of Unicode Technical Note #28, UnicodeMath, a Nearly Plain-Text Encoding of Mathematics is now available. It updates several topics and references and uses the name UnicodeMath instead of Unicode linear format. Since there are several math linear formats, such as Nemeth braille, [La]TeX, and AsciiMath, having the name UnicodeMath clarifies the…

November 30, 2016

You might think that there’s just one good way to speak a math expression, at least in each natural language. But actually, there are a number of good ways to speak math expressions, each with advantages and disadvantages. This post discusses some of these choices for subscripts, superscripts, and fractions. The post Speaking of math……

October 30, 2016

In writing the post Nemeth Braille—the first math linear format, I became increasingly aware that the Unicode Nearly Plain Text Encoding of Mathematics needed a better name than “linear format”. In addition to the Nemeth braille linear format, there are other math linear formats some of which are described in the post Linear Format Notations…

September 7, 2016

Both Unicode and Nemeth braille include sets of math alphanumerics. Section 2.2 of Unicode Technical Report #25 discusses the math alphanumerics and why they’re important for math. Microsoft Office math zones use math alphabetics for most variables and support the math digit sets as well. Accordingly, we need mappings between Unicode and Nemeth braille math alphanumerics….

August 26, 2016

The 6-dot Nemeth braille encoding was created by Abraham Nemeth for mathematical and scientific notation and is general enough to encode almost all of the Microsoft Office math notation. He started working on his encoding in 1946 and it was first published in 1952 by the American Printing House for the Blind. It’s a little…

July 31, 2016

This post discusses how a combination of the Office in-memory built-up format (“Professional” in Word) and UnicodeMath is ideal for generating speech for math zones. Neither format was designed with speech in mind. The built-up format was designed to aid the creation of beautiful math typography. UnicodeMath was designed to aid math keyboard input by…

June 30, 2016

A text editor has to provide ways of reading and modifying text. For external clients, the RichEdit editor provides the Text Object Model (TOM) interfaces including ITextRange[2] and ITextSelection[2].These interfaces are quite efficient, since they are lightweight wrappers around the internal editing machinery. This post describes how RichEdit’s design came to be and notes a…

May 31, 2016

This post discusses some aspects of making mathematical equations accessible to blind people. Presumably equations that are simple typographically, such as E = mc², are accessible with the use of standard left and right arrow key navigation and with each variable and two-dimensional construct being spoken when the insertion point is moved to them. At…

April 28, 2016

As discussed in the post RichEdit Font Binding, in a text string when a character appears that isn’t supported by the current font, an appropriate font needs to be used. There are a number of pitfalls in making such font choices. For example, the post Math Font Binding discusses special requirements for font binding in…

March 28, 2016

Unicode needs a way to encode bold and regular math Calligraphic/Chancery alphabets as well as bold and regular script alphabets, since it turns out that Calligraphic and Script alphabets are used contrastively by some authors and [La]TeX has had both kinds of letters. In most documents, Script and Calligraphic shapes can be substituted for one…

February 5, 2016

This post describes some seemingly anomalous behavior that can happen when you type characters that have Unicode code points above U+00FF, such as Cyrillic and Greek characters, while a SYMBOL_CHARSET font like Wingdings is active. By definition such fonts are not Unicode fonts and don’t have characters with code points above 255 (0xFF in hexadecimal)….

January 4, 2016

The post RichEdit Font Binding outlines how RichEdit chooses fonts when you paste or otherwise enter plain text into a RichEdit control. But it doesn’t describe how math font binding differs from natural-language font binding. The differences are due to 1) Math styles like math italic, bold, script, Fraktur and double-struck are obtained by character…

December 7, 2015

Starting with the Office 2007 RichEdit, it has been possible to enter math using the keyboard and to read and write RTF files that contain math zones. The RichEdit Text Object Model (TOM) ITextRange2 interface has methods to handle math programmatically, such as ITextRange2::BuildUpMath() and ITextRange2::SetInlineObject() and GetInlineObject(). But the methods don’t offer convenient ways…

November 22, 2015

For years, many applications have used the locale ID (LCID) to identify the language and locale for text and other data. For example since 1997 (RichEdit 2.0), RichEdit’s character formatting has included CHARFORMAT2::lcid. The LCID can, in fact, describe the vast majority of language/locale combinations in use as far as text is concerned. However the…

October 19, 2015

The popularity of emoji symbols has encouraged a variety of technological innovations, notably fonts with multicolor characters. This is different from just having a text color, which is described in RichEdit Colors. While some colored glyphs were part of the original Japanese emoji standards, colored glyphs got much more elegant when Apple introduced its proprietary…

September 24, 2015

In applications that have lots of independent text instances such as spreadsheets and complex dialogs, one wants to know the tradeoffs between rapid display, memory usage, and editing functionality. As noted in the post Flyweight RichEdit Controls, using RichEdit to display such text avoids display glitches in switching from static display to edit mode and…

August 30, 2015

With on-screen keyboards used commonly on phones, tablets and even on laptops, one might wonder how such keyboards can input characters and commands into a RichEdit control. With traditional hardware keyboards, messages like WM_CHAR, WM_KEYDOWN, and WM_SYSKEYDOWN offer a wide variety of input data. But the new touch-screen keyboards typically don’t use messages. This post…

July 6, 2015

Typical documents use black for the text color and white for the background. This gives the highest contrast. Hyperlinks are often displayed in blue, which gives good contrast on a white background. But other combinations of colors may not be so easily distinguishable. This post describes how RichEdit handles such combinations and muses about possible…

June 8, 2015

Word 2016 and PowerPoint 2016 join OneNote 2010 (and later) in offering a way to display equation numbers flushed to the right margin. To enter an equation number using the linear format (see Section 3.21), type the equation followed by a # (U+0023) followed by the desired equation number text and hit Enter. For example,…

May 14, 2015

The earlier post, RichEdit Hot Keys, lists all built-in RichEdit hot keys. In particular, it lists a popular hot key for typing the Euro (€), ctrl+alt+e, which works for some languages, such as US English. A problem may arise when altGr+e is assigned to some other character, such as é in Spanish keyboards. This is…

April 20, 2015

Occasionally people ask how foreground (text) and background colors work in RichEdit. This post gives an overview of RichEdit colors in a variety of scenarios including default coloring, formatted coloring, selection coloring (both normal and acetate), math-zone highlighting and special draft and high-contrast modes. It also describes refinements such as switching to XOR coloring when…

March 27, 2015

To guide proofing tools to use the correct dictionaries and autocorrect lists as well as to display preferred glyphs, it’s very handy to associate language tags with text runs. For many years, Windows has provided a language tag property called the LCID (locale identifier) consisting of a 32-bit unsigned integer. The LCID suffices for many…

February 14, 2015

I just visited two very interesting countries, Vietnam and Korea. Being actively involved in writing software (mostly RichEdit) for editing the world’s scripts, I was naturally fascinated to see Vietnamese and Korean text displayed in profusion. The Vietnamese and Korean scripts were designed with a common purpose in mind: enable the languages to be read…

January 27, 2015

Chinese characters are used to represent syllables and words in a number of East Asian languages. In each language, the characters are pronounced differently and their meanings may differ as well. To help clarify the pronunciation and/or semantics, “ruby text” can be used. In vertical text layout, ruby text is positioned vertically to the right…

December 27, 2014

The Unicode Standard 7.0 has 2311 math symbols not including the ASCII letters and the standard combining marks like tilde, which are also used in math zones. Such a large number of symbols can be confusing if not intimidating to people who don’t use mathematics professionally. Even those who use math a lot don’t use…

November 26, 2014

This post involves an old passion of mine, computerizing homes. First some background. I spent the academic year 1975-76 on sabbatical at the Max Planck Institute for Solid-State Physics and the University of Stuttgart in Stuttgart, Germany researching nonlinear laser spectroscopy theory, generally of atomic media. But the Max Planck Institute aroused my curiosity about…

October 21, 2014

As noted in the post Symbols and Emoji we have the ability to input characters in much more powerful ways than possible before the advent of modern computers and smart phones. We can insert symbols chosen from large galleries (Character Map, Office Insert Symbol Dialog, Office math ribbon, soft keyboards) to represent words and ideas….

September 30, 2014

The emoji symbols (literally picture characters) introduced by Japanese cell phone carriers have captured the imaginations of computer users around the world. So much so that occasionally many symbols created long before the emoji are now being treated as emoji. This post addresses the history of symbols in general and how emoji symbols fit in…

August 31, 2014

A Unicode plain-text editor appears to have a single set of character formatting properties for the entire text and a single set of paragraph formatting properties. With NotePad, for example, you can choose a normal, bold, italic, or bold-italic font of any reasonable size and your choice is used consistently throughout the text (at least…

July 21, 2014

When Word 2007 and later versions write an RTF file that includes math alphanumeric symbols (see U+1D400..U+1D7FF), they convert the symbols back to ASCII or Greek in the BMP (basic multilingual plane) and then write the characters out using the appropriate charset, namely ANSI_CHARSET for Latin letters like a..z, and GREEK_CHARSET for Greek letters. In…

June 26, 2014

Kaspar commented on my post Office Adopts New Windows Display Technology “I always wondered why the text in OneNote 2013 looks so much better than Word 2013.” Curious, I typed some math into Word and OneNote on my 3200 x 1800 resolution Samsung ATIV laptop and compared them. The two displays looked pretty similar! For…

May 31, 2014

The math tables created for the math facility in Word 2007 and other Microsoft Office applications are now officially part of the OpenType standard ISO/IEC CD 14496-22 3rd edition. See Section 6.3.6 MATH. You can download a copy of the whole standard from here. We always hoped that the tables would become part of the official…

April 27, 2014

More precisely, this post is about BiDi Internationalized Resource Identifiers (IRIs). These objects are a generalization of Universal Resource Identifiers (URIs) that can contain a large variety of nonASCII characters, such as most alphabetic characters and Chinese characters. Complications occur when BiDi characters such as Arabic and Hebrew are used in IRIs especially when displayed…

March 30, 2014

The book Creating Research and Scientific Documents using Microsoft Word gives a method for numbering equations that works with all versions of Word from Word 2007 on and has automatic renumbering of the equations and the references to the equations. Those are very attractive features. The approach inserts a center tab before the equation and…

February 21, 2014

There’s a new Microsoft Press book on creating technical documents in Word, entitled *Creating Research and Scientific Documents using Microsoft Word*. Alexander Mamishev, Professor of Electrical Engineering at the University of Washington, is the primary author and I wrote most of Chapter 6 on equations. The book emphasizes the utility of Word templates in streamlining…

January 15, 2014

For RichEdit 4.0 (Windows XP SP1), I developed a UTF-8 version of the Rich Text Format (RTF). The reason was to have a faster, more reliable way of handling copy/paste for RichEdit than regular RTF. RichEdit 5.0 added the binary format for this purpose (and for OneNote) and RichEdit 6.0 added a still faster internal…

November 20, 2013

This post summarizes the hot keys built into RichEdit. Previous posts have described various math hot keys like Alt+=. But AFAIK no one has published a summary of all the RichEdit hot keys. Note that RichEdit clients, e.g., OneNote, often handle all hot key combinations with RichEdit never seeing the corresponding keyboard messages. Since the…

October 30, 2013

The time has come to summarize the features added in RichEdit 8, which shipped with Windows 8 and Office 2013. Since so much was added, I wrote a number of blog posts over the last twelve months about the larger RichEdit 8 features. The present post lists those features and then describes some smaller features…

September 7, 2013

Early in this century with texting becoming an increasingly popular way to communicate on cell phones, the Japanese created an imaginative new way of conveying an idea or emotion: use cool, maybe colorful, maybe animated, symbols called emoji. Some emoji resembled symbols that were already encoded in Unicode, but most were new. Examples include “red…

August 23, 2013

Back when RichEdit 2.0 was being designed, Christian Fortini had a dream that every text string in a Forms^3 form or dialog would be a light-weight RichEdit control. That way there would be no display glitches in switching from static display to edit mode and text could be copied, edited, and made accessible. To keep…

July 25, 2013

This post describes the Arabic subtending marks and discusses how their editing and display could be significantly improved by using a mathematical layout engine instead of using a complex-script shaping engine. Unicode has a set of six Arabic subtending or enclosure characters located at U+0600..U+0604 (, , , , , respectively) and the End-of-Ayah mark U+06DD ()….

June 30, 2013

Sometimes people enquire how the Windows clipboard works and whether it supports MathML, jpeg, RTF and other formats in addition to built-in formats like CF_BITMAP and CF_UNICODETEXT that are defined in winuser.h. The answer to the second question is that Windows supports any format that you want to define, including private formats. This post gives…

May 27, 2013

In the (almost) old days, when you paste a bitmap into a rich-text editor, the editor would give it to OLE (Object Linking and Embedding) to figure out what to do with it. But these days, OLE isn’t always available, so it’s more general to paste them using the Windows Imaging Component (WIC) mentioned in…

April 29, 2013

One of our testers inserted a Microsoft logo image into RichEdit and saw an inky black rectangle. Ignoring any connotation that this might be a bad omen (!), I proceeded to study image formats in Wikipedia and in MSDN. (Not that I hadn’t already scoured such documentation). Pretty soon I started to suspect that the image, which…

March 16, 2013

This post describes a couple of performance improvements introduced in RichEdit 8: 1) a more efficient display tree, and 2) a faster rich-text formatting mechanism. Performance is always of interest, partly to make the user experience more enjoyable (animations should be smooth, not jerky, and who wants to wait for things to happen?) and partly…

February 22, 2013

I didn’t think we had any serious math build-up bugs thanks to very extensive testing, but there was at least one bug anyhow. (If you find such bugs, please let me know by email or as a comment on a post). This one was quite simple and it existed in both Office 2010 and 2013….

February 18, 2013

Windows 8 introduced substantially better touch facilities than those available in Windows 7. One cool thing is the new touch on-screen keyboard, which is enabled if you have a touch screen. To see it, swipe in from the right side, touch the cog icon for settings, touch the Keyboard, and then touch “Touch keyboard and…

January 29, 2013

Notation is a favorite topic of mine being at least partly inspired by Bertrand Russell, who once wrote, “A good notation has a subtlety and suggestiveness which at times make it seem almost like a live teacher…and a perfect notation would be a substitute for thought.” An earlier post on notation deals with the linear…

December 31, 2012

In this day and age with touch pinch and expand zooming of screens, zoom is everywhere! So you might wonder how to zoom the contents of a RichEdit control. There are two ways: 1) maintaining the display width and rewrapping the text as necessary to fill the client rectangle, and 2) zooming everything including the…

November 16, 2012

This post describes a little trick that lets you insert a table into RichEdit and into Word just using the keyboard. Admittedly in Word, you can use the handy table tool on the Insert tab with a mouse or with a keyboard. But in WordPad and the Windows RT RichEditBox, you don’t have a table…

October 12, 2012

An important part of a computer’s user interface is to provide for user interaction alternatives to the usual sight-oriented methods. Such capability requires programmatic access to what’s on the screen so that screen reader programs can express the content using voice or other means. Microsoft UI Automation (UIA) provides such access. A valuable side benefit…

September 14, 2012

RichEdit has provided support for client spell checking (TOM object model and temporary character formatting—see tomApplyTmp) and autocorrect (see EM_SETAUTOCORRECTPROC) for many years. But it has been the RichEdit client’s responsibility to access the spell-checking and autocorrection components, except for the built-in math autocorrect option. For clients like OneNote and Outlook, such a responsibility is…

August 31, 2012

Office 2013 has undergone a substantial shift to a relatively new display facility, Direct2D, and a new text facility, DirectWrite. These are the display facilities that are used on Windows Phone 8, the new Windows RT slates, and optionally on Windows 7 & 8. Up through Office 2010, the Windows Graphics Device Interface (GDI) and…

July 29, 2012

On the surface, Unicode appears to be a just large collection of characters. But before Unicode text is displayed, substantial “shaping” can occur. This shaping is the process of mapping the Unicode characters to glyphs and placing them correctly on the display. The mapping is, in general, n characters to m glyphs. For most characters…

June 29, 2012

Up until RichEdit 8.0, RichEdit’s native image support was limited to metafiles, enhanced metafiles, and simple images like bitmaps (bmp’s). If OLE (Object Linking and Embedding) had supported other types, such as jpg’s, png’s and gif’s, RichEdit would have supported them automatically. But OLE’s functionality was frozen years ago. RichEdit 5.0 added “blobs”, which are…

May 25, 2012

An earlier post describes the RichEdit nested table facility and how the EM_INSERTTABLE and EM_GETTABLEPARMS messages could be used to insert and examine tables. Now those messages are documented in MSDN along with a new message, EM_SETTABLEPARMS that allows one to modify tables. For additional convenience, RichEdit 8.0 adds table support to the TOM text…

April 22, 2012

There’s been a lot of buzz about the Windows 8 Consumer Preview and it is really exciting. One particularly exciting thing missing in the buzz is that Windows 8 contains a new RichEdit! Since the new version is now publicly documented on MSDN, I can write about it. I found the public documentation by Binging…

March 3, 2012

RichEdit’s name derives from its ability to represent rich text. Such text is comprised of text runs with different sets of character and paragraph formatting properties along with embedded objects, such as images. Some discussion of paragraph formatting is given in an earlier post. The present post discusses how character formatting is represented in RichEdit…

February 8, 2012

I started this blog in 2006 and now it’s 2012. How time flies! This post provides links relevant to the main theme of the blog, math editing and display in Microsoft Office grouped according to area, such as keyboard, formatting, background, …

January 9, 2012

The previous post introduces Hermann Klinke’s math input notation, which he developed to speed up entry of equations for real-time note taking in OneNote. The post is followed by a very interesting set of comments comparing high-speed, and yet easy-to-remember, input sequences. Some of these involve hot keys and some can be done with math…

December 2, 2011

Hermann Klinke has designed and instrumented an input notation on top of the Microsoft Office math facility that you may want to try. It significantly reduces the number of keystrokes needed to input mathematical text. His motivation is to have a way to enter equations in real time while taking lecture notes. He has documentation…

November 20, 2011

Accents are quite common in mathematical text. For example, in physics one uses one- to four-dot accents to designate the first through fourth time derivatives, respectively. Primes are often used on integration variables. Transforms can be designated by tildes and averages by overlines. While accents are usually applied to a single base character, they can…

October 30, 2011

This blog post describes a cool insert-symbol facility built into Office applications like Word, PowerPoint, Excel, and Outlook. The facility is handy for locating mathematical symbols as well as other characters. And with the developments in Unicode these days, that means a lot of symbols! Recently the Unicode Technical Committee and the ISO WG2 Committee…

September 29, 2011

Most mathematical documents and books use fonts with serifs, such as Times Roman. However mathematical expressions can also be displayed with sans-serif letters, such as the font this post uses. In fact, sans-serif letters are used sufficiently often in mathematical typography that six sets of them are included in the Unicode Mathematical Alphanumeric Symbols. Further rationale…

August 29, 2011

As you can see in this document, Presentation MathML is part of HTML5. This is very exciting, since HTML5 is becoming the primary new web standard format. You might think that this would automatically make it easy to render MathML in a browser. In fact, FireFox does a decent job of rendering MathML, having incorporated…

July 31, 2011

Nali commented on the post Office 2007 Math Editing/Display that it would be nice to have keyboard hot keys to switch between Professional and Linear format (build up/down), and between Display and Inline mode of equations. This is a great idea especially for those of us who like to use keyboards to speed up math…

June 21, 2011

People have been asking about a couple of acronyms fairly often these days, so here’s a blog post on them. They are described on the web already if you type the right queries, but a little more motivation might be useful. The acronyms are NINCH for “no input no change” and EMU for “English Metric…

May 7, 2011

Roughly eight years ago, some colleagues and I had the good fortune to spend an extraordinary afternoon with Donald Knuth, the primary author of TeX, at his home on the Stanford University campus. Among many things, Donald showed us how he uses TeX to typeset his computer-science papers and books exactly the way he wants…

April 30, 2011

One user (Leperkawn) commented “There is basically no documentation on the \eqarray command so I’ll post a quick example that I had to figure out from trial and error.” Before looking at his interesting example, here’s the text in Section 3.19 of the linear format paper describing how to type in equation arrays: To align…

March 30, 2011

In plain text, bidirectional text (text including some Arabic or Hebrew) is generally displayed according to the Unicode Bidi Algorithm (UBA). Since we’re interested in math, it’s pertinent to study a bit how simple mathematical expressions appear according to the UBA. Ideally math is displayed using higher-order protocols that overrule the UBA appropriately, but in…

February 28, 2011

This is a test to see how I can use Live Writer to make blog posts more nicely. In particular, it’s desirable to display equations by copying them from Word. For example, this is the mode locking formula which you can enter by typing \integral<space> in a math zone. In PowerPoint 2010, it builds up…

January 1, 2011

In my MathML 3.0 post, I noted that several things were postponed for future consideration. The present post lists math document properties and equation numbers. Other members of the MathML Working Group can undoubtedly add to the list. Default Document Math Properties A number of math display properties have document defaults. They are the ones…

December 31, 2010

Office for Mac 2011 has many cool additions. The best of them all (well you know my bias!) is that Mac Word 2011 has the elegant Office math editing and display facility! Although I do not own a Mac, my next-door neighbor Dylan Tom does and we gave the math facility a check out run….

November 22, 2010

The W3C announced October 21, 2010 that the MathML 3.0 specification is a W3C Recommendation. This post describes some of the features added to MathML in version 3.0. The specification also includes numerous clarifications that are helpful for people wanting to implement MathML 3.0. The specification’s introductory section “Status of this Document” concludes with a…

October 28, 2010

This is a post about some of the early days in the life of an amazing person, Nathan Myhrvold. Nathan and his good friend and colleague, Chuck Whitmer, had completed PhD’s in theoretical physics at Princeton. They wanted to investigate advanced behaviors in a field called deterministic chaos. This field deals with how dynamical systems…

September 28, 2010

I have been having a great discussion with Christian Lerch about computer-oriented mathematical notations. He has a program that lets you input MathML using a pure ASCII syntax. It is similar to ASCIIMathML. A lightly commented EBNF grammar of his MathEL language as implemented for the time being (still beta and evolving a bit) is…

August 30, 2010

A recent post describes how RichEdit chooses default fonts for Unicode characters. The method assigns a character repertoire (CharRep) to each character and queries fonts to find out which CharRep’s they support. If the current font doesn’t support the CharRep for a character, RichEdit chooses a font that does. A variety of heuristics are used…

July 27, 2010

The article Professor’s Laser Focus Gets Math into Office tells some of the story behind the Math in Office project. It also gives a link to a video that includes a sequence of me showing how easy it is to type in the binomial theorem. Hope you like it J

June 17, 2010

Suppose a user pastes some plain text into a document. In principle, that text can contain any Unicode character. That includes virtually all characters used in the current languages of the world along with many from ancient scripts and a plethora of symbols, mathematical and otherwise, that don’t belong to any language in particular. The…

June 9, 2010

The previous post described four tailorings of the Unicode Bidi Algorithm (UBA) in situations where the UBA display is confusing or even misleading. The present post adds another set of scenarios to this list, namely strange renderings of paragraphs that contain parenthesized or quoted text. An algorithm for displaying such text in a reasonable way…

May 6, 2010

The Unicode Bidi Algorithm is a very useful, general, and standard approach for displaying text that contains right-to-left scripts, such as Arabic and Hebrew. But there are situations in which it is awkward to use and/or is visually confusing. This post considers three such situations: math zones, International Resource Identifiers (IRIs), and HTML spans with…

April 6, 2010

Unicode Nearly Plain-Text Encoding of Mathematics, Version 3 (Unicode Technical Note #28) is now posted. The differences between Version 1 and 2 of that paper are largely cosmetic, but there were enough changes in Version 2 to merit a new number. Version 2 is mostly implemented in Microsoft Word 2007, where it is referred to…

March 13, 2010

As noted in the previous post Keyboard Entry of Subscripts and Superscripts, the preferred way to enter subscripts and superscripts is by using the keyboard, rather than the math ribbon. For example, type alt+= to insert a math zone followed by a^2+b^2=c^2<space> to enter the Pythagorean Theorem. This method is a lot faster than clicking…

March 3, 2010

The Send-a-Smile and Send-a-Frown feedback from Office beta users is very useful for finding out where we’ve done right and wrong things with the new Office. From time to time I’ll post thoughts on some of the feedback that pertains to the math facility. The present post discusses the hot keys for entering subscripts and…

February 8, 2010

Sometimes you need to enter a negated operator like ≠. If you’re a C/C++ programmer, you might think that != should map to ≠, since that’s what != means in those languages (and some others). But since in mathematics ! means factorial, this choice is a bad idea for inputting ≠ into mathematical text. You…

February 5, 2010

Digging through old doc files, I ran across the following summary of RichEdit up through Version 3.0. It’s more detailed than my post on RichEdit Versions, so it might be of interest to history buffs, anyhow. And it does describe the riched20.dll that still ships with Windows, mostly for purposes of backward compatibility. I wrote…

January 12, 2010

A fairly common inquiry is how a program can use and access the many special glyph variants of a math font. It’s clearly a much more intricate interaction than encountered in most text applications. This post outlines how the Office math layout software interacts with the Cambria Math font and, in principle, with any other…

January 11, 2010

Math fonts differ from other fonts not only in their extensive coverage of math operators, symbols, and math alphanumerics, but also in the large number of glyph variants they have to support two sizes of sub/superscripts and many sizes of stretchable characters like parentheses and brackets. Some such glyphs can be many times as high…

December 1, 2009

In most places, mathematical text is written “left to right” (LTR). For example, in the expression x + y the plus is displayed to the right of the x and the y is displayed to the right of the plus. But in some Arabic locales, mathematical text is written right to left (RTL). Instead of…

November 12, 2009

When writing the Math in Office 2010 post back in July, I could just imagine the disappointment various people would have when they discovered no mention of equation numbering. After getting math into PowerPoint, equation numbering had been the most often requested feature. Since PowerPoint 2010 now has the math facility, equation numbering has risen…

October 14, 2009

This post is a companion to Automatic RichEdit Hyperlinks. As stated in that post, RichEdit has two kinds of hyperlinks, automatic hyperlinks (autoURLs) and friendly name hyperlinks. A friendly name hyperlink has a name, which is displayed, and a hidden instruction part that contains the actual URL. Such hyperlinks are commonly used when an author…

September 24, 2009

The original RichEdit Versions post covered RichEdit versions 1.0 through 6.0, since 6.0 was the latest version at the time. RichEdit 7.0 will ship with Office 2010, so here’s an update describing what that version adds. Most additions involve math editing/display and play a central role in the math features of OneNote 2010, PowerPoint 2010,…

September 5, 2009

RichEdit has two kinds of hyperlinks, automatic hyperlinks (autoURLs) and friendly name hyperlinks. As its name suggests, the autoURL is automatically recognized by RichEdit as a hyperlink and is displayed as a URL. A friendly name hyperlink has a name, which is displayed, and a hidden instruction part that contains the actual URL. The present…

August 31, 2009

The Office math ribbon has a few examples of matrices, but you might like to be able to enter a lot more kinds of matrices and enter them substantially faster. For this you can use the linear format (see Sec. 3.9). For example, a 2×2 matrix is entered by \matrix(…&…@…&…), where the ellipses are the…

August 18, 2009

Imagine typing alt+= in PowerPoint, OneNote, Excel, and, of course, Word and Outlook to enter a math zone and then type a^2+b^2=c^2<space> to see the Pythagorean theorem beautifully typeset on your screen! Or some way more complicated equation, equally beautifully typeset. You don’t have to wait much longer as the people getting the Office 2010…

July 13, 2009

In Windows 7, WordPad has undergone many improvements even though it uses RichEdit 4.1+ for editing and display. Time and time again, the excellent Hyderabad team responsible for enhancing the Windows 7 WordPad requested very reasonable extensions to RichEdit 4.1, extensions that have been included in later versions of RichEdit. They’ve also requested features that…

June 19, 2009

Starting with Windows 7, Windows includes a cool applet called the Math Input Panel. This applet lets you enter mathematical text using a pen or a mouse. It recognizes what you enter and displays the result using a special private version of RichEdit 6. It also lets you copy the results to Word, Mathematica, or any…

May 6, 2009

The previous blog post is on the cool math handwriting recognition shipped with Windows 7. The post includes a description of a race I had entering equations using the linear format with formula autobuildup against a member of the math handwriting recognition team, who entered equations using the Windows 7 Math Input Panel. Since the…

May 6, 2009

You type Alt+= or click the Insert ribbon Equation button, and presto! You’ve inserted an empty math zone place holder that states “Type equation here.” in the language you’re using. Then you type a^2+b^2<space> and you see a2+b2, except in better typography. The empty math zone place holder seems simple and intuitive, but behind the…

April 27, 2009

A number of character formatting properties are treated differently in a math zone than they are in ordinary text. These include underline, strikeout, math font face and size, subscript and superscript. This post discusses how these properties differ in math zones, sometimes to the surprise of users. For starters, the ordinary subscript and superscript attributes…

March 4, 2009

RichEdit paragraph indents are based on the original RichEdit 1.0 definitions. These differ somewhat from Microsoft Word’s definitions and hence from TOM’s (RichEdit’s Text Object Model), which were developed in collaboration with the Word team. In addition, the RTF file format uses Word’s definitions, naturally. RichEdit’s paragraph indents can be set using the EM_SETPARAFORMAT message…

February 16, 2009

The OMML (Office math markup language) specification has been improved in response to the great feedback we received from the ISO reviews. It’s part of the full OpenXML documentation Version 2 and is very handy to have if you’re working with OMML. The full OpenXML documentation itself is also very useful if you’re working more generally with…

January 16, 2009

The earlier post Breaking Equations into Multiple Lines describes equation line breaking and alignment. In particular, long equations often do not fit on a single line and need to be broken up for display on multiple lines. Word 2007 offers two approaches: automatic and manual line breaking. A related feature is alignment of multiple equations,…

December 19, 2008

What paragraphs are and how they are formatted are questions that continually come up both inside and outside of Microsoft. So this post describes Word/RichEdit paragraphs in general. A subsequent post will describe the “math paragraph”, which is part of a regular paragraph and is used for displayed equations, as distinguished from inline mathematical expressions….

November 21, 2008

An earlier post describes math context menus (right click somewhere in a math zone) for changing the display characteristics of math objects, like fractions and integrals. For example context menus offer options to convert a stacked fraction into a linear fraction and vice versa. Another post describes math context menus for aligning and/or manually breaking…

November 4, 2008

A number of math display properties have document defaults. These are the ones used if you don’t explicitly override them, which you can usually do by invoking a math context-menu option. The properties all pertain to “displayed” math zones, that is, math zones that begin either at the start of the document or at a…

October 27, 2008

One subject that seems to come up every other month or so is how RichEdit tables work. So I might as well post the answer. Hopefully RichEdit tables will eventually be described in the Windows SDK. They are not directly related to Math in Office, but I had mathematical expressions in mind when designing RichEdit’s…

September 15, 2008

No this isn’t about some kind of science fiction, this is about five Unicode characters that are useful for mathematics, but are generally invisible or should be. The characters are the zero-width space (U+200B), function apply (U+2061), invisible times (U+2062), invisible comma (U+2063), and the new invisible plus (U+2064). This post discusses each one in…

August 25, 2008

Two very interesting developments are happening that will improve Word 2007’s MathML support. The first is key for helping in getting Word 2007 math text into the scientific and technical publisher workflows and the second may help in this regard too. Specifically, new transforms are now available in beta versions enabling Word to read and write…

July 28, 2008

For proper math typography, it’s important to know the base of a subscript or superscript expression. For example, in Einstein’s equation 𝐸 = 𝑚𝑐² the superscript expression 𝑐² appears and 𝑐 is the base, not 𝑚𝑐. Knowing what the base is allows proper kerning of the base relative to the script (superscript or subscript) as providing more accurate semantics in interoperating with mathematical calculation engines.

June 29, 2008

The science and technology publishing industry uses Word 2003 in processing a significant portion of manuscript submissions. The industry hasn’t yet been able to accept manuscripts in which the mathematical text (math zones) is created using Word 2007’s new math facility since the infrastructure currently only works with math zones encoded in the Design Sciences…

May 13, 2008

An updated RTF Specification is available for downloading here. I already blogged about the new version in the MS Word blog, but wanted to add a few words about math in Math in Office blog. The RTF specification includes a thorough discussion of the Office 2007 math format. The format syntax is naturally RTF syntax,…

April 20, 2008

One handy way to edit mathematical text is to use math context menus. These menus are displayed when you depress the right mouse button with the mouse pointing inside a math zone. In addition to the usual Font and Paragraph options, in a math zone you see options relevant for the math object the mouse…

March 30, 2008

Okay, the Math In Office blog isn’t about advertising. But just in case you’re someone who really likes RichEdit and editing and wants to work on it (as I did and do J) and related text processing, here’s a pretty fine opportunity. If you’re not interested, please skip this post. So here goes. Want…

March 7, 2008

This post discusses aspects of Word’s first math editing and display facility: the EQ field. This field is still used today for some East Asian formatting constructs. To have a built-up fraction a/b, one could (and still can) enter an EQ field with the contents \f(a,b). To try this in Word 2007, go to the…

February 19, 2008

Alex Ioffe emailed me: “Hi Murray, I realize you probably get this often by why can’t someone (pleeease!) publish some official documentation of Word 2007 Equation editor features? I have seen all of the MSN videos regarding it features and they barely scratch the surface. People like Dataninja (http://dataninja.files.wordpress.com/2007/09/word07shortcuts.pdf) spent a great deal of time…

February 17, 2008

People have been inquiring about Word RTF’s occasional use of the Unicode Private Use Area (PUA) characters in the range U+F020..U+F0FF. These codes are also used in WordProcessingML defined by the ECMA-376 standard. This post explains what Word means by those characters. But first note a couple of things: 1) Unicode assigns no meaning…

January 23, 2008

This post summarizes what I said at the retirement ceremony for my long time collaborator and good friend Dr. Rick Shoemaker, Associate Dean, College of Optical Sciences, and Professor of Optical Sciences. I’ll talk a bit on Rick and his love for microcomputers. Back in the 1970s, Rick regularly performed magic in nonlinear spectroscopy….

January 19, 2008

Perfection is to be strived for but not attained A software version of this saying is “shipping is a feature”. In general one wants to do the best possible job, but getting something accomplished is usually better than having nothing but unfinished work. I learned this lesson by watching my PhD advisor as he got…

January 7, 2008

The Microsoft Math graphing calculator folks have created a Word 2007 add-in that lets you simplify, solve, calculate, and graph your equations in 2-D or 3-D. With it installed, your technical paper becomes alive. For example, your paper may have graphs of the formulae, but a reader wants graphs for different sets of parameters. She…

December 2, 2007

The STIX folks (Scientific and Technical Information eXchange) folks have a beta version of their math font. There are more math characters in the STIX fonts than in Cambria Math. The primary typeface is Times Roman. This post describes how you can examine the fonts and gives some reasons why they aren’t quite ready to…

November 6, 2007

A number of readers have asked how to use the RichEdit 6.0 shipped with Office 2007 to edit and display mathematical text. This post explains one way to do so. The code assumes that you already have an application that knows how to instantiate a RichEdit control with a window identified by hwndRE. The function…

October 28, 2007

Paul Libbrecht commented that there’s more to selection in math text than discussed in my first post on this subject. As usual, Paul is right. That post explains how one or more characters and/or math objects are selected. In addition the topic of selection includes insertion-point behavior, which by definition selects no characters or objects….

September 29, 2007

Long equations often do not fit on a single line and ways are needed to break them up for display on multiple lines. Word 2007 offers two approaches: automatic and manual line breaking. A related feature is alignment of multiple equations, such as aligning the equal signs of a group of equations. This post describes…

September 1, 2007

The arguments of math display objects are either optional or essential. Examples of essential arguments are the numerator and denominator of a fraction. For a legitimate fraction, both are nonempty. Hence if either or both are empty, they should be represented by a dotted square box, which indicates that an essential argument is missing. Optional…

July 13, 2007

Selection of text in a math zone obeys some special rules concerning built-up math objects, such as fractions and integrals. First some background on how these objects are stored helps to clarify the rules. In memory, math objects start with a special 16-bit character and end with a different 16-bit character. In RichEdit, the start…

June 30, 2007

Nature, Science and other publishers have robust ways of converting Word 2003 documents with embedded Equation Editor and MathType objects into the XML representation they use for publication. Notably MathType can export mathematical equations as MathML and this capability is part of the methodology. In principle a similar approach can be used with Word 2007…

June 13, 2007

Science and Nature, two premier science publications, are having difficulties with Word 2007’s elegant new mathematics facility. Part of the reason is due to misunderstanding about Word’s MathML support, which hopefully this post will help to rectify. And part of it is that the new facility represents mathematical text in a way that Word itself…

June 4, 2007

Mathematical variables represented by Latin and lower-case Greek letters are usually displayed in italic. Vectors are often displayed in upright boldface. Word 2007 allows the user to control and change these choices with the italic and bold formatting buttons on the Home tab of the user-interface ribbon or with the italic and bold hot keys…

May 30, 2007

People, especially testers, often ask when does formula autobuild up (FAB) occur? After using it for a while to enter equations into Word, one gets a feel for how it works, but may still wonder if there’s some well defined way to predict autobuild up. A general answer is that build up occurs when the…

April 15, 2007

If you use Word 2007 to create a document containing mathematical equations and expressions and save it as a web page, it looks just as good in Internet Explorer as it does in Word 2007! The equations look as though they had been typeset by TeX or in some ways even better. How did this…

April 15, 2007

A number of readers have inquired how to Find/Replace mathematical expressions in Word 2007. This post shows how it could be done nicely, although unfortunately this functionality didn’t make it into Word 2007. A previous post shows how to find simple variables in a math zone. The basic idea of finding more complex expressions is to use…

March 15, 2007

Dong Yu of Microsoft’s Speech Research Group reports: “Office 2007 comes with a very nice equation editor and bibliography manager. However, it does not support equation number management. To work around this problem. I have developed a set of macros. You can download it here.”

February 24, 2007

MathType users may want to convert their equations to Word 2007’s native equation format. This can be done by exporting the equations in MathML and then pasting them into Word 2007. There are some problems and useful tricks that Dadi Gudmundsson (www.sensoranalytics.com) describes as follows: Migration Procedure Reason for migrationAfter testing the equation capability in Word 2007…

February 11, 2007

The RTF 2007 specification is now available. Word 2007 added as many control words as Word 2000, XP and 2003 combined! The .doc spec is 4.4 MB, while the .docx is only 881KB. Admittedly a zipped version of the .doc spec is somewhat smaller than the .docx version. The math section starts on p. 124….

January 12, 2007

In my blog description, I promised to write occasionally about the early Windows days. So here’s a post on how David Weise and I got Windows 2.0 into protected mode and blew away the old DOS 640 KB RAM barrier. If this hadn’t happened, we’d probably be using some variant of OS/2 today instead of…

December 7, 2006

One of the key technologies behind the high quality display of mathematical text in Word 2007 and RichEdit 6.0 is a special component called LineServices along with its sibling Page/TableServices. In addition to handling math display, various versions of LineServices are responsible for line layout in Word, Publisher, RichEdit, PowerPoint, Internet Explorer, FrontPage, Visio, and…

November 14, 2006

Spacing in mathematical expressions involves well defined rules. For example, in the expression a+b=c, a good math display engine automatically inserts 4/18 em on each side of the binary operator + and 5/18 em on each side of the relational operator =. Proper spacing between two characters depends on the properties of each character. Section…

November 11, 2006

This post discusses the Word 2007 math RTF control words. A good way to understand these control words is to note that they are actually OMML tag names written with RTF syntax. Hence you can refer to the very thorough OMML documentation for more detailed information. For example in OMML, the built-up skewed fraction for…

October 25, 2006

A couple of comments have raised the question of people outside Microsoft using the various versions of RichEdit. Specifically, Teis Johansen asks, “Just to be sure. Can I redistribute RichEdit 6.0 with my application?” and Kyle Alons asks, “So what’s the point of listing these features without documenting how to use them? Just to make…

October 19, 2006

Recurring questions are what RichEdit’s are available, where they are installed and what features they have. A relatively new question is which RichEdit’s support the new Office math editing and display. So this post attempts to answer these questions. To answer the last question first, only RichEdit 6.0 has the Office math facility, although RichEdit…

October 13, 2006

Before comparing these two math XMLs, I’m excited to point you at Jennifer Michelstein’s nifty post on Equations in Word 2007. It comes complete with instructive videos demonstrating how to enter mathematical expressions using the Equation Ribbon as well as using the linear format discussed in my earlier postings. Jennifer plans to add other posts…

October 6, 2006

This post tells a bit of how I started in technical word processing back in the middle of the last century. More precisely it was in 1965 that I started using a nifty (for that time) vector plotting program by Grey Freeman at the Yale Computer Center. I was a Yale grad student in theoretical…

September 20, 2006

This post is a summary of material I’ve given in recent talks on math in Office such as this one. In the talks, I describe and demonstrate how Unicode’s rich mathematical character set combined with OpenType font technology, TeX ‘s mathematical typography principles, and enhanced autocorrection can be used to produce high-quality, streamlined technical text…

September 13, 2006

This is an introductory post to help users who want to create stunning technical documents in Word 2007. If you’ve typed Alt+= in Word 2007, you’ve seen a math-zone object inserted that says “Type equation here”. Actually you can type any mathematical expression there, even just a simple variable like x. If the expression’s math…

September 6, 2006

The post Math in Office 2006—2019 Listing appeared first on Math in Office.

]]>The post Math in Office 2020— appeared first on Math in Office.

]]>To start things off, OfficeMath is enabled in the RichEdit housed in the Windows 10 Version-2004 msftedit.dll! It was also enabled back in the Windows Beta of July 2012, but it was disabled in the official Windows 8 release . In contrast, the Microsoft Office RichEdit’s have had math support since Office 2007 as documented in various *Math in Office* posts.

The first client of the Windows RichEdit math functionality is the Graphing option of the 2020 Windows Calculator app, which will be featured in an upcoming post. If you cannot wait for the post, start the Calculator (Windows key and type in Calc), go to its menu, and select Graphing. You can type in one or more equations using UnicodeMath and graph them! There’s also a description of the Graphing option in this post. You can graph equations in a similar fashion inside OneNote as described in the post OneNote Math Assistant.

The msftedit.dll OfficeMath facility is disabled by default. To enable it, send an EM_SETEDITSTYLEEX message with wparam = 0 (turns off the no-math flag) and lparam = SES_EX_NOMATH.

The post Math in Office 2020— appeared first on Math in Office.

]]>