Next: Shell mode Up: Using mode Previous: Java mode

## Latex mode

This mode (named `Latex') is a simple mode that wraps lines, colors and indents them following LaTeX keywords.

A fixed font should be used to have the same width for all characters. Therefore, the number of characters in a line depends only on the window width and on the font used. However you can fix the number of characters in a line by replacing window_width('a') with the desired value (see latex.sc file). Thus, when the current line becomes too long, its last space is changed to `\`n and the rest of the line is indented to the next line. Consequently, it is not possible to insert a space or a tab at the beginning of a line. To insert spaces or tabs it is necessary to press Ctrl-q before entering them.

To define your own indentation, you can set latex_indent_step (default 3) and latex_indent_chapter (default 0) to the desired values (see the file latex.sc). Bindings available in Latex mode are default mode bindings plus the followings:

- Esc a moves to the beginning of the first line containing the previous latex begin, part, chapter, [sub][sub]section or [sub][sub]paragraph keyword.
- Tab indents the current line.
- Return inserts a newline and indents.
- Esc i indents the current region.

To automatically set the Latex mode when a file is loaded, use the suffixes .tex or .latex.

Si vous voulez en plus quelques accents, il suffit d'ajouter dans votre fichier .xcoralrc les lignes suivantes: