23 Parameterizing the editor

The standard installation of Thot can be used immediately. However, like every application built on the ThotLib library, certain parameters can be modified to adapt the editor to users needs.

Several configuration files are used by the editor depending on the kind of parameters it contains:

23.1 .thotrc registry file

The global parameters of the editor are given by the registry file. This file is named .thotrc and is automatically generated when starting Thot for the first time.

The registry file is divided into sections, each of them containing the parameters of an application. In particular, the registry file have a [thot] section where editor parameters are defined.

A particular section of the registry called [thot_lib] defines the common parameters to all applications built on the top of Thot Library (editor, schema compilers, print, etc.)

For instance, it is possible to add a directory for additional schemas (see section 24). The directory path is a parameter not only for the editor but also for schema compilers. As a consequence it must be declared in the [thot_lib] section of the registry.

When an application has to access a parameter, its value is searched first in the application's section then in [thot_lib] section. If a parameter is declared in both sections, the application's section value is taken into account.

Each section contains a list of couples key = value, key is the name of the parameter, value its value.

The default values for non specified parameters are read in the thot.ini file, in the config directory of the Thot distribution.

23.1.1 Dialogue language

Thot is able to handle documents written in several languages (see section 6.1); these languages are independent of the language used in the dialogue between the editor and the user. The dialogue language is defined by the LANG configuration parameter. This parameter can be fr for French, en for English and so on.

In the current version of Thot, English and French are the only languages defined but other dialogue languages can be added. To do this, you should create:

The LANG parameter is taken into account when the editor is launched. If you want to change the dialogue language, quit the editor (command ``Quit Thot'' from the ``Files'' menu) and start it again, once you have modified the LANG parameter.

23.1.2 Fonts

By default, the editor uses the Times, Helvetica and Courier fonts of the X server. The size of the characters used in the dialogue (menus, dialogue boxes, messages, etc.) may be changed, as well as the font family. To change the dialogue character size, the FontMenuSize parameter must be set in the .thotrc file of the user:

FontMenuSize=n
where n is an integer specifying the dialogue character size in points (the default value is 12 pts).

The Lucida fonts can be used in documents, instead of the three default fonts, Times, Helvetica and Courier. Lucida fonts may only be used for documents displayed on screen, they should not be used when printing, as Thot always prints documents with standard fonts, which have different character widths. To use Lucida fonts, the FontFamily parameter must be set in the .thotrc file of the user with the following value:

FontFamily=-b&h-lucida

The editor also uses particular fonts for displaying some icons. However, it can operate without these fonts. These fonts are delivered with the editor in the THOTDIR/fonts/ directory. They must be made accessible to the X server, either directly or via NFS. The THOTFONT parameter gives the access path to these fonts.

23.1.3 Colors and position of the primary window

Thot allows the user to color documents (see section 8.3.3) with one of the 152 predefined colors. During initialization, the editor loads its color table to present them in a palette. The number of colors loaded by the editor can be divided by two by editing the configuration file. Once the file has been modified, restart the editor so that the change is taken into account.

ReduceColor=
value yes or no.

Colors can be used not only in documents but also in the user interface. User interface colors have default values that can be modified in the configuration file of the user. To change them, update the file and restart the editor.

The following parameters of the .thotrc file are used by Thot:

ActiveBoxColor=
color of reference elements (see section 5) and live copies (see section 4.6) on screen: printing is always black.
BackgroundColor=
background color of document windows.
ButtonColor=
background color of buttons in dialogue forms.
DocSelectColor=
background color of the selected part and of the insertion cursor.
ForegroundColor=
default color of text and graphics in documents.
InactiveItemColor=
color of disabled entries in menus and menu bars.
MenuBgColor=
Background color of:
ReadOnlyColor=
color of write-protected elements, such as index tables.
ScrollColor=
color of the scrolling bars on the right and bottom sides of the windows displaying document views.

These parameters are only taken into account if the user works on a color monitor. However, when working on a monochrome monitor, the user can change the DocSelectColor parameter in order to solve problems concerning the reverse video of the selection.

Thot allows the user to set the initial position of the primary window. This position is defined by the Geometry parameter in the configuration file of the user. The default position of the primary window is changed by updating this file and restarting the editor. The syntax of the parameter is:

Geometry=
positive or negative integer specifying the X and Y positions of the primary window, according to the X-Window conventions.

Example:

Geometry=+0-0
(top right corner of the screen).

23.1.4 Keyboard mapping

Upon startup, Thot remaps the key codes associated to the modifier mod1, unless it detects an X server which does not support it. The user can override the default behaviour using the RemapModifiers parameter in the configuration file :

RemapModifiers=
value yes or no.

23.1.5 Working files and directories

Before launching Thot, the user can set certain configuration parameters THOTDOC and THOTSCH giving namely document and schema directories (see section 7.9.1).

23.1.6 Other Parameters

Other parameters are used by the editor for particular tasks:

HelpDocument
Filename of Thot Manual, document opened when invoking the Help menu
ZOOM
Default character magnification ratio.
VISIBILITY
Default visibility factor.
AUTOSAVE
Default autosave interval (in characters)..
THOTPRINT
Print command.
TOOLTIPDELAY
Delay (in ms) before help on buttons appears.
DEBUG
Allows the modification of ill-structured documents and the printing of structures of the document in human-readable form. Allowed values : yes and no.
TMPDIR
Temporary directory used for printing documents.

23.2 .conf files

A .conf file is associated with each structure schema. It has the same name as its structure schema and its suffix is .conf. Its role is to determine certain parameters of the Thot editor for the documents defined by the corresponding structure schema.

A .conf file is usually located in the same directory as the corresponding structure schema, but it is possible to define, for the same schema, several .conf files, each in a different directory. To be taken into account when the editor starts, these directories must appear in the THOTSCH configuration parameter. The editor uses the first .conf files it finds when accessing schema directories in the order given by the THOTSCH parameter. During an editing session, the user can add or remove directories; he/she can also change the order, with the ``Environment'' menu (see section 7.9.2). Several configurations are thus available, and the user can change configuration at any time.

A .conf file defines:

The .conf files are read whenever the editor needs the parameters they contain. If they are modified, the changes are taken into account when the next command is issued.

23.2.1 Content of a .conf file

A .conf file is composed of a sequence of lines.

A line may be empty or it may contain only a comment, which starts with character # and stops at line end.

Significant lines may have different structures (see below), but all of them can end with a comment, which starts with character #. It is also possible to put spaces at the beginning of any line, before and after the colon character, before and within the comment.

A .conf file defines parameters related to the presentation schemas that are associated with a structure schema. It is composed of a sequences of parts, each part corresponding to a different presentation schema.

Each part starts with a line containing the word style followed by the name of the presentation schema. This first line is mandatory. It is followed by one or more sections among the following ones:

23.2.2 Open section

This section starts with a line containing only the word open. It is the list of all views that are automatically opened when a document is created or loaded with that presentation schema.

Each line in this section contains the name of a view to be open, followed by a colon and four integers, x, y, w, h, separated by spaces. These integers represent the coordinates (x, y) of the upper left corner of the window, the width (w) and the height (h) of that window.

23.2.3 Geometry section

This section starts with a line containing only the word geometry. It is the list of all other views that a user may open with the command ``Open a view'' (see section 9.1).

Each line in this section has the same structure with the same semantics as in the previous section.

23.2.4 Presentation section

This section starts with a line containing only the word presentation. It is the list of presentation schemas to be used for various natures.

Each line contains the name of the structure schema of a nature, followed by a colon and by the name of the presentation schema to be used for that nature.

23.2.5 Options section

This section starts with a line containing only the word options. It sets the options to be used for printing documents, such as paper size and orientation:

pagesize : size

size can take the values A4 or A3

orientation : direction

direction can take the values portrait, paysage, landscape.

23.3 .lang files

Most names defined in a structure schema (element types, attributes and attribute values) appear in the menus of the editor (``Insert'' or ``Attributes'', for instance). Other names, defined in presentation schemas, also appear in some menus (views, for instance). The .language files allow a user to adapt these menus to the chosen dialogue language (see section 23.1.1). It also defines the contents of these menus:

For each structure schema, at least one .language file is needed for each dialogue language supported. A .language file is usually located in the same directory as the corresponding structure schema and it must have the same name, with a suffix .xx, where xx represents the language. For instance, in order to allow french speaking users to work with the Report schema defined in Figure 2, a file Report.fr is created.

It is possible to define, for the same structure schema and the same language, several .language files, each in a different directory. To be taken into account when the editor starts, these directories must appear in the THOTSCH configuration parameter. The editor uses the first .language files it finds when accessing schema directories in the order given by the THOTSCH parameter. During an editing session, the user can add or remove directories; he/she can also change the order, with the ``Environment'' menu (see section 7.9.2). Several configurations are thus available, and the user can change configuration at any time.

An initial version of a .language file can be automatically produced. You must be in the directory of the structure schema and enter the following command:

printsch -l schema > schema.xx

where schema is the name of the structure schema and xx the suffix identifying the language. You must then edit that file.

23.3.1 Content of a .language file

A .language file is composed of a series of lines.

A line may be empty or it may contain only a comment, which starts with character # and stops at line end.

Significant lines contain either a single word, which indicates the beginning of a section (and the end of the previous one), or a word followed by a colon and a sequence of characters containing spaces. In these two types of lines, a comment can be appended, starting with character #. It is also possible to put spaces at the beginning of the line, before and after the colon, before and within the comment.

The first significant line of the file must contain one (and only one) of the following words: document, nature, document-nature, extension, which indicates respectively whether the corresponding structure schema must be proposed only in the document types list (see section 7.1), only in the natures list (see section 16), in both lists, or in none.

This first line is mandatory. It is followed by 0, one or several of the following sections:

23.3.2 Presentation section

This section starts with a line containing only the word presentation. It is the list of all presentation schemas that will be presented to the user by the command ``Present'' (see section 8.2).

Each line in this section contains the file name (no directory nor suffix) of a presentation schema, followed by a colon and the character string to be displayed in the menu.

23.3.3 Export section

This section starts with a line containing only the word export. It is the list of all translation schemas proposed by the command ``Save as'' (see section 7.8).

Each line in this section contains the file name (no directory nor suffix) of a translation schema, followed by a colon and the character string to be displayed in the menu.

23.3.4 Import section

This section contains only one line which contains only the word import. It indicates that the document type corresponding to the .language file must be proposed for importing documents (see section 7.3).

23.3.5 Translation section

This section starts with a line containing only the word translation. It gives the translation of the names of the elements and attributes defined in the corresponding structure schema.

Each line in this section contains a name as it appears in the structure schema, followed by a colon, and the translation of that name in the dialogue language.

Any elements and attributes of the schema can be translated except the names of the associated elements.

23.4 Typing conventions

The way in which non standard characters (accented letters, special spaces, etc.) are keyboarded (see section 3.5) is specified in the thot.keyboard file in the config directory.

This file also specifies the shortcuts used to call certain menus.

Writing conventions can be changed by editing the file.

23.5 Spelling checker

23.5.1 Dictionaries

Before starting Thot, the user can set the DICODOC parameter which determines the name of the dictionary used for all documents. Thus, the checker will use, in addition to the dictionaries specific to the language, this dictionary (in read-write) to control all documents. The dictionary specific to a document (.DIC file) is always included in the same directory as the document (.PIV file). The commands used to copy, move or change the name of a document (see section 7.7) copy and change the corresponding dictionary file (.DIC) as well as the document file (.PIV).

Dictionary names have the .DIC suffix. Large dictionaries can be preprocessed in order to load them faster. When dictionaries are preprocessed, their names are followed by the .dic suffix. However, the dictionary specific to the document is never preprocessed.

The other dictionaries used by the spelling checker (see section 21) are stored in the directory designated by the DICOPAR configuration parameter. In addition to these dictionaries, this directory includes an alphabet file which describes the list of characters contained in these dictionaries and the order in which they are sorted. This file is necessary because it allows the spelling checker to sort the preprocessed dictionaries which have been read or written and to understand their contents.

There are four dictionaries used by the spelling checker to correct a French text:

There are four dictionaries used for correcting English texts:

Other dictionaries - whose contents is still incomplete - can be used to correct texts in German (Gprinc.DIC, 172,000 words), Swedish (Wprinc.DIC, 15,000 words), Spanish (Sprinc.DIC, 86,000 words), Dutch (Nprinc.DIC, 190,000 words), Italian (Iprinc.DIC, 61,000 words). However, there are no additional dictionaries for these languages.

To create a new dictionary, just consider it as the new dictionary specific to a document. The ``(+dic)'' buttons in the form of the spelling checker allow you to add words which are not present in the other dictionaries used by the checker. Note that you cannot remove a word from this dictionary. Hence all words added to this dictionary must be correctly spelt for the spelling checker to work properly.

The contents of a dictionary (.DIC) specific to a document can exceptionally be modified by using a text editor which allows the display of the accented characters represented by 8 bits (ISO Latin 1 code). To remove a word from a dictionary, remove the line containing this word and modify both counters whose values appear in the first line of the dictionary: the first value specifies the number of words contained in the dictionary, the second gives the number of characters (these values can be obtained by using the wc Unix command on the dictionary file). Use Thot to add new words to the dictionary as it is the only editor able to place this word correctly in the dictionary by considering the order of the required alphabet. Preprocessed dictionary (.dic file) can not be modified.

23.5.2 Parameter files of the checker

Parameter files of the spelling checker are stored in the directory specified by the DICOPAR parameter. These files are necessary for the spelling checker and should not be modified.

The spelling checker [Richy92a] uses these parameter files to compute the ``distance'' between the word to be tested and the words in the dictionary. A long distance means that the words are very different, whereas a short distance implies that the words are quite similar and the word in the dictionary is suggested as a possible replacement. The checker lists the proposals for correcting a word in order of increasing distance.

The distance calculation uses coefficients which are defined in two parameter files, the clavier file and the param file.

The first line of the param file contains the values of the following parameters:

The subsequent lines specify, for each length of word, the rejection threshold (SS) of proposals and the width (LL) of search. The threshold corresponds to the distance between the erroneous word and the proposal beyond which a proposal is ignored. By default, the threshold value of a word with a length i is computed as follows: SS[i] = KI + KI * (i-1) / 4

The search value specifies the size of words among which a proposal should be searched. For instance, for a word of 5 letters, a width equal to 2 means that the search will occur among the words whose size is contained between (5 - 2) and (5 + 2). By default, the search width of a word with a length i is computed as follows: LL[i] = 1 + ((i-1) /4) This means that the search width is equivalent to 1 for the words whose size is lower than 8. It is equivalent to 2 for the words whose size is contained between 8 and 13. Beyond 13, it is equivalent to 3.


[Section 24] [Table of contents]