Configuring TeXmacs

1.Configuration of TeXmacs

1.User preferences

For an optimal typing experience, you may wish to configure TeXmacs in a way which suits your needs best. This can be done from within the EditPreferences menu. 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.

The following user preferences are available:

Look and feel

This preference controls the general “look and feel” of TeXmacs, and mainly affects the behaviour of the keyboard. The default look and feel depends on your system (Gnome, KDE or Emacs under Linux, Mac OS under Mac OS, and Windows under Windows). The Emacs look and feel can be used as an alternative on all systems; it has been the default for all TeXmacs versions prior to 1.0.7.6.

More details on the keyboard configuration on different systems can be found below.

Interactive questions

This preference specifies how the user will be prompted for input when required. Questions may either be displayed in separate windows or on the status bar of TeXmacs.

Details in menus

This preference specify the level of detail in the menus. The less frequently used features will be left out when selecting Simplified menus.

View

The preference corresponds to the same viewing options as in the top-level View menu.

Language

Your preferred language for the TeXmacs interface.

Keyboard

In addition to the general look and feel, a few additional settings determine the behaviour of the keyboard:

  • The Cyrillic input method specifies how to type text in Cyrillic languages.

  • Quotes can be automatically closed according to the Automatic quotes style.

  • Brackets can be automatically closed by enabling Automatically close brackets.

Printer

The printer setup can be configured from this submenu.

Security

In theory, TeXmacs documents may embed macros or hyperlinks which give rise to the execution of arbitrary commands (as specified by the author). In practice, this feature may involve a security risk,. Therefore, the Security preference allows the user to specify what should be done with untrusted executable code.

Converters

The behaviour of converters between TeXmacs various other data formats may be configured from this menu. For more details, we refer to the chapter on compatibility with other formats.

Scripts

Specify a default scripting language for all external scripts.

Tools

TeXmacs features a few additional tools which the user may wish to work under certain circumstances:

  • A debugging tool for TeXmacs developers.

  • A linking tool for entering typed hyperlinks and complex annotations.

  • A versioning tool for comparing two versions of a TeXmacs document.

  • A remote connection tool (which currently does not work anymore).

Autosave

This preference specifies how often documents will be “autosaved”. Any edits to a file which was not autosaved will be lost on undesired termination of TeXmacs. This typically occurs after an erroneous manipulations by the user, certain bugs in TeXmacs, or a power problem.

Bibtex command

The user may specify an alternative to bibtex for the compilation of bibliographies using BibTEX. Notice that recent versions of TeXmacs integrate a native alternative tool for the compilation of bibliographies.

2.Keyboard configuration

The behaviour of keyboard inside TeXmacs depends on a few user preferences, as specified in the menu EditPreferences:

We will now detail specific issues related to the keyboard configuration on various systems.

Please refer to the section on general conventions for explanations on the way keyboard shortcuts are printed in this manual. For more information on keyboard shortcuts, we refer to the general section on how the master the keyboard.

Standard conformance

TeXmacs attempts to be as standard-conformant regarding the various look and feels. However, there are a few general situations in which TeXmacs reserves some keyboard shortcuts for the sake of user-friendliness:

Potential conflicts

The TeXmacs-specific shortcuts are rarely in conflict with standard conventions. Nevertheless, in table ?, we have displayed some more or less standard shortcuts, which might work in other applications, but which will usually not work inside TeXmacs.

Look and feel Shortcut Alternative Meaning
Emacs F10 Show menu bar in window
Emacs Meta+! Shell command
Emacs Meta+'/Meta+‘/Meta+^ Needed for TeXmacs accents
Emacs Meta+//Meta+\/Meta+:/Meta+;
Emacs Meta+/Meta+ Ctrl+/Ctrl+ Move word back/forward
Emacs Meta+A/Meta+E Ctrl+/Ctrl+ Move paragraph back/forward
Emacs Meta+B/Meta+F Ctrl+/Ctrl+ Move word back/forward
Emacs Meta+L/Meta+T Locase/transpose words (not impl.)
Windows F5 Refresh/Switch to next pane
Windows F6/Ctrl+F6/Ctrl+Shift+F6 Switch to next/previous pane/tab
Windows Ctrl+Space Remove formatting
Windows Ctrl+Tab Switch to next child window
Windows Ctrl+Backspace/Ctrl+Delete Delete word
Mac OS Ctrl+F5/Ctrl+F6/Ctrl+Shift+F6 Move focus to toolbar/panels
Mac OS Ctrl+F7 Override keyboard access mode
Mac OS F9/F10 Tile or untile windows
Mac OS F11/F12 Hide or show windows/dashboard
Mac OS Tab/Shift+Tab Navigate through controls
Mac OS Ctrl+Tab, Ctrl+Shift+Tab Move focus within control groups
Mac OS Ctrl+Space/Meta+Ctrl+Space Toggle between input sources
Mac OS Ctrl+/Ctrl+ Meta+Alt+/Meta+Alt+ Move one cell left/right in table
Mac OS Ctrl+/Ctrl+ Meta+Alt+/Meta+Alt+ Move one cell up/down in table
Mac OS Home/End Meta+/Meta+ Move to start/end of document
Mac OS Alt+PageUp, Ctrl+, Ctrl+PageUp PageUp Page up
Mac OS Alt+PageDown, Ctrl+, Ctrl+PageDown PageDown Page down
Mac OS Ctrl+A/Ctrl+E Alt+/Alt+ Move to start/end of block

Table 1. Some shortcuts that might work in other applications, but usually not in TeXmacs.

System-wide shortcuts which may take precedence

In addition to the above standard shortcuts, some system-wide applications may define additional global shortcuts, which take precedence over the TeXmacs shortcuts. For instance, under Mac OS X, the application Spaces uses the shortcuts Ctrl+, Ctrl+, Ctrl+, Ctrl+, Ctrl+1, Ctrl+2, Ctrl+3 and Ctrl+4 to switch between multiple screens.

One solution to the above problems is to change the problematic global shortcuts in the responsible applications. For instance, Spaces can be configured to use Meta+Alt+Ctrl+ as a prefix instead of Ctrl+ (click on the popup menu behind “To switch between spaces” and simultaneously press Meta+, Alt+ and Ctrl+). Notice that fn is another key which is not used by TeXmacs.

If you cannot or do not want to change the system-wide shortcuts, then you may use the Escape-key in order to produce equivalents for the modifier keys Meta+, Alt+ and Ctrl+. For instance, under Mac OS, Ctrl+ is equivalent to EscapeEscape. Hence, the TeXmacs shortcut Ctrl+ can also be obtained by typing EscapeEscape, which may coexist with the Spaces shortcut Ctrl+. Table ? shows the modifier key combinations which can be obtained using Escape.

Shortcut Modifier keys
Escape Meta+
EscapeEscape Alt+
EscapeEscapeEscape Ctrl+
Shift+Escape Meta+Ctrl+
Shift+EscapeShift+Escape Alt+Ctrl+
Shift+EscapeShift+EscapeShift+Escape Meta+Alt+

Table 2. Keyboard shortcuts for modifier keys or modifier key combinations.

User-defined shortcuts

If, for some reason, the standard TeXmacs shortcuts are not sufficient or suitable for you, then you may define your own shortcuts.

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 Ctrl+Shift+ or Alt+Ctrl+, 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
Alt+"E ё Meta+"Shift+E Ё
YO ё Shift+YO Shift+YShift+O Ё
ZH ж Shift+ZH Shift+ZShift+H Ж
JTab ж Shift+JTab Ж
CH ч Shift+CH Shift+CShift+H Ч
SH ш Shift+SH Shift+SShift+H Ш
SCH щ Shift+SCH Shift+SShift+CShift+H Щ
ETab э Shift+ETab Э
YU ю Shift+YU Shift+YShift+U Ю
YA я Shift+YA Shift+YShift+A Я

Table 3. 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 following 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 Shift+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 Shift+Space once again returns to the classical TeXmacs input method.