exit an alternative setup

An Alternative Setup for Unix Environments

The following setting uses a perl script to interpret abstract `.lg' scripts of TeX4ht. Abstract scripts have the advantages of being portable across different platforms, of allowing for different interpretations within their platrforms, and of having the flexibility to repond to varying conditions within their platforms.

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

  2. Download the following files to `~/tex4ht.dir'.

    1. TeX4ht.sty
    2. tex4ht.env
    3. tex4ht.perl
    4. cmcsc.htf
    5. cmex.htf
    6. cmmi.htf
    7. cmr.htf
    8. cmsy.htf
    9. cmti.htf
    10. cmtt.htf
    11. lasy.htf
    12. lcircle.htf
    13. line.htf
    14. manfnt.htf
    15. logo.htf

  3. Change the access mode of file `tex4ht.perl' to be executable (e.g., `chmod 700 tex4ht.perl').

  4. Check that your system includes the `dvips' utility of Tomas Rokicki for converting dvi files into postscript. If this is not the case, you'll need to modify the line `dvips -mode $mf -D $density -f $_[0] -pp $_[1] > tmp.ps' in `tex4ht.perl' to reflect on the tools used in your environment to handle dvi code.

  5. Download the file tex4ht.c into a temporary directory.

  6. Compile `tex4ht.c' into an executable tex4ht file with the following command, where `XXX' should be replaced with the full path to the home directory.

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

  7. Move the file tex4ht to directory `tex4ht.dir', and delete the remaining files from your temporary directory.

  8. Download convert to a temporary directory, compile it into an executable file named `convert', move the executable file to the directory `tex4ht.dir', and delete the remaining files from your temporary directory.

  9. Create a work directory and establish there soft links to the files of directory `tex4ht.dir' (e.g., issue the system command `ln -s XXX/* .' in your work directory, where `XXX' stands for the relative path from your work directory to `text4ht.dir').

    A more general approach would be to make the files of `tex4ht.dir' globally known, e.g., by including lines similar to the following ones in the `.login' file.

              set path=(~/bin.$HOSTTYPE ~/tex4ht.dir
              setenv TEXINPUTS .:~/tex4ht.dir//:/n/candy/0/tex/teTeX/texmf/tex//
              

  10. Create a directory where the output files should be stored for viewing by browsers. If you want it to be in the public domain, change its access mode to 711.

  11. Create a file named `ht' with the following entries, and change its access mode to executable (e.g., `chmod 700 ht').

              all:
                      $1 $2
                      $1 $2
                      $1 $2
                      tex4ht $2
                      tex4ht.perl $2 WWW/  -m644  $3
              

    Except for the leading line, all the other lines must start with a tab character. The string `WWW' should be replaced with the relative path from the work directory, or an absolute path, to the browsing directory.

    Find out the Metafont modes available in your system (e.g., in `..../tex/teTeX/texmf/metafont/misc/modes.mf'). If mode `ibmvga' in resolution `110' is not available, or you rather use another setting, add after `$3' a `-f' parameter specifying an alternative mode and a `-r' parameter specifying an alternative resolution. (The default command `tex4ht.perl $2 WWW/ -m644 $3' is equivalent to `tex4ht.perl $2 WWW/ -m644 $3 -fibmvga -r110'.)

  12. Download test.tex to your work directory.

  13. Add the definition `\let\perl=Y' at the start of `test.tex'.

  14. If your browsing directory differs from your work directory, add at the beginning of `test.tex' a definition `\def\WWW{path}' holding the absolute path to your browsing directory, or a relative path from your work directory to the browsing directory (e.g., `\def\WWW{../../../WWW/}').

  15. Compile `test.tex' with the command `ht tex test' or `ht latex test'. You might want to compare your output with the sample output provided here for TeX and LaTeX.