![]() |
Writing simple documents | ![]() |
The usual English characters and punctuation symbols can easily be obtained on most keyboards. Most modern system also implement standard shortcuts in order to obtain accented characters and other special symbols. If necessary, accented characters can also be obtained using the prefix. For instance, “é” is obtained by typing accent:acute e. Similarly, we obtain “à” via accent:grave a and so on.
Long words at borders of successive lines are automatically
hyphenated. In order to hyphenate foreign languages correctly, you
should specify the language of the document in the menu 
At the left hand side of the footer, you see the document style, the
text properties at the current cursor position. Initially, it
displays “generic text roman 10”, which means that you
type in text mode using a 10 point roman font and the generic
document style. You can change the text properties (font, font size,
color, language) in the
At the right hand side of the footer, the character or object (like a change in the text properties) just before the cursor is displayed. We also display all environments which are active at the cursor position. This information should help you to orient yourself in the document.
Usually, long documents have a structure: they are organized in
chapters, sections and subsections, they contain different types of
text, such as regular text, citations, footnotes, theorems, etc.
After selecting a document style in 
Currently, several standard document styles have been implemented: generic, article, book, letter, exam, beamer, seminar, source. For instance, the article style can be used for writing articles. Besides, there are styles for common journals and special purposes, such as the TeXmacs documentation.
As soon as you have selected a document style, you can organize your
text into sections (see 



When you get more acquainted with TeXmacs, it is possible to add your own new environments in your own style file. Assume for instance that you often make citations and that you want those to appear in italic, with left and right margins of 1cm. Instead of manually changing the text and paragraph properties each time you make a citation, it is better to create a citation environment. Not only it will be faster to create a new citation when doing so, but it is also possible to systematically change the layout of your citations throughout the document just by changing the definition of the citation environment. The latter situation occurs for instance if you discover a posteriori that you prefer the citations to appear in a smaller font.
There are a few general editing principles which make it easy to manipulate structured documents using TeXmacs. One major concept is the current focus, which is best illustrated on an example. Assume that we are in the process of entering a classical theorem:
The following theorem is due to
.

At the position of the cursor, the grey and cyan boxes indicate the
active tags: in this case, the cursor is both inside a theorem and a
formula. The innermost active tag (the formula
in our example) is surrounded by a cyan box and called the
current focus.
The contents of the
The following theorem is due to
Similarly, the arrow buttons on the left hand side of the focus toolbar allow you to jump to similar tags. In this case, they will allow you to quickly traverse all formulas and equations in your document. For more information on “structured editing operations” we refer to the chapter on editing tools.
A second important concept is the current editing mode.
Currently, there are five major modes: text mode, mathematics mode,
program mode, graphics mode and source mode. In principle, the
current mode can be determined from the current focus, but the mode
is likely to change less often than the focus. The mode
dependent toolbar above the focus toolbar contains several
buttons which are useful in the current mode. The contents of the
The simplest examples of structure in a text are content-based tags.
In 
|
||||||||||||||||||||||||||||||||||||||||||
Using 
(bullets),
(dashes) or
(arrows) to indicate entries in the list or the default tag. Lists
may be nested inside other tags, like in the following
list:
Now comes the sublist:
The default tag is rendered in a different way depending on the
level of nesting. At the outermost level, we used the
tag, at the second level
, and
so on. When you are inside a list, notice that pressing
automatically starts a new item. If you need items which are several
paragraphs long, then you may always use
in order to start a new paragraph.
Enumerate environments, which are started using 


The last type of lists are descriptive lists. They are started using

In a similar way as content-based tags, environments are used to
mark portions of text with a special meaning. However, while content-based tags usually enclose small portions of text,
environments often enclose portions that are several paragraphs
long. Frequently used environments in mathematics are
,
,
and
with
, such that
.
You may enter environments using 
.
Other frequently used environments with a similar rendering as
theorems, but which do not emphasize the enclosed text, are
As a general rule, TeXmacs takes care of the layout of your text.
Therefore, although we did not want to forbid this possibility, we
do not encourage you to typeset your document visually. For
instance, you should not insert spaces or blank lines as substitutes
for horizontal and vertical spaces between words and lines; instead,
additional space should be inserted explicitly using 
Several types of explicit spacing commands have been implemented. First of all, you can insert rigid spaces of given widths and heights. Horizontal spaces do not have a height and are either stretchable or not. The length of a stretchable spaces depends on the way a paragraph is hyphenated. Furthermore, it is possible to insert tabular spaces. Vertical spaces may be inserted either at the start or the end of a paragraph: the additional vertical space between two paragraphs is the maximum of the vertical space after the first one and the vertical space before the second one (contrary to TeX, this prevents from superfluous space between two consecutive theorems).
As to the paragraph layout, the user may specify the paragraph style (justified, left ragged, centered or right ragged), the paragraph margins and the left (resp. right) indentation of the first (resp. last) line of a paragraph. The user also controls the spaces between paragraphs and successive lines in paragraphs.
You can specify the page layout in the 






In TeXmacs, fonts have five main characteristics:
Notice that in the font selection system of LaTeX
,
the font name and family are only one (namely, the family). Notice
also that the base font size is specified for the entire document in


We recall that the section on general conventions contains explanations on the way keyboard shortcuts are printed in this manual. It may also be useful to take a look at the section on keyboard configuration.
Since there are many keyboard shortcuts, it is important to have
some ways of classifying them in several categories, in order to
make it easier to memorize them. As a general rule, keyboard
shortcuts which fall in the same category are identified by a common
prefix. The active prefixes heavily depend on the selected
“look and feel” in 
in math mode.
. The prefix
is also used for the insertion of “literal
characters”. For instance, symbol \ will
always produce the \ character, whereas the \ key
is used for entering hybrid commands.
Unfortunately, -based shortcuts are
superseded by system shortcuts on several systems. For instance,
accented characters and common special symbols are entered using
this prefix under
To write a text in an european language with a keyboard which does have the appropriate special keys, you can use the following shortcuts to create accented characters. Note that they are active regardless of the current language setting.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Special characters can also be created in any language context:
|
||||||||||||||||||||||||||||||||||||||||
When you press the " key, an appropriate quote
will be inserted. The quote character is chosen according to the
current language and the surrounding text. If the chosen quoting
style is not appropriate, you can change it in 


|
||||||||||||||||
“English” quotes are considered ligatures of two successive backticks or apostrophes. They can be created with ‘ ‘ and ' ' but these are not actual keyboard commands: the result is two characters displayed specially, not a special single character.
Some shortcuts are available in specific language contexts. You can
set the text language for the whole document with 

|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Language-specific shortcuts override generic shortcuts; for example, you cannot easily type “ø” in hungarian context.
TeXmacs allows you to enter LaTeX commands directly from the keyboard as follows. You first hit the \-key in order to enter the hybrid LaTeX/TeXmacs command mode. Next you type the command you wish to execute. As soon as you finished typing your command, the left footer displays something like
<return>: action to be undertaken
When you hit the -key at this stage, your command will be executed. For instance, in math-mode, you may create a fraction by typing \ f r a c return.
If the command you have typed is not a (recognized) LaTeX command, then we first look whether the command is an existing TeXmacs macro, function or environment (provided by the style file). If so, the corresponding macro expansion, function application or environment application is created (with the right number of arguments). Otherwise, it is assumed that your command corresponds to an environment variable and we ask for its value. The \-key is always equivalent to one of the commands inactive l, inactive e, inactive a, inactive # or inactive v.
To insert a literal \ (backslash) character, you can use the symbol \ sequence.
Certain more complex objects can have several states during the editing process. Examples of such dynamic objects are labels and references, because the appearance of the reference depends on a dynamically determined number. Many other examples of dynamic markup can be found in the documentation about writing style files.
When entering a dynamic object like a label using , the default state is inactive. This inactive state enables you to type the information which is relevant to the dynamic object, such as the name of the label in our case. Certain dynamic objects take an arbitrary number of parameters, and new ones can be inserted using var.
|
When you finished typing the relevant information for your dynamic object, you may type in order to activate the object. An active dynamic object may be deactivated by placing your cursor just behind the object and hitting backspace.
Some assorted shortcuts which are often useful are displayed in
table ?. Notice that spaces inserted using ,
and can be resized a
posteriori using the shortcuts
and . This kind of resizing actually
works for more general horizontal and vertical spaces inserted from
the menu 
|
||||||||||||||||||||||