[l2h] Image Generation fails...

Bruce R Miller Bruce R Miller" <miller@cam.nist.gov
Wed, 31 Mar 1999 16:44:36 -0500


On Mar 31,  9:17am, Steffen Klupsch wrote:
> \input{my_defs.tex}
> in the main document
> and the file my_defs.tex start with a comment as first line:

I was just wrestling with the same problem after upgrading both perl &
latex2html (2 at the same time? Bad move!)

It appears to be due to the line:
    s/(\W)?($comment_mark(\d+)?)/($1)? $1.$2:''/eg; # Remove comment markers,
not after braces
near the end of sub pre_process, which was changed sometime later last year.

The odd thing is, perl 5.004_01 does the `right thing', but perl 5.005_02
doesn't!   Now, I'm hesitant to go yelling `Perl Bug', but I cant otherwise
interpret the following simple example (I expect comment 1 & 3 to be removed)
--------
#! /your/perl/here

$comment_mark='<tex2html_comment_mark>';
$_ = '<tex2html_comment_mark>1
\newcommand{\foo}{\textbf{foo}}<tex2html_comment_mark>2
aword<tex2html_comment_mark>3
<<x>><tex2html_comment_mark>4
';

s/(\W)?($comment_mark(\d+)?)/($1)? $1.$2:''/eg;
print "=> \"$_\"\n";
-------
Whatever, replacing the offending line with:
  s/(\W)?$comment_mark(\d+)/($1)? $1.$comment_mark.$2:''/eg;
makes it work (but why should it be necessary??)

-- 
--
bruce.miller@nist.gov
http://math.nist.gov/~BMiller/