A workaround may be to have a script that combines all the "input" and
"include" files into one temporary file. This file can then be used by
latex2html. If you opt to do this for the latex2html only, mind to "touch"
the <aux> etc. files.
Cheers - Jorgo Bakker
Gary Scavone wrote:
> I used to think that v97.1 was the most stable version of l2h, but the
> \input problem is something I can't workaround with this document. Is
> there either a fix I can make to our v97.1 l2h script or a good, stable
> newer version that I can use?
#!/usr/local/bin/perl
#
# author: Jorgo Bakker, BSC
#
# patch on: more than 2 \input{file} statements in LaTex documents produces
# infinite loop in latex2html.
#
# usage: l2hpatch < LatexDocument > patchedLatexDocument
#
# where the latter is the patched document that can be handled by
# latex2html
$tabber = 1;
print STDERR "l2hpatch - 1.0 patch for latex2html latex2html 98.1p1\n";
&documentSearch(\*STDIN);
print STDERR "\n";
exit;
#------------------------------------------------------------------------------
# search current LaTeX document for include files....
sub documentSearch{
my ($filehandle) = @_;
my ($pre,$file,$post);
while (<$filehandle>)
{
if (/^[^\%]*\\(input|include)\s*\{\s*([^\}]*)\s*\}/)
{
($pre,$file,$post) = ($`,$2,$');
if ($pre) {print STDOUT "$pre\n";}
&documentInline($file);
if ($post) {print STDOUT "$post";}
}
else
{
print STDOUT "$_";
}
}
}
# recursively opens included LaTeX files
sub documentInline{
my ($file) = @_;
local (*FILE);
open(FILE,&documentLocate($file)) || die "could not open file '$file'\n";
print STDOUT "\%//begin including\{$file\}\n";
print STDERR " " x $tabber++ . "including $file...\n";
&documentSearch(\*FILE);
$tabber--;
print STDOUT "\%//end including\{$file\}\n";
close(FILE);
}
sub documentLocate{
my ($file) = @_;
my ($here);
my (@path) = split(":",$ENV{"TEXINPUTS"});
unshift(@path,".");
while ( $here = shift(@path) ) {
$here .= "/".$file;
if (-e $here) {last;}
$here .= ".tex";
if (-e $here) {last;}
undef $here;
}
$here || die "could not find $file!\n";
$here;
}