CCL Home Page
Up Directory CCL latex2html_on_sparc_solaris.html
Installing latex2html

Installing latex2html on Sparc Solaris

latex2html is a well known software package which converts LATEX documents into HTML documents. It was developed by Nikos Drakos with Ross Moore joining development a few years ago. Here is a detailed log and all needed software to accomplish this on your SUN SPARC running Solaris 7. You have to be a root to do it.
Dislaimer for lawyers: What follows is a nonsense. I warned you, didn't I? This document was committed by Jan K. Labanowski Do not trust anything here... I do not know what I am talking about... Last modified: April 17, 2000.

Getting necessary pieces

latex2html uses a lot of other tools and libraries, which have to be installed, before you can install latex2html. While under Linux, or FreeBSD many of these tools are a part of the standard distribution, with Solaris, it is not necessarily so. I assume that you do not start from the clean machine. Before you can start, you need to have the following tools installed: To build necessary libraries, I created a directory: /usr/local/tempjkl as
mkdir /usr/local/tempjkl
and downloaded the following packages from Free Solaris Software site I chose SPARC/Solaris 7, but you may need to choose something else. If you have Solaris 7, you can go directly to: and download:
I have all the packages also on this site, and you can download them from here. In practice, I did not download packages via Web Browser, but used venerable anonymous FTP.
cd /usr/local/tempjkl

Name: anonymous
Password: your_e-mail_address

   cd /pub/freeware/sparc/7
   get libpng-1.0.2-sol7-sparc-local.gz
   get ghostscript-5.50-sol7-sparc-local.gz
   get ghostview-1.5-sol7-sparc-local.gz
   get jpeg-6b-sol7-sparc-local.gz
   get libpng-1.0.2-sol7-sparc-local.gz
   get zlib-1.1.3-sol7-sparc-local.gz
   cd /pub/freeware/SOURCES/
   get ghostscript-fonts-other-5.50.tar.gz
   get ghostscript-5.50.tar.gz
   get ghostscript-fonts-std-5.50.tar.gz
   get ghostview-1.5.tar.gz
   get jpeg-6b.tar.gz
   get libpng-1.0.2.tar.gz
   get netpbm-1mar1994.p1.tar.gz
   get zlib-1.1.3.tar.gz
Note, the links above actually represent copies of these files stored locally with this documentation. You can use those, or check if newer ones are available from the original site(s) mentioned above.

Unpacking and Installing the pieces

  • Ghostscript 5.50. I know that version 6.0 is out, but I did not find it in an easy, compiled, Solaris package form. I did:
      cd /usr/local/tempjkl
      gunzip ghostscript-5.50-sol7-sparc-local.gz
      pkgadd -d ghostscript-5.50-sol7-sparc-local
  • Ghostview
      cd /usr/local/tempjkl
      gunzip ghostview-1.5-sol7-sparc-local.gz
      pkgadd -d ghostview-1.5-sol7-sparc-local
  • Ghostscript fonts
      cd /usr/local/share/ghostscript/fonts
      gtar zxvf /usr/local/tempjkl/ghostscript-fonts-other-5.50.tar.gz
      cd /usr/local/share/ghostscript
      gtar zxvf /usr/local/tempjkl/ghostscript-fonts-std-5.50.tar.gz
  • installed jpeg package
      cd /usr/local/tempjkl
      gunzip jpeg-6b-sol7-sparc-local.gz
      pkgadd -d jpeg-6b-sol7-sparc-local
  • install libpnh
      cd /usr/local/tempjkl
      gunzip libpng-1.0.2-sol7-sparc-local.gz
      pkgadd -d libpng-1.0.2-sol7-sparc-local
  • install compression lib, zlib
      cd /usr/local/tempjkl
      gunzip zlib-1.1.3-sol7-sparc-local.gz
      pkgadd -d zlib-1.1.3-sol7-sparc-local

Unpacking and Installing netpbm

netpbm is a set of tools and libraries which convert between different formats of images. The latex2html requires netpbm-1mar1994.p1 version (i.e., with patch 1). I took the netpbm-1mar1994.p1 source from: Be forewarned... I ran into several different netpbm-1mar1994.p1 collections which had minor differences. There is also a new version of netpbm at which is a continuing development of the netpbm-1mar1994.p1. However, its Makefiles are not compatible with other UNICes but Linux/BSD, so I did not use it, since it would be too much work to fix it. If you want to play with it, the local copy of netpbm-8.4.tgz is at In compiling netpbm I used the following hint from the latex2html mailing list archives

     Re: [l2h] netpbm for Solaris (5.7)

          From: Thomas Anders 
          Subject: Re: [l2h] netpbm for Solaris (5.7) 
          Date: Thu, 15 Apr 1999 02:29:34 -0700 

     On Apr 14, 16:02, Graham Gough wrote:
     > I'm a happy l2h user on my Linux box, but am trying to install it for
     > others on a Solaris machine. I'm having some problems building
     > netpbm using xmkmf. Make Makefiles fails [...]

     There's more than one way to do it ;) - IIRC, all you have to do is:
     - unpack netpbm-1mar1994.p1.tar.gz (note the "p1"!)
     - "cp Makefile.std Makefile" in every directory (use Makefile.gcc in
     - edit these Makefiles to adjust install destinations (INSTALLBINARIES,
     - edit pbmplus.h: #define RGB_DB  "/usr/openwin/lib/rgb.txt"
                       #define SYSV
                       #define PGM_BIGGRAYS
                       ... and whatever else you need ...
     - some minor bugfixes:
       - in pgm/Makefile: "pgmkernel" should belong to MATHBINARIES instead of
       - in pnm/Makefile: "pnmsmooth" should belong to PORTBINARIES instead of
     - make binaries && make install.bin

      This is all from the top of my head. Use at own risk.


     Thomas Anders 
     Hahn-Meitner-Institut Berlin, Germany

  • unpacked netpbm source
       cd /usr/local/tempjkl
       gtar zxvf netpbm-1mar1994.p1.tar.gz
  • patching Makefile files. There are some inconsistencies in the Makefiles. I edited each Makefile to make sure that:
         CC =            gcc -ansi -pedantic -fpcc-struct-return
         INSTALLBINARIES =       /usr/local/netpbm
         INSTALLMANUALS1 =       /usr/local/man/man1
         INSTALLMANUALS3 =       /usr/local/man/man3
         INSTALLMANUALS5 =       /usr/local/man/man5
  • top directory:
       cd /usr/local/tempjkl/netpbm-1mar94.p1
       cp Makefile.std Makefile
  • libtiff
       cd libtiff
       cp Makefile.gcc Makefile
    No editing was needed in the Makefile
  • pnm
       cd ../pbm
       cp Makefile.std Makefile
  • pgm
       cd ../pgm
       cp Makefile.std Makefile
    In addition, in the Makefile moved pgmkernel from PORTBINARIES to MATHBINARIES.
  • pnm
       cd ../pnm
       cp Makefile.std Makefile
    In addition, in the Makefile moved pnmsmooth from SCRIPTS to PORTBINARIES
  • ppm
       cd ../ppm
       cp Makefile.std Makefile
    No major corrections beside the common ones.
  • Compiling and Installing netpbm:
       cd /usr/local/tempjkl/netpbm-1mar94.p1
       make binaries
       make install.bin

Few missing pieces

There are still a few small pieces, which need to be installed.
  • pnmtopng -- another image format convertor:
       cd /usr/local/tempjkl
       gtar zxvf pnmtopng-2.34.tar.gz
       cd pnmtopng-2.34
    Edited Makefile in the following way:
         # CC=cc
         # LIBPNG=../libpng
         # ZLIB=../zlib
         # NETPBM=../netpbm
         # INSTDIR=/Users/Willem/Unix
    and then:
       make all
       cp -p pnmtopng pngtopnm /usr/local/netpbm
       cp -p pngtopnm.1 pnmtopng.1 /usr/local/man/man1
    The local copy of pnmtopng-2.34.tar.gz is available here:
  • giftool -- while I am including it here, it is a shareware and you need to pay $10 for each machine you install it on. The giftrans below can also be used by latex2html, so I deleted giftool after installation. I give instructions here for those of you who want it, however.
       cd /usr/local/tempjkl
       mkdir giftool
       cd giftool
       gtar Zxvf ../giftool.tar.Z
    Edit Makefile and change cc to gcc, i.e., CC=gcc.
       cp giftool /usr/local/bin
  • giftrans -- converts regular GIF to GIF with transparent background.
       cd /usr/local/tempjkl
       mkdir giftrans
       cd giftrans
       gcc -o giftrans giftrans.c
       cp giftrans /usr/local/bin
       cp giftrans.1 /usr/local/man/man1

Finally the latex2html install

  • Visit the site: and click on Documentation. Pick up this one:
       The official manual provided by the primary LATEX2HTML author, Ross Moore
    Click on the link above, and then choose: A Postscript version available (which is linked to: and download it. Keep it, and print it sometime later when you are ready to use latex2html. The installation instructions in the PostScript manual do not refer to the version which you have right now. However, manual has a lot of important information on proficient use of the software, so you will need it when you are ready to use the software.
  • Visit page again, but now click on Download. You will be transfered to the directory: Get the file:
        latex2html-99.2beta6.tar.gz   14-Apr-2000 07:15   1.0M  
    i.e., the URL: I am providing the local copies of these two files here:
    but you should check the original sites, since they may have some newer, better version.
  • Unpack the latex2html package:
       cd /usr/local/tempjkl
       gtar zxvf latex2html-99.2beta6.tar.gz
    Carefully read the INSTALL file (/usr/local/tempjkl/latex2html-99.2beta6/INSTALL).
  • Check if you have all programs which latex2html needs to run.
       cd /usr/local/tempjkl/latex2html-99.2beta6
       ./configure --help
    This will list all options defined in the configure script. you should have all the software installed (and available in the PATH which is listed in the lines:
    Now, use which or whence (depending on the shell you are using) and check if you can access the codes. For example, in my case, I could:
    which gs
    which dvips
    which latex
    which pnmcrop
    which tex
    which initex
    which kpsewhich
    which mktexlsr
    which pnmflip
    which ppmquant
    which  pnmfile
    which pnmcat
    which pbmmake
    which ppmtogif
    which pnmtopng
    which giftrans
    Note that I deleted the giftool. If one or more programs are not found, you need to install them. Another possibility is that your PATH variable is not set correctly. You may need to do something like this:
        export PATH
    if you are using the Bourne type shell (e.g., ksh, sh), or
        setenv PATH ${PATH}:/usr/local/netpbm:/usr/local/bin:/usr/local/teTeX/bin
    of you are using csh or tcsh.
  • configure Makefiles needed to build the latex2html:
       cd /usr/local/tempjkl/latex2html-99.2beta6
       ./configure --prefix=/usr/local/latex2html 
    If you did not get complaints like: not found, or something, you are ready to compile. Note that this will make latex2html reside under /usr/local/latex2html after installation. You may be tempted to put it under /usr/local but be warned that it will clutter it with a lot of strange files.
  • compile and install latex2html:
       cd /usr/local/tempjkl/latex2html-99.2beta6
       make check
    if no horrors, you are ready to install latex2html. First, edit the file in the top directory, by and changing LOCAL_ICONS from 0 to 1, i.e., to be:$LOCAL_ICONS = 1;. While it will waste some disk space (the common icons will be added to each translated document), the advantage is that you are not in any way dependent on where you put your document in the Web tree. Otherwise, you would have to have a special directory for icons, which would hold common icons. If you wanted to give your friend your paper to put on his web site, or view it as a file:///someting on the laptop, there would be unsatisfied images on your pages. Now, put the files where they belong:
       cd /usr/local/tempjkl/latex2html-99.2beta6
       make install

You installed latex2html and now what?

You need to remember to add latex2html and other programs which it uses to the PATH. It is a good idea to check what is actually your PATH, since you really should not add the same directory twice in PATH. Just do:
  echo ${PATH}
to see what is there. Then, you can use the scripts below as a template. If you are the Bourne type shell fanatic, add this to your .profile:
   if [ "$PATH".r = ".r" ]; then
   export PATH
   if [ "$LD_LIBRARY_PATH".r = ".r" ]; then
or in your .cshrc add:
   if ( ${?PATH} == 1 ) then
     if ( ${PATH} == "" ) then
       setenv PATH /usr/local/bin:/usr/local/netpbm:/usr/local/latex2html/bin
       setenv PATH ${PATH}:/usr/local/bin:/usr/local/netpbm:/usr/local/latex2html/bin
     setenv PATH /usr/local/bin:/usr/local/netpbm:/usr/local/latex2html/bin
   if ( ${?LD_LIBRARY_PATH} == 1 ) then
     if ( ${LD_LIBRARY_PATH} == "" ) then
       setenv LD_LIBRARY_PATH /usr/local/lib
       setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/usr/local/lib
     setenv LD_LIBRARY_PATH /usr/local/lib

Of course, you can be nice, and do it for everybody by adding it to the end of /etc/profile, and /etc/.login; respectively (but make them simpler, since here you know what is set an what is not set in these files by looking at them).

Now try it...
If LATEX document is called mypaper.tex, you just do:

   latex mypaper.tex
   latex mypaper.tex
   latex2html mypaper.tex
(you can skip extensions .tex). As a result, in the directory mypaper you will have your paper converted to HTML.

This is a version which does not use GIF images by default, but uses a new (better) format, called PBM (Portable BitMap). While this format is supported by all newer browsers, you may still want to use GIFs to by portable. In this case, you may force latex2html to produce transparent GIFS as output:

   latex2html -image_type gif -transparent mypaper.tex
If your images representing equations, etc. come white, and the rest of the page is blue or gray, you need to find the <BODY> tag at the beginning of your newly created HTML file and change it to:
<BODY BGCOLOR="white"> and your background will also become white.

I think, it is time to print
Modified: Mon Jun 26 00:13:19 2000 GMT
Page accessed 24819 times since Mon Jun 26 00:06:17 2000 GMT