# Building Expressions

Many basic equations can be built using single character commands.

All expressions are started by creating an empty box. To create an expression in a Document Module, double-click anywhere in the module. Expressions in other modules are created in a variety of ways, but in all cases, construction of an expression begins with an empty box.

Action | Keystroke | Object Name | Library |
---|---|---|---|

And |
& | And | Code |

Addition |
+ | Add | Math |

Subtraction |
- | Sub | Math |

Multiplication |
* | Mult | Math |

Division |
/ | Div | Math |

Equality |
= | Equal | Code |

Factorial |
! | Factorial | Math |

Function |
( | Function (example: f(x)) |
Math |

Greater than |
> | GreaterThan | Math |

Less than |
< | LessThan | Math |

Modulo |
% | Modulo | Math |

Or |
| | Or | Code |

Power |
^ | Power | Math |

Subscript |
_ | Subscript | Code |

Superscript |
“ | Superscript | Code |

Other ways to create and edit expressions include:

- Pressing the
*Insert*key on a variable name will add a parameter – so “f” will become "f([])". Pressing the left parentheses key ( "(" ) will also do the same thing. - Pressing the
*Delete*key replaces the highlight with an empty box. Pressing Delete when the entire expression is highlighted, deletes the entire expression without leaving an empty box. In any situation where Delete would completely remove and expresssion, pressing Ctrl + Delete will leave an empty box instead. - Pressing the
*Backspace*key will delete a single entry. If more than one entry is highlighted, the Backspace key will walk down the expression tree to the previous entry, deleting entries from the end to the beginning of an expression. The backspace functionality is designed to behave in a way that's as similar as possible to what would happen if the expression were plain text and you used the conventional backspace on that text. - In some expressions, the
*Enter*key does something equivalent to adding a new line. Examples include a line into the List and ElseList objects and starting a List on the Enter key when the right-hand side of the Assert object or Where object is highlighted. These actions work primarily in expressions that represent code in the Sym programming language. - Cut, copy, and paste (
*Ctrl + X*,*Ctrl + C*, and*Ctrl + V*, respectively) work in the traditional fashion. You can copy and paste an expression or part of an expression from another part of your document into an empty box inside any expression. - Undo and redo (
*Ctrl + Z*and*Ctrl + Y*) work in the traditional fashion.

In addition, you can create objects just by typing one or more characters into an empty box. Valid characters for the names of these objects include upper and lower case letters and the digits "0 ... 9".

If the first character typed into an empty box is a number, then the expression is assumed to be numeric, so you can't construct a variable named "2a", for example.

To build expressions containing objects other than the ones that have single-character keystroke commands listed above, you can use the autocomplete popup. See The Autocomplete Popup for more information.