Two keyboard layouts for Mac adapted to write TeX/LaTeX

Juan L. Varona, 2004/9/21, under license GPL of GNU

En español

Welcome to the web pages of Juan L. Varona. In this page you will find information on two keyboard layouts developed by myself. They are particularly well adapted to write TeX and LaTeX in a Mac with a Spanish keyboard (but the user can modify them to better fit to its own keyboard). They require system Mac OS X 10.2 or later.

If you want to install and use these keyboard layouts, click here to download a compressed file will all what you need.

Now, I describe its content, and how to use it.

Installation and usage

The two files
are two keyboard layouts whose object is to simplify the process of writting TeX/LaTeX in any application under Mac OS X (version 10.2 or later; they do not work with 10.1). Together with them, there are the corresponding icons
They are intended to write in a Spanish keyboard; they work in any other keyboard, but several symbols will not be located in the place marked by the keyboard itself, because the location of the keys is different in each country. (Of course, the users can adapt the two .keylayout files according to their needs and preferences.)

The "7bits" layout uses the traditional TeX encoding. For instance, when typing the keys corresponding to ñ, á, ¿ you get \~n, \'a, ?`. The "8bits" layout keeps these keys in its original form, and it is better adapted to write LaTeX with \usepackage[applemac]{inputenc} or \usepackage[latin1]{inputenc}. To a large extent, the utility of both keyboard layouts is that most Greek letters can be written in a very fast way. For instance, typing alt-a you get \alpha, and typing alt-shift-S you get \Sigma.

Moreover, both keyboard layouts have the keys corresponding to ` and ^ deactivated as dead keys, because these accents do not exist in Spanish and, furthermore, they interfere the behaviour of two very used characters in TeX; if you want to use them as accents, type alt-shift-` and alt-shift-i, respectively.

To use these keyboard layouts, it is necessary to put them in the directory

   Library/Keyboard Layout
of the user (it is also possible to put them in the corresponding directory in System or Network, and then they will be accessible to all the users in the computer, or in the net). No problem arises if you install both layouts. Also, put the icons in the same directory. Now, they can be used like any other keyboard layout, by means of the International panel in the Preferences of the System. If you select that they appear in the menu bar, it is very easy to change the keyboard when you want.

To see what you get in any key of the keyboard, proceed in the following way: in the International panel in the Preferences of the System (in the same place where you activate keyboard layouts), make that the "Keyboard Viewer" palette appears in the menu bar. And use it!

Note: In the distibution, I have also included the Technical Note TN2056 from Apple, and a capture of the screen that shows how we see an error in a hypothetical modification of a .keylayout file (see below). This is usesul only if you want to understand the internal behaviour of the keyboard layouts, or if you want to make changes in the .keylayout files.

Some controversial decisions

According to my personal preferences, I have taken several decisions that perhaps other people do not like: To change them, you must edit the .keylayout files.

Personal adaptations

The two files .keylayout are text files, so anybody can open and adapt them. But an important advertence is necessary: they are Unicode (UTF-8) files, no ASCII; so, to edit them, it is necessary to use a program that can read and write Unicode files. For instance, TeXShop, after choosing the UTF-8 Unicode encoding in its preferences.

With this reservation, the files are written in xml and are easily understandable. Details can be read in the "Technical Note TN205" from Apple: (also included in the distribution). Let us advice that, sometimes, after making changes in the files, the System does not notice that they have been modified. We can force the System to realize these changes by using, in the Terminal, the Unix command "touch" applied to the directory Keyboard Layouts and, for more security, to the corresponding Library (changing the date in the Calendar can also be useful). If, when making changes, we have included errors, we can see them in the Console.

Final remark

All these files are distributed under license GPL of GNU:

Download it and enjoy!

Juan L. Varona

Date of last modification of this page: September 29, 2004.

My web page on TeX (in Spanish):

Personal web page (in Spanish):

Personal web page (in English):