exit Unix

### A Setup for Unix Environments

1. Establish a directory , say,‘~/tex4ht.dir’.

2. Download the file tex4ht.zip into the directory tex4ht.dir and unzip it.

   Compile the Postprocessors

3. Compile ~/tex4ht.dir/temp/tex4ht.c into an executable tex4ht file with a command similar to the following one.

   gcc -o tex4ht tex4ht.c -DENVFILE='"~/tex4ht.dir/texmf/tex4ht/base/unix/tex4ht.env"' -DHAVE_DIRENT_H

   The switch ‘-DENVFILE='"~/tex4ht.dir/texmf/tex4ht/base/unix/tex4ht.env"'’ may be omitted, if the program can reach the environment file in an alternative manner.

4. Compile ~/tex4ht.dir/temp/t4ht.c with a command similar to following one.

   gcc -o t4ht t4ht.c -DENVFILE='"~/tex4ht.dir/texmf/tex4ht/base/unix/tex4ht.env"'

   Again, the switch ‘-DENVFILE='"~/tex4ht.dir/texmf/tex4ht/base/unix/tex4ht.env"'’ may be omitted, if the program can reach the environment file in an alternative manner.

5. Move the executable files tex4ht and t4ht to directory ~/tex4ht.dir/bin/unix/.

   Update the Pointers in the Environment File

6. Replace in ~/tex4ht.dir/texmf/tex4ht/base/unix/tex4ht.env the line(s) starting with the character ‘t’, with alternative lines which state what directories should be searched for the tfm files of TeX and LaTeX. The directory names must be preceded with the character ‘t’ at column 1 and, if their subdirectories are also to be searched, the names should be appended with the character ‘!’ (insight).

7. If needed, adjust the paths in the ‘i’ records of tex4ht.env. These records are used for searching htf fonts, and they are similar to the ‘t’ (insight).

8. The entry ‘l~/tex4ht.dir/filename’ in tex4ht.env points to the address where the bookkeeping file should reside. Modify the path to fit your platform. The character ‘l’ should precede the address, and be placed at the first column. Make sure the access mode of the directory permits writing into files.

   Update the Bitmap Generating Scripts in the Environment File

9. The file tex4ht.env contains the following default script, of calls to system utilities for translating dvi pictures into gif.
   Gdvips -Ppdf -mode ibmvga -D 110 -f %%1 -pp %%2 > zz%%4.ps
   Ggs -sDEVICE=ppm -sOutputFile=zz%%4.ppm -r110x110 -dTextAlphaBits=2 -dGraphicsAlphaBits=2 -q -dbatch -dNOPAUSE zz%%4.ps -c quit
   Gconvert -crop 0x0 -density 110x110 -transparent '#FFFFFF' zz%%4.ppm %%3
   Grm zz%%4.ps
   Grm zz%%4.ppm

   The entry %%1 is a parameter refering to a dvi file, the %%2 is a parameter indicating a page number, the %%3 is a parameter standing for an output file name, and %%4 is a parameter providing the jobname.

   You may replace this script with an alternative sequence of system calls. In such a case, place one command per line, and mark each of these lines with the character ‘G’ at the first column.

   The dvips utility translates dvi files into postscript. The convert utility, provided within the distribution of ImageMagick, translates postscript files into gif.

   The script employs the Metafont mode ‘ibmvga’ of resolution ‘110’; the available modes are listed in file modes.mf of Metafont.

10. Instead of employing the G scripts, glyphs can rely on specialized F scripts of similar nature for creating gifs.

    Update the Other Scripts in the Environment File

11. If needed, replace the scripts ‘Mmv %%1 %%2%%3’ and ‘Ccp %%1 %%2%%3’ in tex4ht.env with alternative scripts for moving and copying files. The parameter %%1 stands for the source file(s), the parameter %%2 provides the target directory name, and the parameter %%3 refers to the target file name(s).

12. If needed, replace the script ‘Achmod %%1 %%2%%3’ in tex4ht.env with an alternative script for changing access mode of files. The parameter %%1 stands for access mode, the parameter %%2 refers to a directory name, and the parameter %%3 refers to file(s).

13. Postprocessing of files can be requested with ‘.’ scripts. The files are selected by their extension names, as listed following the period symbols. The parameter ‘%%1’ provides the file names, and the parameter ‘%%0’ provides the jobnames.

    Postprocessing of files can also be requested with ‘X’ scripts. The file names are accessed through the parameter ‘%%1’, and their extensions through the parameter ‘%%2’. Consider setting a ‘X’ script for validation and other applications.

    Set the Script Files

14. Ensure proper paths within the htlatex-like scripts in ‘~/tex4ht.dir/bin/unix/’. If you use a command different than latex for compiling LaTeX source files, fix also the references to latex in the scripts. Check also the appropriateness of the commands for compiling TeX and TeXi files.

    Make the System Globally Known

15. Inform the operating system where the scripts reside, say, by adding the directory ‘~/tex4ht.dir/bin/unix/’ into the path variable within the .login file. For instance,

    set path=($path ~/tex4ht.dir/bin/unix/)

16. Let LaTeX and TeX know where the new style files reside, say, by adding the directory ‘~/tex4ht.dir/texmf/tex/generic/tex4ht/’ to the environment variable TEXINPUT. For instance,

    setenv TEXINPUTS .:~/tex4ht.dir/texmf/tex//:/usr/local/share/texmf/tex//

17. If your TeX system uses a registry database to locate files, make sure to refresh it (e.g., run texhash for kpathsea, or mktexlsr for some Linux systems).

    Test the Installation

18. Move testa.tex and testb.tex from ~/tex4ht.dir/temp/ to your work directory
19. Compile ‘testa.tex’ with the command ‘ht latex testa’
20. Compile ‘testb.tex’ with the command ‘htlatex testb’