[l2h] latex2html on windows95

Richard M. Heiberger rmh@yule.stat.temple.edu (Richard M. Heiberger)
Thu, 20 May 1999 14:50:36 -0400


I am trying to install latex2html on Windows95.  I have
latex2html-98.1p1.tar and Perl from APi515e.exe.  Perl on Windows95
also requires dcom95.exe.

The combination does not work yet.  I have found what I think are bugs
in the perl for win32 and incompatabilities in the latex2html.  I am
sending this message to both lists.

My setup is to use Cygwin bash as my shell with 
PERL5SHELL=c:/Cygnus/B19/H-i386-cygwin32/bin/bash.exe
export PERL5SHELL

1. perl bug in redirection
I have three files, each with one line:
date.pl
   print "date\n"
temp.pl
   system("perl date.pl")
temp2.pl
   system("perl date.pl >tmp.out2")

And four executions
/rmh/pc-cdrom$ perl date.pl
date
/rmh/pc-cdrom$ perl temp.pl
date
/rmh/pc-cdrom$ perl date.pl > tmp.out   ## file was created
/rmh/pc-cdrom$ perl temp2.pl            ## file was not created
/rmh/pc-cdrom$ 

The bug is that the redirection within the argument to the system()
command does not get executed.  I assume this to be a win32 specific
bug.


2. latex2html consequence of above bug
The lines
	&syswait("$TEXEXPAND $dbg -auto_exclude $unseg " .
		 "-save_styles $DESTDIR${dd}${TMP_}styles " .
		 "$texfilepath$dd$FILE.$EXT > $DESTDIR${dd}$TMP_$FILE")
need to be rewritten to use the -o argument, in my specific case
	&syswait("perl -Ic:/progra~1/latex2html
                  /progra~1/latex2html/texexpand -debug -verbose -auto_exclude
                  -o /rmh/pc-cdrom/solut599b/TMP/solut599b
                  -save_styles solut599b/TMP/styles
                  /rmh/pc-cdrom/solut599b.tex ")

Note that the -o takes an absolute pathname, relative won't work.



3. perl bug in override.pm
getpwuid is not defined in perl for Windows95.  The file
 c:/Program Files/latex2html/Override.pm
attempts to provide an alternate definition.  Perl seems to treat the
name getpwuid as a reserved word and does not honor the override.
I had to comment out the lines in latex2html and texexpand and replace them
with hard-coded references.

I haven't checked the other alternate definitions in override.pm.

3a. recommendation for perl
latex2html provides what looks like a reasonable substitute definition.
Can perl adopt that as the official definition?

3b. bug in latex2html
The configuration set the override in latex2html incorrectly.  It set

#use Override qw(getpwuid link setenv getenv symlink rename
use Override qw(link setenv getenv symlink rename
		make_directory_absolute unlink $dd $envkey $image_pre $DEBUG);

with the comment on the line that needs to be retained, and uncommented the
line that needs to be commented.  I interchanged the two lines.


4. perl for Windows95 does not define fork

4a. to perl
I think bash has fork working.  I would like perl to be sensitive
to the shell in deciding whether to reject the use of fork.

4b. to latex2html
I had to replace two calls in latex2html to fork.
The -no_fork option does not get past either of these.

4b1.
sub syswait {
    local($_) = @_;
    local($status);
    print "\n\n$_\n" if ($DEBUG||($VERBOSITY > 2));

	system($_);

	print "\n *** finished child process: \#$child_pid\n"
	    if ($DEBUG||($VERBOSITY > 2));
	print "$_[0]:  $!\n";
        return($?/256);

}

Note that I use system() not exec() because it is important that there
be a return.  I believe this works correctly.

4b2. sub write_string_out
I commented out 3 lines.
#    unless ($pid = fork) {
..........
#    };
#    waitpid($pid,0) unless ($NOFORK);

I think this is working correctly, but I'm less sure.


5. difficulty with  #!c:/Perl/bin/bin/perl
I'm not sure if this is a Windows95, or bash, or perl problem.
This line is not honored, probably because Windows won't allow excute mode
to be set for files with filetype .pl or without a filetype.

5a. Consequence to latex2html
I changed two lines in latex2html.config to make explicit calls to perl:
$TEXEXPAND = "perl $LATEX2HTMLDIR/texexpand";
$PSTOIMG = "perl $LATEX2HTMLDIR/pstoimg";



6. After all the above, latex2html still doesn't work completely.
That is, there is no .html file at the end of the exercise.

6a. The first and last few lines in the shell transcript are:
/rmh/pc-cdrom$ perl c:/Progra~1/latex2html/latex2html solut599b.tex

This is LaTeX2HTML Version 98.1p1 release (March 2nd, 1998)
..................
Loading /progra~1/latex2html/styles/texdefs.perl...

Reading ...%%,++...
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Loading /progra~1/latex2html/styles/article.perl
/rmh/pc-cdrom$ 

and the file TMP/part001 is created.

6b. When I use my own handout3.sty file, I get a message in
TMP/WARNINGS:No implementation found for style `handout3'


6c. I have run this at -verbose 10 and I think I have responded to
everything up until the creation of part001.

I think that the program is stopping at the point where the
file latex2html is discussing:
# Then, still in &translate, latex2html uses the list of section commands to
# split the complete document into chunks.

My first suspicion is that the replacement of the fork in
write_string_out is not quite right.


I would appreciate help on further workarounds to make this system work for me.
Thank you.

Rich Heiberger