exit upgrade

TeX4ht Upgrading

At present, the only practical way to update TeX4ht is via a distribution. Runtime files continue to be updated in ¡a href=”/texlive/”¿TeX Live¡/a¿, so if you’re using TL, you can get those with ¡tt¿tlmgr update¡/tt¿. We don’t know if MiKTeX picks up the same updates.

There has been no new full release since Eitan’s death; still a work in progress.

For the upstream tex4ht source repository where the work is being done, see the tex4ht home page.

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/src/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/src/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 bitmaps.
    Gdvips -Ppdf -mode ibmvga -D 110 -f %%1 -pp %%2  > zz%%4.ps 
    Gconvert zz%%4.ps -trim +repage -density 110x110 -transparent ’#FFFFFF’ %%3 
    Grm zz%%4.ps 

    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 literate version tex4ht-env.tex of tex4ht.env offers a few suggestions.

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

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

    Use the option ‘-crop 0x0 +page’ or ‘-crop 0x0 +repage’ instead of ‘-trim’ for old convert utilities that do not recognize the latter argument.

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

  11. The bitmap formats can be controlled by a ‘g’ record of tex4ht.env, a ‘-g’ switch of tex4ht.c, and a -LGTYP switch in the compilation of tex4ht.c. The default setting assumes the ‘png’ format.

    Update the Other Scripts in the Environment File

  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 ‘.’ 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. Under kpathsea, the substring ‘to indirectly obtain the value of ${SELFAUTOPARENT}.

    The environment file tex4ht.env offers the following inactive dot script for validating output of compilations.

    <validatehtml> 
     .html xmllint --noout --valid --html %%1.html 
    </validatehtml> 
    <validate> 
     .xml xmllint --noout --valid %%1.xml 
     .html xmllint --noout --valid %%1.html 
     .css mycssparser %%1.css 
    </validate> 

    The dot script may be activated in the following manner.

    1. Bind a CSS validator to the .css record. (http://jigsaw.w3.org/css-validator/DOWNLOAD.html)

    2. Remove the leading space characters from the above record.

  15. 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’.

    Set the Script Files

  16. 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.

    The default scripts provide for three calls to LaTeX. The file tex4ht-auto-script.tex in tex4ht-lit.zip offers examples of bash scripts that automatically determine the number of compilations needed from LaTeX (contributed by Kai-Mikael Jää-Aro).

    Make the System Globally Known

  17. 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/)

  18. 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 TEXINPUTS. For instance,

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

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

  20. Some output modes assume Java is also available in the computer in use.

    Test the Installation

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

Generated August 24, 2020 - tex4ht home page