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 tex4ht.zip from the tex4ht setup for unix environments page, placed it in
/usr/local/src/tex4ht
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
/usr/local/src/tex4ht/bin/unix/

Opened this file in a text editor:
/usr/local/src/tex4ht/texmf/tex4ht/base/unix/tex4ht.env

and replaced the line that starts with "t":
tpath/tex/texmf/fonts/tfm/!

with the following line:
t/usr/share/texmf/fonts/tfm/!

then, on the next line, added the following line:
t/var/cache/fonts/tfm/!

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
~/tex4ht.dir

with the string
/usr/local/src/tex4ht
which occurred on every line that started with an i.

The line in tex4ht.env which starts with:
l~/tex4ht.dir/tex4ht.fls

was changed to:
l/usr/local/src/tex4ht/tex4ht.fls
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
~/tex4ht.dir

with the string
/usr/local/src/tex4ht
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:
texhash
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.

References

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