GNU TeXmacsUser manualReferenceAboutEnglish
Getting started with TeXmacs

This short guide is designed to help you master some of the fundamental notions of TeXmacs.

1.Document structure

Please move the cursor inside this piece of bold text. You will observe a cyan box that appears around it. On the status bar, at the bottom right of your window, you may also notice the word “strong”. These two things reveal part of the structure of your document. In this case, the bold text was produced using the tag (also called markup element or environment) strong and the box indicates the scope of this tag.

TeXmacs comes with hundreds of tags for different purposes. The strong tag is used to highlight important pieces of text. Most tags refer to intent (like highlighting important text) rather than layout (like printing the characters in boldface). TeXmacs makes use of customizable style files in order to translate intent into layout. This allows you to easily switch to another presentation (e.g. italic instead of bold text) if you change your mind.

Tags can be nested. Move the cursor just before the number 2 (for the square) in the formula below and observe that four boxes are displayed : three light grey boxes (one for the entire equation, one for the expression inside the parentheses, and one for the fraction), plus a cyan box for the superscript. The cyan box is always used for the innermost tag with respect to cursor position, and it is called the focus.

\(\displaystyle z = a \left( b + \frac{c^2}{d} \right) .\) (1)

2.Navigation

Let us examine more closely the status bar, located at the very bottom of this window, below the editing region. When moving the cursor around in this document, you will notice that the right hand side of the status bar shows the character just before the cursor. Now move the cursor back in the above equation, right after the number 2 and inside the superscript (check that the cyan box is displayed around the number 2). As you see, the status bar lists all englobing environments in order, from the outermost to the innermost one. Experiment by moving the cursor around in the formula while keeping an eye on the status bar. You will soon get comfortable using the feedback from the colored boxes and from the status bar while navigating in documents.

There is an invisible character in the formula after the \(a\) and before the parenthesis in the equation: can you position the cursor and read off what it is from the status bar? You are right, it is an invisible multiplication. In mathematical formulas, you should refrain yourself from using a space if what you really mean is a multiplication. Remember that TeXmacs expects you to write down what you mean, not how it should be displayed. Multiplications should be invisible in the printed version of your document, but you might find it convenient to show them when editing your document. This can be done using the menu Document\(\rightarrow\)Informative flags\(\rightarrow\)Detailed.

Again position your cursor inside the above equation, and try moving around using the arrow keys ← → ↑ ↓. For instance, can you move the cursor from before to \(d\) to after the \(2\) and then after the invisible multiplication? Quickly, the cursor movements will probably feel very natural. Remember that the boxes (and in particular the cyan one) indicate where the cursor is located in the document structure.

As an exercise, here is a word that uses a different layout for each one of its characters:

crazy

Experiment adding characters to this word: observe how the exact cursor position determines in which environment a new character gets inserted. Can you insert a second strong letter ‘c’ and a second lowered letter ‘z’ with only two mouse clicks and two keystrokes?

3.Toolbars

The graphical user interface of TeXmacs is highly context sensitive. In particular, the menus and the toolbars depend on the cursor position. Roughly speaking, the three toolbars serve the following purposes:

Main toolbar
The first toolbar contains context-independent icons for common operations on files (, ..., ), common editing operations (, ..., ) and browsing (, ..., ).
Mode-dependent toolbar
The icons on the second toolbar only depend on the main editing mode (text, mathematics, graphics, etc.). Inside ordinary text, the toolbar is subdivided into the following four groups:
Focus toolbar
The icons on the third and smallest toolbar are extremely context sensitive. It offers functionalities that are directly connected to the current focus (i.e. the current innermost environment, which is indicated by the cyan box).

Observe how the focus bar changes when the cursor is moved; try clicking on the icon when the focus is on the above bullet list (but not immediately after a bullet) and observe what happens. The same mechanism allows displayed formulas to be numbered: go ahead and try it with the ones in this document!

4.Mathematical formulas

It is now time to type your first formula, say

\(\displaystyle \int_a^b f' (x) \mathrm{d} x = f (b) - f (a) .\)

Here is how we did it (go ahead and try whether you can repreduce the example):

5.Mathematical symbols

TeXmacs uses two simple but powerful mechanisms for entering mathematical symbols:

The two mechanisms can be combined: can you guess how the mathematical symbol \(\Updownarrow\) can be obtained? Hint: it is a variant of \(\Leftrightarrow\).

Don't forget entering math mode before trying to insert mathematical symbols or markup. New formulas can be inserted using icon on the mode-dependent icon toolbar or using the keyboard shortcuts $ (inline formula) or ⌃$ (displayed equation).

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License".