Home | Download | Help | Contribute | Plug-ins | About | Contact | Search
Configuring TeXmacs
Manual | Top | Previous | Next

1.Introduction

Before you start using TeXmacs, it may be wise to configure the program first in EditPreferences, so that it will fit your needs best. Most importantly, you should choose a “look and feel” in EditPreferencesLook and feel. This will enable you for instance to let the keyboard shortcuts used by TeXmacs be similar to what you are used to in other applications.

Also, TeXmacs comes with a powerful keyboard shortcut system, which attempts to optimize the use of the modifier keys like shift and control on your keyboard. However, on certain systems these modifier keys are not well configured, so that you may wish to redo this yourself.

2.Configuration of the modifier keys

TeXmacs uses five major keyboard modifiers: shift, control, alternate, meta and hyper, which are abbreviated as S-, C-, A-, M- and H-. The shift and control keys are present on virtually all keyboards and the alternate key on almost all. Most keyboards for PC's nowadays also have a windows key, which is usually equivalent to meta for TeXmacs.

Before reconfiguring your keyboard, you should first check that this is indeed necessary. If you have keys which correspond to shift, control, alternate and meta in a suitable way, then you probably do not want to do anything. A possible exception is when you want to use a simple key like caps-lock for typing mathematical symbols. In that case, you should map caps-lock to hyper.

In order to reconfigure the keyboard, you simply select the logicial modifier that you want to correspond to a given physical key in EditPreferencesKeyboard. For instance, selecting Windows keyMap to M modifier, the windows key will correspond to the meta modifier. Similarly, when selecting Caps-lock keyMap to H modifier, the caps-lock key will correspond to the hyper modifier.

Unfortunately, X Window only allows system-wide reconfiguration. Consequently, if you reconfigure the caps-lock key inside TeXmacs, then the new behaviour of caps-lock will affect all other applications too. It is therefore important to reconfigure only those keys which you do not use for something else in other applications. For instance, the windows key is not used by many applications, so it generally does not do any harm to reconfigure it. You may also prefer to perform an appropriate system-wide configuration. This can be done using the xmodmap command; see the corresponding manual page for more information.

In certain cases, you already have keys on your keyboard which correspond to alternate, meta and hyper, but not in the way you want. This can be done by remapping the A-, M- and H- prefixes to other logical modifiers in the first group of submenus of EditPreferencesKeyboard.

For instance, for Emacs compatability, you might want to permute the meta or windows key with alternate without making any system-wide changes. This can be done by finding out which modifiers correspond to these keys; usually this will be Mod1 for alternate and Mod4 for meta or windows. We next perform the necessary permutation in EditPreferencesKeyboard, by selecting A modifierEquivalent for Mod4 and M modifierEquivalent for Mod1.

3.Notes for users of Cyrillic languages

In order to type Russian (and similarly for other Cyrillic languages) text, you have several options:

If your X server uses the xkb extension, and is instructed to switch between the Latin and Russian keyboard modes, you need not do anything special. Just switch your keyboard to the Russian mode, and go ahead. All the software needed for this is included in modern Linux distributions, and the xkb extension is enabled by default in XF86Config. With the xkb extension, keysyms are 2-byte, and Russian letters are at 0x6??. The keyboard is configured by setxkbmap. When X starts, it issues this command with the system-wide Xkbmap file (usually living in /etc/X11/xinit), if it exists; and then with the user's ~/.Xkbmap, if it exists. A typical ~/.Xkbmap may look like

    ru basic grp:shift_toggle

This means that the keyboard mode is toggled by l-shift r-shift. Other popular choices are control shift or control alternate, see /usr/X11R6/lib/X11/xkb/ for more details. This is the preferred keyboard setup for modern Linux systems, if you plan to use Russian often.

In older Linux systems, the xkb extension is often disabled. Keysyms are 1-byte, and are configured by xmodmap. When X starts, it issues this command with the system-wide Xmodmap (usually living in /etc/X11/xinit), if it exists; and then with the user's ~/.Xmodmap, if it exists. You can configure the mode toggling key combination, and use a 1-byte Russian encoding (such as koi8-r) in the Russian mode. It is easier to download the package xruskb, and just run

    xrus jcuken-koi8

at the beginning of your X session. This sets the layout jcuken (see below) and the encoding koi8-r for your keyboard in the Russian mode. If you use such keyboard setup, you should select Options → international keyboard → russian → koi8-r.

It is also possible to use the Windows cp1251 encoding instead of koi8-r, though this is rarely done in UNIX. If you do use xrus jcuken-cp1251, select cp1251 instead of koi8-r.

All the methods described above require some special actions to “russify” the keyboard. This is not difficult, see the Cyrillic-HOWTO or, better, its updated version

http://www.inp.nsk.su/~baldin/Cyrillic-HOWTO-russian/Cyrillic-HOWTO-russian.html

Also, all of the above methods globally affect all X applications: text editors (emacs, nedit, kedit...), xterms, TeXmacs etc.

If you need to type Russian only once, or very rarely, a proper keyboard setup may be more trouble than it's worth. For the benefit of such occasional users, TeXmacs has methods of Russian input which require no preliminary work. Naturally, such methods affect only TeXmacs, and no other application.

The simplest way to type some Russian on the standard US-style keyboard with no software setup is to select EditPreferencesKeyboardCyrillic input methodtranslit. Then, typing a Latin letter will produce “the most similar” Russian one. In order to get some Russian letters, you have to type 2- or 3-letter combinations:

Shorthand for Shorthand(s) for
A-" e ij A-" E IJ
y o ij Y o Y O IJ
z h æ Z h Z H Æ
j tab æ J tab Æ
c h œ C h C H Œ
s h ø S h S H Ø
s c h ù S c h S C H Ù
e tab ý E tab Ý
y u þ Y u Y U Þ
y a ß Y a Y A SS

Table 1. Typing Cyrillic text on a Roman keyboard.

If you want to get, e.g., “ñõ”, and not “ø”, you have to type s / h. Of course, the choice of “optimal” mapping of Latin letters to Russian ones in not unique. You can investigate the mapping supplied with TeXmacs and, if you don't like something, override it in your ~/.TeXmacs/progs/my-init-texmacs.scm.

If you select jcuken instead of translit, you get the “official” Russian typewriter layout. It is so called because the keys “qwerty” produce “éöóêåí”. This input method is most useful when you have a Russian-made keyboard, which has additional Russian letters written on the key caps in red, in the jcuken layout (a similar effect can be achieved by attaching transparent stickers with red Russian letters to caps of a US-style keyboard). It is also useful if you are an experienced Russian typist, and your fingers remember this layout.

Those who have no Russian letters indicated at the key caps often prefer the yawerty layout, where the keys “qwerty” produce “ßâåðòû”. Each Latin letter is mapped into a “similar” Russian one; some additional Russian letters are produced by shift-digits. TeXmacs comes with a slightly modified yawerty layout, because it does not redefine the keys $, £, \, which are important for TeXmacs, are not redefined. The corresponding Russian letters are produced by some shift-digit combinations instead.

4.Notes for users of oriental languages

In order to type oriental languages, you first have to start a conversion server which can be used in combination with the X input method and set the environment variables accordingly. For instance, in the case of Japanese, one typically has to execute the folowing shell commands:

kinput2 &
export LANG="ja_JP.eucJP"
export LC_ALL="ja_JP.eucJP"
export XMODIFIERS="@im=kinput2"

You also have to install Japanese fonts. For instance, you may download the ipag fonts ipam.ttf, ipag.ttf, ipamp.ttf, ipagm.ttf and ipagui.ttf and copy them to

    ~/.TeXmacs/fonts/truetype

After doing this, you may launch TeXmacs using

texmacs --delete-font-cache

and select Japanese from the icon on the first icon bar. If everything went allright, the menus should now show up in Japanese and the current document is also in Japanese. Notice that you may also select Japanese as your default language in EditPreferencesLanguageJapanese. It is also possible to select Japanese for a portion of text in a document using FormatLanguageJapanese.

Inside a Japanese portion of text, and depending on your input method, you usually have to type S-space in order to start Kana to Kanji conversion. A small window shows up where you can type phonetic characters and use space in order to start conversion to Kanji characters. When pressing return, the text is inserted into the main TeXmacs window. Pressing S-space once again returns to the classical TeXmacs input method.

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".