exit driver

### Driving the Translation of Pictures and Other Tasks

TeX4ht outputs a script ﬁle (‘.lg’) describing how the dvi ﬁle (extension ‘.idv’) of pictures should be processed, the CSS instructions to be included for the ﬁle, and user-initiated requests from the operating system. In the default setting, the script ﬁle holds abstract commands similar to the following ones.

--- needs --- source.idv[i] ==> target.png ---

  An abstract command of this form requests that the i’th page in the dvi ﬁle will be translated into a target ﬁle whose name is provided.

--- characters ---

  This abstract command is a identiﬁes where the requests for pictorial characters start.

A manual brute-force execution of the abstract commands can be a tedious job for large number of pictures. The t4ht is in essence an interpreter for these abstract commands.

Another possible approach for automating the process is to request lg scripts in the form of shell scripts or batch ﬁles.

Alternatives to ‘--- needs --- source.idv[i] ==> target.png ---’

The default setting is made with a request of the form ‘--- needs --- %%1.idv[%%2] ==> %%3.png ---’, where the parameters %%1, %%2, and %%3 respectively represent the name of the source ﬁle without its extension, a page number, and a name of the target ﬁle. Alternative patterns to these abstract commands can be requested in the following locations, with the order reﬂecting on the priority given to the requests.

- In the command line of tex4ht, where the pattern should be preﬁxed with ‘-s’.

- In the environment ﬁle tex4ht.env within a block of consecutive lines, where the lines should be identiﬁed with the character ‘s’.

- In tex4ht with the pattern provided through the variable LGPIC of tex4ht.c.

The character ‘%’ can be introduced into a pattern through the entry ‘%%%’. On the other hand, the parameters ‘%%1’, ‘%%2’, and %%3 can specify, between the ﬁrst two percentage characters (i.e., ‘%...%1’, ‘%...%2’, and ‘%...%3’), any format for the outcome that is compatible with the print formats of C.

Alternatives to ‘--- characters ---’

Substitutions for this abstract command can be requested in the following locations.

- In the overview of tex4ht, preﬁxed with ‘-b’.

- In a line within the environment ﬁle ‘tex4ht.file’, where the line should be identiﬁed with the character ‘b’.

- In tex4ht with the substitution provided during compilation time through the variable LGSEP of tex4ht.c.