<< Chapter < Page Chapter >> Page >

One can select the expression by either pressing Shift+Right/Left (depending on whether the cursor is before or after the element), Delete, or Backspace key. See Selection for what can be done next.

Selection

When an expression is selected, several things can be done:
  • Pressing the Delete or Backspace key will remove it
  • Pressing Ctrl+X/C will cut/copy it
  • Pressing Ctrl+V will replace the selection with the contents of the clipboard
  • Clicking an item in the toolbar will replace the selected item

Context

Instead of using parentheses to denote which operations are grouped, the math editor highlights the current context for the operation. The context shows the position of the cursor relative to existing math in the editing area and is displayed using a gray background . An example of a confusing position can be shown using the following example. Suppose the editor contains the term a b c and the cursor is just after the c . If the user enters "^2" it is not clear what should be squared. At that position the user may want to square c , b c , or the entire term a b c . This produces very different math, namely a b c 2 , a b c 2 , and a b c 2 . In the above example, the context would highlight precisely the math that ended up being in parentheses. One can think of the context as defining where the parentheses should go once the new math is entered.

Keyboard input

There are several places the user can enter text into the editor. Most of them behave the same way, but listed below are common uses and specifics:

    Common for all text entry points

  • Pressing the Enter key or moving the cursor out of the text box (by pressing the Left/Right, Tab key, or clicking elsewhere) after entering will cause the Math to be parsed.
  • If the text cannot be converted to Math, it will appear with a red dashed line beneath it (like a spelling error) and must be corrected before saving.
  • Simple algebraic expressions, logic operations, trigonometric functions, and subscripts can be entered and will be converted into math.
  • If a shorthand notation exists for an operation, it will show up in the toolbar next to the name of the operation (See Toolbar . Shorthand notation is usually more natural (the operation, like addition, is between its arguments, like a+2
  • If a shorthand notation does not exist for an operation, one can still enter the operation using the keyboard by typing the name of the operation which is also found in the menu (See Toolbar )

Categories

There are three categories of key presses and are enumerated in the table below.
  • Shortcuts are preceded by pressing the Ctrl key (or the ⌘ key on Apple computers)
  • Navigation keys move the cursor through the math
  • Modification keys change the math in some way

Category Key Condition Action
Ctrl+ (Apple ⌘+) X Math is selected Cuts the selected Math to the clipboard and replaces it with an empty block (that can be deleted)
C Math is selected Copies the selected Math to the clipboard
V Math is selected Pastes MathML from the Clipboard (can be from other sources)
Z Undoes one step in the editor
Y Ctrl+Z was just pressed Redoes one step in the editor
E Opens full-source editing
Navigation Tab Shift+Tab Moves to the next/previous free block
Left / Right Moves to the previous/next element in the Math
Shift+Left / Shift+Right After / Before the Context Selects the Context element (right next to the cursor)
Before / After the Context Selects the Context's parent
Modification Enter Attempts to parse the text entered next to the cursor
Delete / Backspace Cursor next to Math Selects the Math Node (subsequent delete will remove the math)
Math selected Removes the node and replaces it with an empty block (a second press will remove the block as well)
Cursor in block Removes the empty block if it is allowed in MathML (in "a+b+c" any one variable can be removed, but addition requires at least 2 things to add)
Text input examples
Type Input Math Output
Calculator a*x^2+b*x+c=1/2 a x 2 b x c 1 2
a&&b || c != a ->b a b c a b
sin(x)^2+cos(x)^2=1 x 2 x 2 1
x_1+x_2<x_3 x 1 x 2 x 3
Templates sum=n*(n-1)/2 __ n n 1 2
MathML <pi />
&#1207x; ҷ

Text entry

This is a text entry place. See shortcuts. can paste MathML (Ctrl+V from Mathematica, MathType, etc), or enter simple algebra (see Shortcuts). Moving away using Enter, Tab, Left, Right will cause the input to be parsed and converted into Math.

Blocks

Blocks are holes that may need to be filled. (Click or Tab to them). Required blocks have a yellow background and optional ones are transparent and have a dotted border.

Click, double-click, highlight, (only right-click inside a text box)

Nuances / limitations

There are several nuances in the editor, and common ones are listed here, along with workarounds. Also listed are limitations of the editor and things we'd like to get working soon.

  • If more than two things are added or summed together, one cannot select only a subset of them.
  • One cannot easily change a "+" sign to "*". To do this, you will need to copy the entire "+" operation and paste it, then remove the unwanted children.
  • Moving children around by dragging is not possible. Unfortunately, this currently requires copying and pasting to the clipboard.

Limitations

Unable to change the domain of operations like sum, max, and integrals.

Operations like Sum, Max and Integrals may be over an interval, or when a certain condition holds (like x ). The math editor allows editing these variations but does not always offer a way to create new operations. Currently, this must be done by hand by switching to the source edit view and manually replacing the <interval/> with a <condition/> .

Wrapping math with math

Sometimes it is necessary to add to existing mathematical operations. For example, adding higher terms to a polynomial. This can be done either by using the keyboard or with help of the toolbar . In the explanations below we start with " b*x+c=0 " and create a x 2 b x c 0

Keyboard only

To add the a x 2 term:
  1. Move the cursor to the left of b x c but make sure the context is only around b x c and that b x c is not selected . This can be done by clicking the "+" sign.
  2. Enter " a*x^2+ " (without the quotes) and press the Enter key.

Toolbar

Using only the toolbar to insert math is a bit more difficult because the editor does not infer multiplication or addition when pasting right next to existing math. We will need to "wrap" the existing math with the combiner operation (usually +,*, or ^) and then add in the new math.
  1. Select b x c but make sure only b x c is selected . This can be done by double clicking the "+" sign.
  2. Cut the existing math. This should create an empty block.
  3. From the toolbar select the combiner operation. This should create at least one empty block.
  4. Paste the math that was cut earlier into one of the empty blocks.
  5. Select another empty block.
  6. From the toolbar, insert the operation.

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Connexions guide to mathml. OpenStax CNX. Aug 24, 2009 Download for free at http://cnx.org/content/col10963/1.1
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Connexions guide to mathml' conversation and receive update notifications?

Ask