The Advanced Features

Table of Contents
Automatic Adoption to the Sex of the Addressee
Paths and Filenames
The Non-Interactive Mode

 

Automatic Adoption to the Sex of the Addressee

One of the prime features of gtex-letter is its configurable adoption to the sex of the addressee of you letter. This is helpful in most languages. For example in German, where the ending of adjectives depends on the person's sex the adjective is connected to.

Therefore you write "Sehr geehrte Frau Schneider" and "Sehr geehrter Herr Schulze". Accordingly it is "Estimada Sra. Gonzalez" and "Estimado Sr. Ortega" in Spanish. Of course, you do not want to make this adoption yourself; especially not in serial letters.

Gtex-letter will take care of it automatically, if you configure it in a proper way and if you use the addressbook for the selection of an addressee. Use one of the language-specific rc-files for a start. However, you can easily enhance the setting.

There is a kind of pattern matching included in the programm. Such a clause looks like this:

"Sehr geehrte[__name_prefix__='Herr':'r'] __name_prefix__ __lastname__,"

The part in braces is optional. It reads: If the prefix is equal to 'Herr', add an 'r'. Therefore, if the person is a female ('Frau'), nothing is added. This depends on the entries in your addressbook. It adopts only if you select one of the addressbook entries. If you enter an address directly into the addressfield, you have to take care of the sec yourself.

Also more complex clauses are possible. This is the default Spanish one:

"Estimad[__name_prefix__='Sr.':'o'][__name_prefix__='D.':'o'][__name_prefix__='Sra.':'a']
[__name_prefix__='Sta.':'a'][__name_prefix__='Da.':'a'] __name_prefix__ __lastname__,"

It takes care of the multiple forms of common prefixes.

 

Paths and Filenames

In the standard setup, gtex-letter will use your home directory as the stanard save your letter. Using the filename-guess-path-option, you set a different default path. (XXX: So far this only works for filename guessing. It is planned to update that behavior to manually choosen filenames too.)

Most of the time it is annoying to choose a filename by yourself. With gtex-letter, you can let the application choose one. If you think it does not fit, you can set a different one. Gtex-letter will just guess a filename, therefore this feature is called filename-guessing. It depends on the filename-guess-path-option and the filename-guess-format-option. With the latter you can define the way gtex-letter guesses the filename. Let me present a few useful formats to you:

__subject__-__date__.tex

This one will set filename equal to the subject and the date, connected by a hyphen. The suffix of the files should always be tex. Please remember, that empty spaces, colons and slashes will all be converted to underscores.

__id____date__.tex

Using this clause, you command gtex-letter to make a filename out of the addressbook-id and the date.

[__id__-][__subject__-]__date__.tex

This format uses optional clauses. If you did not choose an address from the addressbook, the id and the hyphen will be omitted. The id would be omitted anyways of course, but using the braces, you make clear to set the hyphen just in case an id is set. The same holds for the subject. If it is empty, no subject and no hyphen will be used.

 

The Non-Interactive Mode

Gtex-letter comes with a non-interactive mode, that can be called from the console. Use the -n/--nogui-option to call it. Of course you have submit enough information to produce a successful letter. We will let it up to you to find out what fancy things you can do with this feature. Just a hint about its power:

gtex-letter --address ted_baker --opening 'Dear Mr. Baker' --closing 'Yours sincerely' --file ~/letters/we_have_moved --nogui --noshow --print

This will create a letter for Ted Baker, with supplied opening and closing. The text of the letter will be taken from the file 'we_have_moved'. The letter will be assembles non-interactively and will be sent to the printer directly, without showing it first.