previous Chapter II.2

Typing mathematics

next


Entering ``math'' mode

In order to enter math mode you may type $. You may recognize that you indeed entered math mode, by the looking at the cursor's color or the footer. Also, the second icon bar now contains a lot of icons for the creation of mathematical formulas. The changes are illustrated in the following picture.

Entering math mode

Notice that there are alternative ways to enter math-mode, using the math menu menu. This menu allows you for instance to start a new full line formula, a numbered formula, or vertical lists of formulas or equations.

Typing mathematical formulas

Once you are in math mode, you may use the icons on the second icon bar, or their keyboard equivalents, to create mathematical formulas. For instance, in order to create a superscript, you have to type ^, followed by the desired superscript. In order to finish the superscript, you have to push the cursor key ->. This process is illustrated below.

Typing a power (step 1) Typing a power (step 2)
Typing a power (step 3) Typing a power (step 4)

For users of TeX/LateX who are used to the { and } accolades for delimiting the scope of a superscript, it may be surprising that you have to type -> in order to finish the superscript. In fact, this is part of a general philosophy behind TeXmacs, which stipulates that the editor should be natural to use from the graphical point of view. In this philosophy, the cursor keys are the most natural choice for positioning the cursor. Similarly, the fraction a/b may be entered by typing A-f a down b ->.

Typing a fraction (step 1)
Typing a fraction (step 2)
Typing a fraction (step 3)
Typing a fraction (step 4)
Typing a fraction (step 5)

Typing mathematical symbols

Special mathematical symbols can be obtained in several ways in TeXmacs. The simplest, but longest way is to use the second part of the second icon menu. When you select a symbol in this way, and you leave your mouse pointer a sufficiently long time on the symbol, then a keyboard equivalent will be suggested to you (if such an equivalent exists):

Miscellaneous symbol menu

An alternative way is to enter the TeX/LaTeX name for the symbol and hit return:

Typing a heart (step 1) Typing a heart (step 2)

But the fastest way to enter mathematical symbols is to use the TeXmacs keyboard shorthands. First of all, the greek letters are obtained using the tab key, a tab yielding alpha, b tab beta, etc. Big operators are entered via shift-F5 (e.g. S-F5 S yields a big sum) and large delimiters using the Alt-key (e.g. A-( for a big opening bracket). Most other shorthands have been designed to be as mnemonical and easy to learn as possible. For instance, typing - > yields the right arrow:

Typing a right arrow (step 1) Typing a right arrow (step 2)

The keys @, * and / have a special meaning during the composition of keyboard shorthands. The @ is used for entering characters with a circle around them:

Typing an oplus (step 1) Typing an oplus (step 2)

The * is used to obtain variants and the / to obtain negations. The different primitives may be combined in quite intricate ways:

Complex key combination (step 1) Complex key combination (step 2)
Complex key combination (step 3) Complex key combination (step 4)
Complex key combination (step 5) Complex key combination (step 6)

Mathematical operators

A special final remark has to be made about entering mathematical operators. When typing a succession of more than two letters, TeXmacs automatically interprets such a sequence as an operator. Consequently an explicit blank space ( ) or multiplication symbol (*) has to be inserted in order to separate successive letters. This is actually a huge advantage with respect to TeX/LaTeX, because it makes it possible in principle to associate a semantics to well-written formulas. For example, when typing l tab * l n space x, one obtains:

Typing a formula (step 1) Typing a formula (step 2)
Typing a formula (step 3) Typing a formula (step 4)
Typing a formula (step 5) Typing a formula (step 6)


previous next


Copyright (C) 1999, 2000 by Joris van der Hoeven.

This webpage is part of GNU TeXmacs and the larger GNU project. Verbatim copying and distribution of it is permitted in any medium, provided this notice is preserved. For more information or questions, please contact Joris van der Hoeven.

Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA