exit Unix

A Setup for Unix Environments

Download the Files

  1. Establish a directory `path/tex4ht.dir'.

  2. Download, and unzip when needed, the following files into the directory tex4ht.dir.

    1. tex4ht.sty
    2. all4ht.zip (*.4ht)
    3. tex4ht.env
    4. tex4ht.c
    5. t4ht.c
    6. ht-fonts.zip (ht-fonts)
    7. htlatex
    8. httex
    9. httexi
    10. ht
    11. testa.tex, testb.tex,
    The above files are also available in a single zipped file.

    Compile the Postprocessors

  3. Copy tex4ht.c and t4ht.c into a temporary directory
  4. Compile tex4ht.c into an executable tex4ht file with a command similar to the following one, where `path' stands for the absolute path to directory tex4ht.dir.

    cc -o tex4ht tex4ht.c -DENVFILE='"path/tex4ht.dir/tex4ht.env"' -DHTFDIR='"path/tex4ht.dir"' -DHAVE_DIRENT_H

  5. Compile t4ht.c with a command similar to following one, where `path' stands for the absolute path to directory tex4ht.dir.

    cc -o t4ht t4ht.c -DENVFILE='"path/tex4ht.dir/tex4ht.env"'

  6. Move the executable files tex4ht and t4ht to directory tex4ht.dir.

    Update the Environment File

  7. Replace in tex4ht.env the line(s) starting with the character `t', with alternative lines which state what directories should be searched for 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 `!'.

  8. Replace in tex4ht.env the line(s) starting with the character `i', with alternative lines which state what directories should be searched for htf files of TeX4ht. The directory names must be preceded with the character `i' at column 1. If the subdirectories are also to be searched, the names should be appended with the character `!'.

  9. The entry `dpath/tex4ht.dir/' in tex4ht.env indicates the directory where the file tex4ht.fls should reside. Modify that entry to fit your platform. The character `d' should precede the address, and be placed at the first column. If this entry is omitted, the work directory is assumed.

  10. The file tex4ht.env contains the following default script, of calls to system utilities for translating dvi pictures into gif.
    Gdvips -mode ibmvga -D 110 -f %%1 -pp %%2  > tex4ht.ps 
    Gconvert -crop 0x0 -density 110x110 -transparency '#FFFFFF' tex4ht.ps %%3 
    
    The %%1 is a parameter referring to a dvi file, the %%2 is a parameter indicating a page number, and the %%3 is a parameter standing for an output file name.

    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.

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

  12. 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).

  13. 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).

  14. Postprocessing of files can 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

  15. Replace the 3 occurences of path in htlatex and httex with the absolute path name to where tex4ht.dir resides.
  16. If you use a command different than latex for compiling LaTeX source files, replace the 3 occurences of latex in htlatex with the appropriate command name. Similarly, if you use a command different than tex for compiling LaTeX source files, replace the 3 occurences of tex in httex with the appropriate command name.
  17. Change the access modes of htlatex, httex, and ht to executable (e.g., `chmod 700 htlatex' and `chmod 700 ht').
  18. Consider creating a web directory where the output files would be stored for viewing by the browsers. The directory can be made world wide accessible by changing its access mode to 711. If you create such a directory, add the switches -ddir -m644 to the command line t4ht within the scripts htlatex, httex, and ht, where dir is the address of the web directory.

    Make the System Globally Known

  19. Inform the operating system where the scripts reside, by adding the directory path/tex4ht.dir' into the path variable within the .login file. For instance,

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

    Alternatively, make soft links from your work directory to the files htlatex and ht.

  20. Let LaTeX and TeX know where the new style reside, by adding the directory path/tex4ht.dir' to the environment variable TEXINPUT. For instance,

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

    Alternatively, make soft links from your work directory to the files *.4ht and tex4ht.sty.

    Test the Installation

  21. Move testa.tex and testb.tex to your work directory
  22. Compile `testa.tex' with the command `ht latex testa'
  23. Compile `testb.tex' with the command `htlatex testb'