Math Keyboard Shortcuts


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 entry. The present post mentions the main alt+= hot key for toggling math zones on and off and then considers other possible hot keys for math.

To insert a math zone at the insertion point, type alt+=. If the selection is nondegenerate (highlights one or more characters), alt+= toggles a math zone on and off. This hot key first shipped with Word 2007 and it also works in Office 2010 applications and Mac Word 2011 (type control+=, since the Mac doesn’t have an alt key). In some locales, the hot key may be different, but since most keyboards have an equal sign, alt+= is pretty general.

To maintain this international generality, we could use ctrl+alt+= to build a (Professional) math zone down to the linear format and shift+ctrl+alt+= to build a math zone up from the linear format. The alt+= hot key typically requires the use of both hands, so including ctrl and shift+ctrl is reasonably natural, especially if you’re a pianistJ.

It seems worthwhile to support Word’s standard subscript and superscript hot keys: ctrl+= and shift+ctrl+=, 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 line. If you type one of these hot keys while some text is selected, that text’s script character will be toggled accordingly. In the linear format, 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 too provided the scripts are not nested.

Word math zones are displayed inside an acetate enclosure that has a drop-down menu with Professional, Linear, Display/Inline, and Justification options. So you might wonder how Word converts from Display to Inline and vice versa. The essential feature is that if a math zone completely fills a hard or soft paragraph, it is shown in Display mode and is a display math zone. If one or more characters appear in the paragraph but not in the math zone, the math zone is displayed in Inline mode and is an inline math zone. To convert a display math zone to an inline math zone, Word inserts a space directly following the math zone. To convert an inline math zone to a display math zone, Word deletes the space for the previous case. More generally, Word inserts a carriage return before and/or after the math zone, depending on how much is needed to obtain a math zone that completely fills its paragraph.

It’s pretty easy to convert between inline and display modes on the keyboard using the space bar and the enter key as necessary. So maybe we don’t need a hot key for it. But if we do, shift+alt+= is currently undefined. Using that along with the others above would define all combinations of ctrl, shift, alt and = that don’t distinguish between left and right control/shift/alt keys. The fact that they all involve the equal sign suggests they are math hot keys and makes them easier to remember.

Other hot keys that are handy in math zones include the home/end and arrow keys. In some applications, the [shift+]tab moves between elements in a matrix. The [shift+]tab key is also used to change the indentation of manual line breaks. In my old PS Technical Word Processor, hot keys were used to enter Greek and math symbols. For example, alt+a inserted α. But TeX’s symbol notation is generally so easy to use, it doesn’t seem necessary to have hot keys for symbols. If you use α a lot, you might want to add the autocorrect entry \a for α, which is certainly faster than typing \alpha. Hopefully at some point, I’ll add autocomplete to the math autocorrect facility and then the difference between typing \a and \alpha will be even smaller.

alt+x is another useful hot key that toggles between a character and its Unicode hexadecimal value. In fact, I entered the α’s here by typing 3b1 alt+x. Admittedly to use this approach, you have to be a bit of a Unicode geek.


Comments (9)

  1. Hermann says:

    FYI, alt+= for toggling the math zone does not work on the German keyboard layout. It would be nice to be able to disable inline mode, because I frequently mix text with math and inline mode renders the math symbols too small and/or cuts it off sometimes.

    It would also be great if you could work on the performance and printing support. Writing lots of Math in OneNote makes it incredibly slow to the point of rendering only 1 character per second even when you type quickly on fast computers. Saving OneNote pages to PDF using the internal PDF converter does work correctly and even when printing to paper or PDF using highest DPI setting, the big sigma in a sum formula loses it's top and bottom bar. I've found dozens of bugs, but these two are the most annoying ones.

  2. Hermann says:

    I forgot the word "not" above in "internal PDF convert does work correctly", so what I meant is that it does not work.

  3. MurrayS3 says:

    We'll look into these problems. In inline mode, fraction numerators and denominators start with script size (~70% of text size). If you use a linear fraction like a/b, then text size is used. Perhaps that would help with inline math. Inline math should look fine and it's used in countless technical books and publications. Thanks for the feedback.

  4. JohnGuin says:

    Hermann – can you jump over to my blog at http://blogs.msdn.com/johnguin and contact me via the link at the upper right?  I would like to get some extra information from you about the OneNote behavior you mention.

  5. Ed says:

    Related to your last two paragraphs, if you get Keyboard Layout Creator from msdn.microsoft.com/…/bb964665 then you can define a new layout that has the Greek letters in the same way that the old technical word processors would. (This is especially convenient with non-US keyboards, which have the AltGr key to access third and fourth characters rather than needing Ctrl+Alt and conflicting with shortcut keys.) The subsite holding my highly-personalised layout is down at the moment, otherwise I'd link it here. Using that I could typeset quickly enough to take undergraduate physics exams using Word 2007, which I doubt I'd have been able to do with commands. (Just as useful than having Greek letters and partials there was having the multiplication symbol there rather than having to times)

    Also, the Mac does have an Alt key: it used to be called (and is still sometimes referred to as) Option, but it very clearly says "alt" on it now (I'm typing on a Mac keyboard here). It is, however, mapped similarly to AltGr on non-US keyboards when used alone or shifted, so Alt+= gives ≠, which it would be very counterintuitive to the Mac interface to override with a function command, so Ctrl+= makes far more sense.

  6. Nali says:

    Hello. Thank you very much for this nice post. I hope that someday we could use this hot keys in Office. It would be perfect.

    Maybe, the Ctrl+U hot key could be also useful (it could insert  ubar or U+0332 into math zone).

  7. Hermann says:

    Reading comments like that I see the need to publish my shorthand notation on your blog. I know I've promised you that some time ago and it is in fact finished and working, but I would need to write a short introduction which I haven't found the time to yet. I'll contact you soon!

    @Nali: With my AutoCorrect List, you would generate the unterbar with "-," (minus, then comma). Appending a comma basically "sends down" that character.

  8. John Bradford says:

    As you say, alt+= typically requires the use of both hands, which is a nuisance.  How about making use of the key above the tab key (I don't know what it's called), couldn't that be used with Alt to insert a math zone?

  9. Rich says:

    The key above the tab are

    ~  tilda

    `   acute/back quote/grave/…

    See http://www.computerhope.com/keys.htm for more