Keyboard input

Typing letters, numbers, and symbols from the keyboard inserts them into the current equation at the current cursor position. In addition, special "keyboard shortcuts" can be used to cut, paste, insert templates, and perform other useful functions. Both kinds of keyboard input are described in more detail below.

MathFlow will accept characters from international keyboards.

In MathML equations, all characters are categorized according to type. In the MathFlow Editor, the most important types are text, identifiers, numbers, and operators. These types correspond to the MathML elements <mtext>, <mi>, <mn> and <mo>, respectively. In MathML, these basic character types are called tokens.

As you enter characters from the keyboard, the MathFlow Editor analyzes the input and automatically inserts the characters into the appropriate MathML token element. Ordinarily, this results in the appropriate MathML markup, and makes authoring MathML equations much easier. As with any automatic algorithm there are cases where problems can arise. However, by understanding how the MathFlow Editor chooses token types for characters, you can easily avoid or correct problem situations.

In the General Editing Preferences dialog, there is an option called Recognize Common Functions. How MathFlow handles characters and invisible operators such as the invisible multiplication character depends on whether or not you have selected this option.

If the "Recognize Common Functions" option is not selected and two or more characters of the same type are entered in succession, the MathFlow Editor will place the characters into the same MathML token element. Thus, typing 's', 'i', 'n' will result in a single identifier token containing 'sin'. Similarly, if you place two or more characters of the same token type together by some other means, such as cut and paste, backspacing, etc. the MathFlow Editor will merge them together into a single token.

However, when the "Recognize Common Functions" is selected, MathFlow will look at the characters you type in and try to recognize a common function, such as cosine. If it determines you have typed in a function, the individual characters are combined in a single token. If a function is not found, each character is placed in a separate token. (Note: Custom toolbar shown in screen shot.)

Be careful when inserting multiple individual characters.

The MathFlow Editor uses the following rules to decide what token type to assign to characters.

  1. A run of alphabetic characters is placed in an identifier, or <mi>, token.
  2. A run consisting of digits, commas, and/or periods is placed in a number, or <mn>, token.
  3. By default, everything else is placed in an operator, or <mo>, token.
  4. Whenever you enter a character of a type not matching the preceding characters, the Editor starts a new token for it.

When problems arise, they usually result when a run of characters should be broken into several tokens, or when separate tokens merge as a result of editing. In the following sections, we'll describe the most common issues.

Ordinarily, the MathFlow Editor assumes alphabetic characters are identifiers. Sometimes, however, you may want to treat a run of alphabetic characters and spaces as text. In particular, if you are entering a bit of descriptive text in an equation, you will want the space bar to insert spaces, not InvisibleTimes characters. You can tell the MathFlow Editor to treat a run of characters as text by inserting a text template from the toolbar.

Insert a Text template from MathFlow's Layout Templates palette, the icon on the bottom right of the palette.

When you insert a text template, the Editor assumes subsequent alphabetic characters and spaces should be treated as text, and won't break them into smaller tokens.

To switch out of a text token to an identifier token, either move the cursor to the right until it loses its I-beam shape, or press the Tab key.

MathML uses an "invisible multiplication" character to explicitly denote when two variables or expressions are being multiplied. There is also an "invisible apply function" character that differentiates between multiplication and functions. For example, ab might mean "a times b", or the two-letter variable "ab". Similarly a(b + c) might mean "a times b + c" or it might mean, "apply a function a to the argument b + c". By inserting the proper invisible character, either multiplication or apply function, the semantics become clear.

The option "Recognize Common Functions" on the General Editing Preferences dialog dictates how invisible multiplication and apply function are handled by default. Selecting this option changes whether the MathFlow Editor favors using invisible multiplication or apply function characters.

If the "Recognize Common Functions" option is not selected, the MathFlow Editor favors using multiplication characters and its automatic tokenizing behavior helps remind you to code equations properly. If you just type "a" followed by "b", it will group them both into one token and switch the typeface to upright. This is a visual cue what you entered was the two-letter variable "ab". To enter "a times b", you need to put an invisible times between them.

When you hit the spacebar following an identifier, the MathFlow Editor will insert an InvisibleTimes character. By doing so, a and b will each go into an identifier token of its own, with the InvisibleTimes operator token in-between. a and b will remain in the customary italic typeface, giving you a visual cue you have encoded a multiplication.

If you hit the space bar after anything other than an identifier, the MathFlow Editor will insert a space character as usual. You can customize the behavior of the spacebar from the General Editing Preferences dialog if you don't like the default. You can also access the invisible characters palette on the "Standard" toolbar, and explicitly insert InvisibleTimes characters without using the spacebar.

If the "Recognize Common Functions" option is selected, the editor favors using apply function characters over multiplication. Because this option causes the editor to look for common functions, the editor will automatically insert an apply function character when it finds a function it recognizes.

A collection of keyboard shortcuts facilitates cursor navigation and selection. These shortcuts don't correspond to menu entries, but rather common mouse operations.

Shortcut keyAction
Tab Tab cycles the cursor between the open template blanks in an equation. After all the templates have been visited, hitting Tab moves the cursor to the end of the equation. Continuing to press Tab repeats the cycle.
Enter When the cursor is at a location in the MathML structure where a newline is valid, Enter inserts one.
End Moves the cursor to the end of the current line.
Home Move the cursor to the beginning of the current line.
Ctrl+Home Move the cursor to the beginning of the equation.
Ctrl+End Move the cursor to the end of the equation.
Shift+ Extends the selection to the right.
Shift+ Extends the selection to the left.
Ctrl+Alt Select all.

One set of keyboard shortcuts handles the main Editor functions. These are mostly operations from the File and Edit Menus. Most of them consist of the control key together with a letter.

Shortcut keyAction
Ctrl+N new equation
Ctrl+Q quit
Ctrl+Alt select all
Ctrl+Ctrl copy
Ctrl+V paste
Ctrl+X cut
Ctrl+Z undo
Ctrl+Shift+< shrink
Ctrl+Shift+> magnify

MathFlow possesses a multi-step undo. You can undo the last three editing operations by hitting Ctrl+Z repeatedly.

A second set of keyboard shortcuts handles the insertion of templates. Basically, these are the entries on the Insert Menu (Design view only). These shortcuts all use the control key together with a letter.

Shortcut keyAction
Ctrl+R insert row template (mrow)
Ctrl+Y insert style change template (mstyle)
Ctrl+T insert text template (mtext)
Ctrl+F or Ctrl+/ insert fraction template (mfrac)
Ctrl+L, Ctrl+B or Ctrl+_ insert subscript template (msub)
Ctrl+H, Ctrl+P or Ctrl+^ insert superscript template (msup)
Ctrl+J insert sub and superscript template (msubsup)
Ctrl+Shift+Q insert square root template (msqrt)
Ctrl+Shift+R insert nth root template (mroot)
Ctrl+0, Ctrl+9 or Ctrl+Shift+P insert parenthesized expression template
Ctrl+I insert definite integral template
Shortcut keyAction
Ctrl+Q quit
Ctrl+Alt select all
Ctrl+Ctrl copy
Ctrl+V paste
Ctrl+X cut
Ctrl+Z undo
Ctrl+Y redo
Ctrl+F find/replace
Shift+Tab Tabs selected block of text

Keyboard mnemonics (or keyboard indicators) for menus are accessible within the MathFlow Editor. The keyboard mnemonics allow you to access menu commands without using the mouse.

By pressing Alt, you will be able to view the keyboard mnemonics for the main menu. A letter in each menu item is underlined to indicate its respective keyboard mnemonic. For example, to access the File menu from your keyboard, press and hold Alt, then press and release the "F" key and release Alt. Upon pressing "F," the File menu will expand, giving you the option of pressing "N" for a new window and "E" to exit.

The menu mnemonics are underlined.