Installing tex4ht on OpenSuSE 10.2

by Richard Hollos and Stefan Hollos

Last modified:

The steps we took to install tex4ht are described in general terms at the tex4ht setup for unix environments page. The details we describe below, are only of value if you want to install tex4ht on a SuSE system. It might also potentially be of use if you install on some other Linux system. tex4ht is not currently (10/29/07) part of the OpenSuSE distribution. Note that getting tex4ht to work requires some software that is part of the OpenSuSE distribution, like LaTeX.

To start, downloaded the 2.8 MB file from the tex4ht setup for unix environments page, placed it in
where I had just created the directory tex4ht, and unzipped it.

Copied files /usr/local/src/tex4ht/src/tex4ht.c, t4ht.c
into /usr/local/src/tex4ht/temp

Then compiled the first program like this:
gcc -o tex4ht tex4ht.c -DENVFILE='"/usr/local/src/tex4ht/texmf/tex4ht/base/unix/tex4ht.env"' -DHAVE_DIRENT_H

Note there are double quotes and single quotes on the command line above. Both types of quotes are on the same key of the keyboard, just to the right of the semicolon key. If you copy and paste this command from the web into your console, you may get complaints from gcc like "error: stray \342 in program". In that case, just type it.

The compilation above produces lots of warnings but no errors, which is OK as long as an executable is produced.

Now compiling t4ht.c with the command:
gcc -o t4ht t4ht.c -DENVFILE='"/usr/local/src/tex4ht/texmf/tex4ht/base/unix/tex4ht.env"'

Now we have two executable files in /usr/local/src/tex4ht/temp

Moved the executable files tex4ht and t4ht to directory

Opened this file in a text editor:

and replaced the line that starts with "t":

with the following line:

then, on the next line, added the following line:

This specifies the two locations where the tfm fonts are found on SuSE Linux.
The "!" at the end, says to search subdirectories.

Also in the file tex4ht.env we replaced the string

with the string
which occurred on every line that started with an i.

The line in tex4ht.env which starts with:

was changed to:
This specifies where the bookkeeping file is kept. I also verified that users have write privileges in that directory.

In the directory /usr/local/src/tex4ht/bin/unix
which contains about a hundred different scripts, I replaced every occurrence of the string

with the string
by running the following command:

perl -p -i -e 's/~\/tex4ht\.dir/\/usr\/local\/src\/tex4ht/' *

Notice the "/" and "." characters are escaped with a "\" character. The general form is:
perl -p -i -e 's/stringtoreplace/newstring/' *
where * means all files.

Edited /etc/profile.local
adding to the PATH environment variable, the directory where the scripts are, by putting in this line:

export PATH=${PATH}:/usr/local/src/tex4ht/bin/unix

Edited /etc/profile.local
to let latex know where the new style files are, by adding this line:

export TEXINPUTS=".:/usr/local/src/tex4ht/texmf/tex/generic/tex4ht:"

As root, ran the command:
which tells latex about the new software.

As regular user, typed:
source /etc/profile
to read the changes to profile.local

Copied the example files:
/usr/local/src/tex4ht/temp/testa.tex, testb.tex

into a home work directory then processed them by running:
ht latex testa
htlatex testb

The examples ran with no problems.

Thanks to Eitan Gurari for his great installation instructions, and for the very nice tex4ht software.


tex4ht home page
tex4ht setup for unix environments page

Comments? Contact:
Richard Hollos
richard[AT]exstrom DOT com
(303) 678-1487

Copyright 2007 by Exstrom Laboratories LLC email:info[AT]exstrom DOT com Exstrom Labs Home