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

Running gf

gf is an SGML system which converts SGML documents conforming to several DTDs into a number of output formats. It can act as a formatter by converting the SGML markup into a language supported by a typesetting system. The LaTeX converter gives the most complete results: others will omit facilities such as the inclusion of PostScript graphics.

The command

gf foo

will convert a document `foo.sgml' into the default output format, typically LaTeX. Other output formats can be specified using the `-f' option, e.g., `gf -frtf foo'. The formats currently supported are `latex2e', `latex209', `rtf', `texinfo' and a number of plain text formats:

gf will automatically determine which DTD the document is supposed to conform to (see section Document Types for the list of supported DTDs). Not every combination of DTD and output format is supported.

gf uses the sgmls program to parse the SGML document, but this is transparent unless an error occurs during parsing. An error indicates that a document does not conform to the model specified by its document type declaration.

As an aid to the user, gf has an option for the creation of new documents. For example, to create a document named "foo.sgml" type:

`gf -n' dtd `foo', where dtd can be general, html, spaper, smemo or sletter. See section Templates for details on how the "templates" can be modified.

A number of additional options are available, for example

gf -o foo.tex foo

will write the output to the file "foo.tex", or even

gf -o xxx.tex foo

which makes it easy to erase all the garbage later. Cleaning up garbage can occasionally be important, for example when formatting with different TeX macro packages: they often use incompatible auxiliary file formats.

See the gf man page for the complete list of options. See section Style Sheets for details on how the formatting process can be controlled through the use of style sheets.

The complexity of a typical DTD makes development of reliable SGML software difficult. There is always the possibility that some untested combination of elements and styles will cause gf to fail. In general, if a document parses correctly but gf generates incorrect output code (e.g., illegal LaTeX) then this should be considered a bug (see section Bug Reports).


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