Go to the first, previous, next, last section, table of contents.

Customisation

There are three possibilities for user customisation(3): modification of the gf style sheets, modification of the templates used when creating new documents, and modification or supplementation of the character entity translation tables.

Style Sheets

A gf style sheet is a specialised SGML document containing information for the control of the formatting process for one or more of the supported output formats. It is possible to format an SGML document in many different ways, for example by changing paper size, fonts or heading styles. DTDs intended for pure "content-based" markup will attempt to avoid direct specification for this type of information within the source SGML documents.

By default gf will use a system-wide style sheet, possibly stored in the directory /usr/local/lib/sgml/gf, which will be named after the document DTD, e.g., general.style (use `gf -v' to check the file names and use environment variables as described in the gf man page to change them at run-time). If you want to modify the style sheet, you will need to make a local copy of it. There are two ways to do this: if you want the modified styles to apply to all of your documents, then copy the style sheet into your `.gf' directory. If you do not have such a directory then you will need to create it.

mkdir ~/.gf
cp /usr/local/lib/sgml/gf/general.style  ~/.gf

Alternatively, if you only want the modified style to apply to a single document, you can place it in the same directory as the document and give it the same base name, e.g.,

cp /usr/local/lib/sgml/gf/general.style  foo.style

A gf style sheet begins with an SGML declaration redefining two default values: NAMELEN is increased to 34 and NAMECASE GENERAL is set to NO.

The body of the style sheet is broken into sections, each containing formatting information for a class of outputs. The classes are:

Each section has a number of style options which are relevant for that class of output formats.

gf will always attempt to read the style sheet from three locations, which by default are: the system directory, the `~/.gf' directory, and the directory containing the file. Each time a style sheet is found, its contents are merged into a single database, overwriting data already present. Therefore if some of the style options are deleted from a local style sheet, or if a new version of gf adds extra options, then the system versions will be used.

Documentation for the various style options can be obtained by running `gf --style-help' with the name of the document to be processed. This will print the options available for the particular DTD and output format. E.g.,

gf --style-help -fab gf.sgml

will print out the style options for the "plain" output formats when processing Snafu documents.

Templates

The gf `-n' option can be used to simplify the creation of new SGML documents. It works by copying a "template" into the current directory. Two locations are searched for the template:

The name of the template file is constructed by appending a standard extension (normally `.template') to the DTD type, e.g., `smemo.template'.

Templates files can therefore be customised by copying the system templates into the local `~/.gf' directory and modifying as required.

Control of Character Entity Translation

gf uses simple mapping files for the translation of character entity references in the source SGML document into the output format(4). The default versions of the mapping files are usually kept in the directory `/usr/local/lib/sgml/gf' and are named after the character entity set and the output format (e.g., `ISOlat1.2tex').

Each file contains a line for each character in the entity set, with the entity name (the SDATA replacement text), a tab character and the replacement text.

Before reading the system file, gf will check for a file of the same name in the `~/.gf' directory. If this exists, it will be read instead of the system file. This makes it possible to redefine the translations.

In addition to the mapping files above, gf will read any mapping file attached to the current document. This can be used either to override translations in the system files or to define mappings for characters defined in the DTD. For example, if processing the document `foo.sgml' which has the following line in the document type declaration:

<!ENTITY BleECh SDATA "[BleECh]">

then the following `foo.2ab' file can be used to specify the ASCII mapping:

[BleECh]	BleECh

To check which mapping files are read when the document is processed, use the `-v' option.


Go to the first, previous, next, last section, table of contents.