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 jkl@ccl.net. 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 http://www.sunfreeware.com/. I chose SPARC/Solaris 7, but you may need to choose something else. If you have Solaris 7, you can go directly to: http://www.sunfreeware.com/sol7right.html and download:
  ghostscript-5.50
  ghostview-1.5
  libpng-1.0.2
  jpeg-6b
  netpbm-1mar1994p1
  zlib-1.1.3
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

ftp nce.sun.ca
Name: anonymous
Password: your_e-mail_address

   binary
   
   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
   
   quit
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

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: ftp://nce.sun.ca/pub/freeware/SOURCES/netpbm-1mar1994.p1.tar.gz. Be forewarned... I ran into several different netpbm-1mar1994.p1 collections which had minor differences. There is also a new version of netpbm at ftp://ftp.metalab.unc.edu/pub/Linux/apps/graphics/convert/netpbm-8.4.tgz 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 ftp://ftp.ccl.net/pub/chemistry/software/UNIX/latex2html/netpbm-8.4.tgz. In compiling netpbm I used the following hint from the latex2html mailing list archives
==========================================================
http://mail-archive.com/latex2html%40tug.org/msg00073.html

     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
        libtiff/)
     - edit these Makefiles to adjust install destinations (INSTALLBINARIES,
       INSTALLMANUALS{1,3,5})
     - 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
         PORTBINARIES
       - in pnm/Makefile: "pnmsmooth" should belong to PORTBINARIES instead of
         SCRIPTS
     - make binaries && make install.bin install.man

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


     HTH,
     Thomas

     --
     Thomas Anders 
     Hahn-Meitner-Institut Berlin, Germany
==========================================================

Few missing pieces

There are still a few small pieces, which need to be installed.

Finally the latex2html 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}
  echo ${LD_LIBRARY_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
     PATH=/usr/local/bin:/usr/local/netpbm:/usr/local/latex2html/bin 
   else
     PATH=${PATH}:/usr/local/bin:/usr/local/netpbm:/usr/local/latex2html/bin 
   fi
   export PATH
   if [ "$LD_LIBRARY_PATH".r = ".r" ]; then
     LD_LIBRARY_PATH=/usr/local/lib
   else
     LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib
   fi
   export LD_LIBRARY_PATH
or in your .cshrc add:
   if ( ${?PATH} == 1 ) then
     if ( ${PATH} == "" ) then
       setenv PATH /usr/local/bin:/usr/local/netpbm:/usr/local/latex2html/bin
     else
       setenv PATH ${PATH}:/usr/local/bin:/usr/local/netpbm:/usr/local/latex2html/bin
     endif
   else
     setenv PATH /usr/local/bin:/usr/local/netpbm:/usr/local/latex2html/bin
   endif
   if ( ${?LD_LIBRARY_PATH} == 1 ) then
     if ( ${LD_LIBRARY_PATH} == "" ) then
       setenv LD_LIBRARY_PATH /usr/local/lib
     else 
       setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/usr/local/lib
     endif 
   else
     setenv LD_LIBRARY_PATH /usr/local/lib
   endif

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 manual.ps...