diff -rcN latex2html-2008/config/config.pl l2h-2K8-jp1.10b2.9/config/config.pl
*** latex2html-2008/config/config.pl	Wed Sep 24 04:55:55 2008
--- l2h-2K8-jp1.10b2.9/config/config.pl	Fri Oct  3 15:02:19 2008
***************
*** 793,798 ****
--- 793,804 ----
    logit("Warning: Both GIF and PNG support disabled. LaTeX2HTML won't generate any images.\n");
  }
  
+ #---------
+ # japanese
+ #---------
+ 
+ $opt{'Japanese'} = 1;
+ 
  # --------------------------------------------------------------------------
  # TeX, LaTeX, IniTeX, Web2C
  # --------------------------------------------------------------------------
***************
*** 800,806 ****
  $newcfg{'TEX'} = '';
  
  if($opt{'IMAGES'}) {
!   my $tex = &find_prog(&get_name('TEX',1));
    if($tex) {
      $newcfg{'TEX'} = $tex;
    }
--- 806,813 ----
  $newcfg{'TEX'} = '';
  
  if($opt{'IMAGES'}) {
!     my $tex = &find_prog(&get_name('TEX',1)) unless $opt{'Japanese'};
!     $tex = &find_prog(&get_name('PTEX',1)) if $opt{'Japanese'};
    if($tex) {
      $newcfg{'TEX'} = $tex;
    }
***************
*** 809,815 ****
  $newcfg{'LATEX'} = '';
  
  if($opt{'IMAGES'}) {
!   my $latex = &find_prog(&get_name('LATEX',1));
    if($latex) {
      $newcfg{'LATEX'} = $latex;
    }
--- 816,823 ----
  $newcfg{'LATEX'} = '';
  
  if($opt{'IMAGES'}) {
!     my $latex = &find_prog(&get_name('LATEX',1)) unless $opt{'Japanese'};
!     $latex = &find_prog(&get_name('PLATEX',1)) if $opt{'Japanese'};
    if($latex) {
      $newcfg{'LATEX'} = $latex;
    }
***************
*** 822,831 ****
  $newcfg{'INITEX'} = '';
  
  if($opt{'IMAGES'}) {
!   my $initex = &find_prog(&get_name('INITEX',1));
    if($initex) {
      $newcfg{'INITEX'} = $initex;
    }
  }
  
  $newcfg{'KPSEWHICH'} = '';
--- 830,843 ----
  $newcfg{'INITEX'} = '';
  
  if($opt{'IMAGES'}) {
!     my $initex = &find_prog(&get_name('INITEX',1)) unless $opt{'Japanese'};
!     $initex = &find_prog(&get_name('INIPTEX',1)) if $opt{'Japanese'};
    if($initex) {
      $newcfg{'INITEX'} = $initex;
    }
+   elsif ( $newcfg{'TEX'} ) {
+     $newcfg{'INITEX'} = "$newcfg{'TEX'} -ini";
+   }
  }
  
  $newcfg{'KPSEWHICH'} = '';
***************
*** 1276,1281 ****
--- 1288,1295 ----
      my $vers = '';
      $msg = $msg || $err;
      if ($msg =~ /(^|\s*)Version.*\s([\d\.]+)\s*([\n\r]|$)/is) { $vers = $2; }
+     # shige 11/03 2006
+     if ($vers =~ /(\d+\.){2}/) { $vers =~ s/(\d+\.\d+)\.\S+/$1/; }
      if ($vers =~ /^199/) {
  	# try left crop
  	&checking('if pnmcrop can crop from one direction');
***************
*** 1343,1352 ****
--- 1357,1376 ----
  # --------------------------------------------------------------------------
  
  $newcfg{'PPMQUANT'} = '';
+ $newcfg{'PPMQUANTOPT'} = '';
  
  if(1) {
    my $ppmquant = &find_prog(&get_name('PPMQUANT',1));
    if($ppmquant) {
+     my ($stat,$msg,$err) = ('','','');
+     ($stat,$msg,$err) = &get_out_err("$ppmquant -version");
+     my $vers = '';
+     $msg = $msg || $err;
+     if ($msg =~ /Version/) { 
+ 	$newcfg{'PPMQUANTOPT'} = ' -floyd';
+     } else {
+ 	$newcfg{'PPMQUANTOPT'} = ''; # script version
+     }
      $newcfg{'PPMQUANT'} = $ppmquant;
    }
  }
***************
*** 1413,1418 ****
--- 1437,1444 ----
      $msg = $msg || $err;
      my $vers = '';
      if ($msg =~ /(^|\s*)Version.*\s([\d\.]+)\s*([\n\r]|$)/is) { $vers = $2; }
+     # shige 11/03 2006
+     if ($vers =~ /(\d+\.){2}/) { $vers =~ s/(\d+\.\d+)\.\S+/$1/; }
      if ($vers =~ /^199/) {
  	&checking('if ppmtogif can make transparent GIFs');
  	# '-h' is an invalid option. Nevertheless it forces ppmtogif to output a
***************
*** 1783,1788 ****
--- 1809,1834 ----
      $newcfg{'gif_trans'} = 'giftrans';
    }
  }
+ 
+ # --------------------------------------------------------------------------
+ # NKF
+ # --------------------------------------------------------------------------
+ 
+ $newcfg{'TONATIVE'} = '';
+ $newcfg{'TOHTML'} = '';
+ $newcfg{'FROMNATIVE'} = 'cat'; # Unix
+ $newcfg{'ARTICLE'} = 'article';
+ if($opt{'Japanese'}) {
+     my $nkf = &find_prog(&get_name('NKF',1));
+     if($nkf) {
+ 	$newcfg{'TONATIVE'} = $prefs{'TONATIVE'} || "|$nkf -e";
+ 	#$newcfg{'TOHTML'} = $prefs{'TOHTML'} || "|$nkf -j";
+ 	$newcfg{'TOHTML'} = $prefs{'TOHTML'} || "| cat";
+ 	$newcfg{'FROMNATIVE'} = $prefs{'FROMNATIVE'} || "$nkf -e";
+     }
+     $newcfg{'ARTICLE'} = 'jarticle';
+ }
+ 
  
  # --------------------------------------------------------------------------
  # Pipes
diff -rcN latex2html-2008/l2hconf.pin l2h-2K8-jp1.10b2.9/l2hconf.pin
*** latex2html-2008/l2hconf.pin	Fri Nov 29 20:49:12 2002
--- l2h-2K8-jp1.10b2.9/l2hconf.pin	Fri Oct  3 15:02:19 2008
***************
*** 31,36 ****
--- 31,41 ----
  $INILATEX = "@INITEX@ \"&latex\"";	# initex+latex
  
  
+ $ARTICLE = "@ARTICLE@";
+ 
+ $TONATIVE = "@TONATIVE@";
+ $TOHTML = "@TOHTML@";
+ 
  # These affect whether images are made on a white or gray background.
  # They are ignored when the document preamble contains similar commands.
  # Use these defaults for dark solid (anti-aliased) characters in text and math.
diff -rcN latex2html-2008/latex2html.pin l2h-2K8-jp1.10b2.9/latex2html.pin
*** latex2html-2008/latex2html.pin	Thu Jan  8 15:15:01 2004
--- l2h-2K8-jp1.10b2.9/latex2html.pin	Sat Dec 20 19:37:50 2008
***************
*** 1,6 ****
--- 1,8 ----
  #- -*- perl -*-
  #
  # $Id: latex2html.pin,v 1.71 2004/01/06 23:49:54 RRM Exp $
+ # jLaTeX2HTML version 1.99+3.0 1999/9/15
+ # jLaTeX2HTML version 1.10b2.9 2008/12/20 shige
  #
  # Comprises patches and revisions by various authors:
  #   See Changes, the log file of LaTeX2HTML.
***************
*** 9,14 ****
--- 11,23 ----
  #
  # LaTeX2HTML by Nikos Drakos <nikos@cbl.leeds.ac.uk>
  
+ # Japanese Patched:
+ # jLaTeX2HTML by Kenshi Muto <kmuto@debian.org>
+ #  jLaTeX2HTML copyright follows LaTeX2HTML copyright.
+ 
+ # modified for latex2html-{2K.1beta,2002,2008} by shige
+ # Shigeharu TAKENO <shige@iee.niit.ac.jp>
+ 
  # ****************************************************************
  # LaTeX To HTML Translation **************************************
  # ****************************************************************
***************
*** 145,157 ****
--- 154,173 ----
  #$TPATCHLEVEL = " release";
  #$RELDATE = "(March 30, 1999)";
  #$TEX2HTMLV_SHORT = $TVERSION . $TPATCHLEVEL;
+ $JVERSION = "JA patch-1.10beta2.9";
  
  $TEX2HTMLV_SHORT = $RELEASE;
+ $JTEX2HTMLV_SHORT = "$RELEASE $JVERSION";
  $TEX2HTMLVERSION = "$TEX2HTMLV_SHORT ($REVISION)";
+ $JTEX2HTMLVERSION = "$TEX2HTMLV_SHORT ($REVISION) $JVERSION";
  $TEX2HTMLADDRESS = "http://www.latex2html.org/";
+ #$JTEX2HTMLADDRESS = "http://www.topstudio.co.jp/&#126;kmuto/software/latex2html/";
+ $JTEX2HTMLADDRESS = "http://takeno.iee.niit.ac.jp/&#126;shige/TeX/latex2html/";
  $AUTHORADDRESS = "http://cbl.leeds.ac.uk/nikos/personal.html";
  #$AUTHORADDRESS2 = "http://www-math.mpce.mq.edu.au/%7Eross/";
  $AUTHORADDRESS2 = "http://www.maths.mq.edu.au/&#126;ross/";
+ $JAUTHORADDRESS = "http://www.topstudio.co.jp/&#126;kmuto/";
+ $JAUTHORADDRESS2 = "http://takeno.iee.niit.ac.jp/&#126;shige/";
  
  # Set $HOME to what the system considers the home directory
  $HOME = L2hos->home();
***************
*** 342,347 ****
--- 358,364 ----
          'xbit!',                \$XBIT_HACK,
          'ssi!',                 \$ALLOW_SSI,
          'php!',                 \$ALLOW_PHP,
+         'lang=s',               \$REQUIRE_LANGUAGE,
          'test_mode!' # undocumented switch
         )) {
      &usage();
***************
*** 526,531 ****
--- 543,576 ----
  # _TODO_ this should be determined by configure
  #$DVIPS_SAFE = 1;
  
+ # shige 12/05 2004; 09/13 2005 
+ if ( $REQUIRE_LANGUAGE ) {
+     %lang_list = ( 'jis',	'japanese',
+ 		   'euc',	'japanese',
+ 		   'sjis',	'japanese',
+ 		   'jutf',	'japanese',
+ 		   'en',	'english',
+ 		   'no',	'',
+ 		   );
+     die "Error: Use '-lang (jis|euc|sjis|jutf|en|no)'.\n"
+ 	if ! defined $lang_list{$REQUIRE_LANGUAGE};
+     if ( $lang_list{$REQUIRE_LANGUAGE} ) {
+ 	my $fname = "$LATEX2HTMLSTYLES$dd$lang_list{$REQUIRE_LANGUAGE}.perl";
+ 	require "$fname" if -f "$fname";
+     }
+     if ( "$REQUIRE_LANGUAGE" =~ /(jis|euc|sjis|jutf)/ ) {
+ 	$NTRANS = "@FROMNATIVE@";
+     } else {
+ 	$NTRANS = '';
+     }
+     # if ( $VERBOSITY > 1 ) {
+     #    print "\n  *** -lang $REQUIRE_LANGUAGE ($fname) ($NTRANS) *** " 
+     #    print "\n  *** (charset,japanese_encoding,TOHTML)";
+     #	 print "=($charset,$japanese_encoding,$TOHTML) *** \n" ;
+     #	 exit;
+     # }
+ }
+ 
  $CHARSET = $charset || 'iso-8859-1';
  
  ####################################################################
***************
*** 832,837 ****
--- 877,883 ----
  		 . "-save_styles $DESTDIR$dd$TMP_${dd}styles "
  		 . ($TEXINPUTS ? "-texinputs $TEXINPUTS " : '' )
  		 . (($VERBOSITY >2) ? "-verbose " : '' )
+ 		 . ($NTRANS ? "-ntrans \"$NTRANS\" " : '' )      
  		 . "-out $DESTDIR$dd$TMP_$dd$FILE "
  		 . "$texfilepath$dd$FILE.$EXT")
  	    && die " texexpand  failed: $!\n";
***************
*** 3496,3502 ****
      }
      $fullcontents =  $contents; # save for later \label search.
      # MRO: replaced $* with /m
!     $contents =~ s/\n?$labels_rx(\%([^\n]+$|$EOL))?/\n/gm;
  
      local($tmp) = $contents;
      $tmp =~ s/^((\\par|\%)?\s*\n)+$//g;
--- 3542,3550 ----
      }
      $fullcontents =  $contents; # save for later \label search.
      # MRO: replaced $* with /m
!     # $contents =~ s/\n?$labels_rx(\%([^\n]+$|$EOL))?/\n/gm;
!     # modified by shige 06/16 2004
!     $contents =~ s/\n?\s*$labels_rx(\%([^\n]+$|$EOL))?/\n/gm;
  
      local($tmp) = $contents;
      $tmp =~ s/^((\\par|\%)?\s*\n)+$//g;
***************
*** 3793,3799 ****
  sub make_image_file {
      do {
  	print "\nWriting image file ...\n";
! 	open(ENV,">.$dd${PREFIX}images.tex")
              || die "\nCannot write '${PREFIX}images.tex': $!\n";
  	print ENV &make_latex($latex_body);
  	print ENV "\n";
--- 3841,3847 ----
  sub make_image_file {
      do {
  	print "\nWriting image file ...\n";
! 	open(ENV,"${TONATIVE}>.$dd${PREFIX}images.tex")
              || die "\nCannot write '${PREFIX}images.tex': $!\n";
  	print ENV &make_latex($latex_body);
  	print ENV "\n";
***************
*** 6857,6863 ****
      $preamble =~s/\\(begin|end)\s*\{(tex2html_(nowrap|deferred|nomath|preform)[_a-z]*|imagesonly)\}//g;
      $preamble =~s/\n?\s?<tex2html_(end)?file>\#[^#]*\#//mg;
  
!     $preamble = "\\documentclass\{article\}%\n\\usepackage{html}\n\\usepackage[dvips]{color}\n"
  	unless ($preamble);
      if (($LATEX_DUMP)&&(!($preamble =~ /\\usepackage\{ldump\}/))) {
  	# MRO: replaced $* with /m
--- 6905,6911 ----
      $preamble =~s/\\(begin|end)\s*\{(tex2html_(nowrap|deferred|nomath|preform)[_a-z]*|imagesonly)\}//g;
      $preamble =~s/\n?\s?<tex2html_(end)?file>\#[^#]*\#//mg;
  
!     $preamble = "\\documentclass\{${ARTICLE}\}%\n\\usepackage{html}\n\\usepackage[dvips]{color}\n"
  	unless ($preamble);
      if (($LATEX_DUMP)&&(!($preamble =~ /\\usepackage\{ldump\}/))) {
  	# MRO: replaced $* with /m
***************
*** 7123,7129 ****
      }
  
      join("\n", (($DOCTYPE)? $DTDcomment : '' )
! 	,"<!--Converted with LaTeX2HTML $TEX2HTMLVERSION"
  	, "original version by:  Nikos Drakos, CBLU, University of Leeds"
  	, "* revised and updated by:  Marcus Hennecke, Ross Moore, Herb Swan"
  	, "* with significant contributions from:"
--- 7171,7180 ----
      }
  
      join("\n", (($DOCTYPE)? $DTDcomment : '' )
! 	,"<!--Converted with jLaTeX2HTML $JTEX2HTMLVERSION"
! 	 , "patched version by:  Kenshi Muto, Debian Project."
! 	 , "* modified by:  Shige TAKENO"
! 	 , "LaTeX2HTML $TEX2HTMLVERSION,"
  	, "original version by:  Nikos Drakos, CBLU, University of Leeds"
  	, "* revised and updated by:  Marcus Hennecke, Ross Moore, Herb Swan"
  	, "* with significant contributions from:"
***************
*** 7297,7302 ****
--- 7348,7355 ----
      s/\\protect//g;		# remove redundant \protect macros
      #$_ = pack("u*", $_);	# uuencode
      s/\\\$/dollar/g;		# replace funnies, may cause problems in a hash key
+     s/\\([ij])([^a-zA-Z_])/$1nodot$2/g;
+ 				# added by shige 12/14 2004 for \i,\j
      s/\//slash/g;		# replace funnies, may cause problems in a hash key
      s/\$|\/|\\//g;		# remove funnies, may cause problems in a hash key
      s/\s*|\n//g;		# Remove spaces  and newlines
***************
*** 7449,7455 ****
  		if ($this_file =~ /\Q$dd\E([^$dd$dd]+)$/) { $this_file = $1 }
  	    }
  	    &slurp_input($this_file);
! 	    open(OUTFILE, ">$this_file")
                  || die "\nError: Cannot write file '$this_file': $!\n";
  
  	    if (($INDEX) && ($SHORT_INDEX) && ($SEGMENT eq 1)) {
--- 7502,7508 ----
  		if ($this_file =~ /\Q$dd\E([^$dd$dd]+)$/) { $this_file = $1 }
  	    }
  	    &slurp_input($this_file);
! 	    open(OUTFILE, "${TOHTML}>$this_file")
                  || die "\nError: Cannot write file '$this_file': $!\n";
  
  	    if (($INDEX) && ($SHORT_INDEX) && ($SEGMENT eq 1)) {
***************
*** 8578,8584 ****
  
  sub post_process_footnotes {
      &slurp_input($footfile);
!     open(OUT, ">$footfile") || die "Cannot write file '$footfile': $!\n";
      &replace_markers;
      &post_post_process if (defined &post_post_process);
      &adjust_encoding;
--- 8631,8637 ----
  
  sub post_process_footnotes {
      &slurp_input($footfile);
!     open(OUT, "${TOHTML}>$footfile") || die "Cannot write file '$footfile': $!\n";
      &replace_markers;
      &post_post_process if (defined &post_post_process);
      &adjust_encoding;
***************
*** 9017,9023 ****
  # MRO: Print standardized header
  sub banner {
      print <<"EOF";
! This is LaTeX2HTML Version $TEX2HTMLVERSION
  by Nikos Drakos, Computer Based Learning Unit, University of Leeds.
  
  EOF
--- 9070,9079 ----
  # MRO: Print standardized header
  sub banner {
      print <<"EOF";
! This is jLaTeX2HTML Version $JTEX2HTMLVERSION
! by Kenshi Muto, Debian Project.
! 
! Original LaTeX2HTML Version $TEX2HTMLVERSION
  by Nikos Drakos, Computer Based Learning Unit, University of Leeds.
  
  EOF
***************
*** 11092,11097 ****
--- 11148,11155 ----
      &do_require_package($option) unless ($styles_loaded{$option});
      # next look for a subroutine named  do_$option
      $do_option = "do_$option";
+     # shige 2001 11/01 for j-article, j-report
+     $do_option =~ s/-/_/g;
      if (!($styles_loaded{$option}) && defined(&$do_option)) {
  	&$do_option();
  	$styles_loaded{$option} = 1;
***************
*** 11965,11981 ****
  	$_ = join('', $save, &post_latex_do_env_equation($eqno_prefix));
      }
      if (($border||($attribs))&&($HTML_VERSION > 2.1 )) { 
! 	join('',"<BR>\n<DIV$env_id ALIGN=\"CENTER\">\n"
! 	    , &make_table( $border, $attribs, '', '', '', $_ )
! 	    , "\n<BR CLEAR=\"ALL\">");
      } elsif ($HTML_VERSION < 2.2 ) { 
  	join('', "\n<P>", $_ , "\n<BR></P>" )
      } elsif ($HTML_VERSION > 2.1 ) { 
! 	join('', "\n<P ALIGN="
! 	    , ((!$no_num &&($EQN_TAGS =~ /L/))?
! 		'"LEFT"':($no_num ?'"CENTER"':'"RIGHT"'))
! 	    , '>', $_ , "\n<BR></P>" )
!     } else { $_ }
  }
  
  sub do_env_eqnarray{
--- 12023,12051 ----
  	$_ = join('', $save, &post_latex_do_env_equation($eqno_prefix));
      }
      if (($border||($attribs))&&($HTML_VERSION > 2.1 )) { 
! 	# shige 11/04 2006
! 	if ($USEFLEQNINDENT && $FLUSH_EQN && ($no_num || $EQN_TAGS =~ /R/)) {
! 	    join('',"\n<blockquote>\n"
! 		 , &make_table( $border, $attribs, '', '', '', $_ )
! 		 , "\n</blockquote><br clear=\"all\">");
! 	} else {
! 	    join('',"<BR>\n<DIV$env_id ALIGN=\"CENTER\">\n"
! 		 , &make_table( $border, $attribs, '', '', '', $_ )
! 		 , "\n<BR CLEAR=\"ALL\">");
! 	}
      } elsif ($HTML_VERSION < 2.2 ) { 
  	join('', "\n<P>", $_ , "\n<BR></P>" )
      } elsif ($HTML_VERSION > 2.1 ) { 
! 	# shige 11/04 2006
! 	if ($USEFLEQNINDENT && $FLUSH_EQN && ($no_num || $EQN_TAGS =~ /R/)) {
! 	    join('', "\n<blockquote>", $_ , "\n<blockquote>" );
! 	} else {
! 	    join('', "\n<P ALIGN="
! 		 , ((!$no_num &&($EQN_TAGS =~ /L/))?
! 		    '"LEFT"':($no_num ?'"CENTER"':'"RIGHT"'))
! 		 , '>', $_ , "\n<BR></P>" );
! 	}
!     } else { $_; }
  }
  
  sub do_env_eqnarray{
***************
*** 12110,12119 ****
      $global{'eqn_number'}+=1;
      # include equation number at the side of the image -- HTML 3.2
      if ($HTML_VERSION >= 3.2){
! 	join('',"<P ALIGN=\"" , (($EQN_TAGS eq "L") ? "left" : "right")
! 		, "\">$EQNO_START" , $prefix 
! 		, &translate_commands('\theequation')
! 		, "$EQNO_END</P>\n<BR CLEAR=\"all\">" );
      # </P> creates unwanted space in some browsers, but others need it.
      } else { "" }
  }
--- 12180,12196 ----
      $global{'eqn_number'}+=1;
      # include equation number at the side of the image -- HTML 3.2
      if ($HTML_VERSION >= 3.2){
! 	# shige 11/04 2006
! 	if ($USEFLEQNINDENT && $FLUSH_EQN) {
! 	    join('',"<blockquote>\n$EQNO_START" , $prefix 
! 		 , &translate_commands('\theequation')
! 		 , "$EQNO_END\n</blockquote>\n<br clear=\"all\">" );
! 	} else {
! 	    join('',"<P ALIGN=\"" , (($EQN_TAGS eq "L") ? "left" : "right")
! 		 , "\">$EQNO_START" , $prefix 
! 		 , &translate_commands('\theequation')
! 		 , "$EQNO_END</P>\n<BR CLEAR=\"all\">" );
! 	}
      # </P> creates unwanted space in some browsers, but others need it.
      } else { "" }
  }
***************
*** 12164,12173 ****
  sub post_latex_do_env_eqnarraystar {
      local($_) = @_;
      if (($HTML_VERSION >= 3.2)&&(!$NO_SIMPLE_MATH)){
! 	join('', "<BR>\n<DIV ALIGN=\"CENTER\">\n"
! 	    , $_ , "\n<BR CLEAR=\"ALL\">\n<P>");
      } elsif (($HTML_VERSION >= 2.2)&&(!$NO_SIMPLE_MATH)) {
! 	join('', "\n<BR><P ALIGN=\"CENTER\">\n", $_ , "\n<BR></P>\n<P>");
      } else {
  	join('', "\n<BR><P>\n", $_ , "\n<BR></P>\n<P>");
      }
--- 12241,12261 ----
  sub post_latex_do_env_eqnarraystar {
      local($_) = @_;
      if (($HTML_VERSION >= 3.2)&&(!$NO_SIMPLE_MATH)){
! 	# shige 11/04 2006
! 	if ($USEFLEQNINDENT && $FLUSH_EQN) {
! 	    join('', "\n<blockquote>\n"
! 		 , $_ , "\n</blockquote><br clear=\"all\">\n");
! 	} else {
! 	    join('', "<BR>\n<DIV ALIGN=\"CENTER\">\n"
! 		 , $_ , "\n<BR CLEAR=\"ALL\">\n<P>");
! 	}
      } elsif (($HTML_VERSION >= 2.2)&&(!$NO_SIMPLE_MATH)) {
! 	# shige 11/04 2006
! 	if ($USEFLEQNINDENT && $FLUSH_EQN) {
! 	    join('', "\n<blockquote>\n", $_ , "\n</blockquote>\n");
! 	} else {
! 	    join('', "\n<BR><P ALIGN=\"CENTER\">\n", $_ , "\n<BR></P>\n<P>");
! 	}
      } else {
  	join('', "\n<BR><P>\n", $_ , "\n<BR></P>\n<P>");
      }
***************
*** 13741,13746 ****
--- 13829,13835 ----
  sub do_cmd_footnotename { $foot_title . $_[0] }
  sub do_cmd_childlinksname { '<STRONG>'.$child_name.'</STRONG>'. $_[0] }
  sub do_cmd_infopagename { $info_title . $_[0] }
+ sub do_cmd_prefacename { $pre_title . $_[0] }
  
  
  sub do_cmd_ref {
***************
*** 14894,14900 ****
  	# Accent of this form: "\^{\i}rest" or not an accent on i nor j
  	($arg) =  &get_next_pair_or_char_pr;
      }
!     $arg =~ s/([^\s\\<])/$first_char = $1; ''/eo;
  #   print STDOUT "\nACCENT1 type:$type arg:|${arg}| first_char: |$first_char| $ij_cmd 
  #	, $ACCENT_IMAGES\n";
  
--- 14983,14992 ----
  	# Accent of this form: "\^{\i}rest" or not an accent on i nor j
  	($arg) =  &get_next_pair_or_char_pr;
      }
!     #$arg =~ s/([^\s\\<])/$first_char = $1; ''/eo;
!     # modified by shige 12/13 2004 for \t{oo}
!     if ($type eq "t" ) { $first_char = $arg; $arg = ""; }
!     else { $arg =~ s/([^\s\\<])/$first_char = $1; ''/eo; }
  #   print STDOUT "\nACCENT1 type:$type arg:|${arg}| first_char: |$first_char| $ij_cmd 
  #	, $ACCENT_IMAGES\n";
  
***************
*** 14951,14958 ****
      # ...or the accent is wider than the letter, so pad it out a bit
      $afterkern = "\\kern.15em" if ($char =~ /i|l/); #||($type=~/v/));
  
!     &process_undefined_environment("tex2html_accent_inline"
!         , ++$global{'max_id'}, "${bstyle}\\${type}\{$char\\/\}$estyle$afterkern");
  }
  
  # MEH: Actually tries to find a dotless i or j
--- 15043,15058 ----
      # ...or the accent is wider than the letter, so pad it out a bit
      $afterkern = "\\kern.15em" if ($char =~ /i|l/); #||($type=~/v/));
  
!     #&process_undefined_environment("tex2html_accent_inline"
!     #    , ++$global{'max_id'}, "${bstyle}\\${type}\{$char\\/\}$estyle$afterkern");
!     # shige 01/18 2002
!     if ( $type =~ /^accent/ ) {
! 	&process_undefined_environment("tex2html_accent_inline" 
!           , ++$global{'max_id'}, "${bstyle}\\${type}$char\\/$estyle$afterkern");
!     } else {
! 	&process_undefined_environment("tex2html_accent_inline"
!           , ++$global{'max_id'}, "${bstyle}\\${type}\{$char\\/\}$estyle$afterkern");
!     }
  }
  
  # MEH: Actually tries to find a dotless i or j
***************
*** 14972,14978 ****
  	&write_warnings("Accent number $number is unknown.\n");
  	return $_;
      }
!     &accent_safe_for_ij($type , 'accent$number' );
      $_;
  }
  
--- 15072,15080 ----
  	&write_warnings("Accent number $number is unknown.\n");
  	return $_;
      }
!     #&accent_safe_for_ij($type , 'accent$number' );
!     # shige 01/18 2002
!     &accent_safe_for_ij($type , "accent$number" );
      $_;
  }
  
***************
*** 15529,15535 ****
      $delim = '%:%';		# Delimits items of sectioning information
  				# stored in a string
  
!     $LATEX2HTML_META = '<META NAME="Generator" CONTENT="LaTeX2HTML v'.$TEX2HTMLV_SHORT.'">'
  	. "\n<META HTTP-EQUIV=\"Content-Style-Type\" CONTENT=\"text/css\">"
  	      unless ($LATEX2HTML_META);
  
--- 15631,15637 ----
      $delim = '%:%';		# Delimits items of sectioning information
  				# stored in a string
  
!     $LATEX2HTML_META = '<META NAME="Generator" CONTENT="jLaTeX2HTML v'.$JTEX2HTMLV_SHORT.'">'
  	. "\n<META HTTP-EQUIV=\"Content-Style-Type\" CONTENT=\"text/css\">"
  	      unless ($LATEX2HTML_META);
  
***************
*** 15621,15628 ****
      print ($HTML_OPTIONS ? "with $HTML_OPTIONS extensions\n\n\n" : "\n\n\n");
  
      # load the character defs for latin-1, but don't set the charset yet
!     &do_require_extension('latin1');
!     $charset = $CHARSET = $PREV_CHARSET = '';
  
      if ($HTML_VERSION =~ /(2.0|3.0|3.2|4.0|4.1)/) {
  	# Require the version specific file 
--- 15723,15738 ----
      print ($HTML_OPTIONS ? "with $HTML_OPTIONS extensions\n\n\n" : "\n\n\n");
  
      # load the character defs for latin-1, but don't set the charset yet
!     # shige 09/25 2004; 11/05 2004; 12/09 2004
!     {
! 	local($save_charset) = '';
! 	$save_charset=$CHARSET 
! 	    if $CHARSET =~ /(iso[-_]2022[-_]jp|EUC[-_]JP|Shift[-_]JIS|UTF[-_]8)/;
! 	&do_require_extension('latin1');
! 	#$charset = $CHARSET = $PREV_CHARSET = '';
! 	$charset = $CHARSET = $PREV_CHARSET = $save_charset;
! 	undef $save_charset;
!     }
  
      if ($HTML_VERSION =~ /(2.0|3.0|3.2|4.0|4.1)/) {
  	# Require the version specific file 
***************
*** 15874,15879 ****
--- 15984,15990 ----
  	 , 'spanish',	'spanish_translation'
  	 , 'swedish',	'swedish_translation'
  	 , 'turkish',	'turkish_translation'
+ 	 , 'japanese',	'japanese_translation'
  	);
  
  # Reiner: 
***************
*** 16484,16491 ****
  #    $enspair = "\\\\ensuremath\\s*$O(\\d+)$C([\\s\\S]*[\\\\\$&]+[\\s\\S]*)$O\\1$C";
  
      # Matches math comments, from  math.pl
!     $math_verbatim_rx = "$verbatim_mark#math(\\d+)#";
!     $mathend_verbatim_rx = "$verbatim_mark#mathend([^#]*)#";
  
      # Matches math array environments
      $array_env_rx = "array|cases|\\w*matrix";
--- 16595,16605 ----
  #    $enspair = "\\\\ensuremath\\s*$O(\\d+)$C([\\s\\S]*[\\\\\$&]+[\\s\\S]*)$O\\1$C";
  
      # Matches math comments, from  math.pl
!     #$math_verbatim_rx = "$verbatim_mark#math(\\d+)#";
!     #$mathend_verbatim_rx = "$verbatim_mark#mathend([^#]*)#";
!     # patch for mathend000# (002688.html)
!     $math_verbatim_rx = "$verbatim_mark#?math(\\d+)#";
!     $mathend_verbatim_rx = "$verbatim_mark#?mathend([^#]*)#";
  
      # Matches math array environments
      $array_env_rx = "array|cases|\\w*matrix";
diff -rcN latex2html-2008/prefs.pm l2h-2K8-jp1.10b2.9/prefs.pm
*** latex2html-2008/prefs.pm	Wed Sep 24 04:26:32 2008
--- l2h-2K8-jp1.10b2.9/prefs.pm	Fri Oct  3 15:02:19 2008
***************
*** 181,193 ****
--- 181,196 ----
  
  # the TeX executable
  $prefs{'TEX'} = 'tex';
+ $prefs{'PTEX'} = 'ptex';
  
  # the LaTeX executable
  # needed for image generation
  $prefs{'LATEX'} = 'latex';
+ $prefs{'PLATEX'} = 'platex';
  
  # the initex executable
  $prefs{'INITEX'} = 'initex';
+ $prefs{'INIPTEX'} = 'iniptex';
  
  # the kpsewhich (part of Web2C) executable. If it is found, we have
  # Web2C
***************
*** 210,223 ****
  $prefs{'MKTEXLSR'} = 'mktexlsr,texhash,MakeTeXlsR';
  
  # The dvips executable and its features. dvips32 added for OS/2
! $prefs{'DVIPS'} = 'dvips,dvi2ps,dvips32';
  
  # Many options can be used with dvips to produce better quality images
  # or speed-up other aspects of image-generation.
  # $prefs{'DVIPSOPT'} = ' -E';  # create encapsulated (EPS) images
  # $prefs{'DVIPSOPT'} = ' -Ppdf'; # use Type 1 fonts, as for PDF
  # $prefs{'DVIPSOPT'} = ' -Pcmz -Pamz'; # use CM and AMS Type 1 fonts
! $prefs{'DVIPSOPT'} = ' -Ppdf';
  
  # set this to 1 if you want dvips to create special fonts for better
  # image generation. You need to set the following two items to correct
--- 213,227 ----
  $prefs{'MKTEXLSR'} = 'mktexlsr,texhash,MakeTeXlsR';
  
  # The dvips executable and its features. dvips32 added for OS/2
! $prefs{'DVIPS'} = 'pdvips,dvips,dvi2ps,dvips32';
  
  # Many options can be used with dvips to produce better quality images
  # or speed-up other aspects of image-generation.
  # $prefs{'DVIPSOPT'} = ' -E';  # create encapsulated (EPS) images
  # $prefs{'DVIPSOPT'} = ' -Ppdf'; # use Type 1 fonts, as for PDF
  # $prefs{'DVIPSOPT'} = ' -Pcmz -Pamz'; # use CM and AMS Type 1 fonts
! #$prefs{'DVIPSOPT'} = ' -Ppdf';
! $prefs{'DVIPSOPT'} = ' -E';
  
  # set this to 1 if you want dvips to create special fonts for better
  # image generation. You need to set the following two items to correct
***************
*** 399,404 ****
--- 403,413 ----
  # The names of HTML validators to look for on the system. Note: These
  # tools should accept a single HTML filename as argument.
  $prefs{'HTML_VALIDATOR'} = 'html4-check';
+ 
+ # For Japanese:
+ $prefs{'NKF'} = 'nkf';
+ # $prefs{'TONATIVE'} = "|$nkf -s";
+ # $prefs{'FROMNATIVE'} = "$nkf -e";
  
  ###########################################
  # no need to edit anything below this line
diff -rcN latex2html-2008/pstoimg.pin l2h-2K8-jp1.10b2.9/pstoimg.pin
*** latex2html-2008/pstoimg.pin	Wed Sep 24 04:41:54 2008
--- l2h-2K8-jp1.10b2.9/pstoimg.pin	Fri Oct  3 15:02:19 2008
***************
*** 316,321 ****
--- 316,322 ----
  #fi
  #if @PPMQUANT@
  my $PPMQUANT = '@PPMQUANT@';
+ my $PPMQUANTOPT = '@PPMQUANTOPT@';
  #fi
  #-
  #if @PNMFLIP@
***************
*** 880,886 ****
    if($opt{depth} == 1) { 
      $gs_aalias = '-dTextAlphaBits=4 ';
  #if @PPMQUANT@
!     $reduce_color = "$PPMQUANT -floyd 256";
  #fi
      }
    else {
--- 881,887 ----
    if($opt{depth} == 1) { 
      $gs_aalias = '-dTextAlphaBits=4 ';
  #if @PPMQUANT@
!     $reduce_color = "$PPMQUANT $PPMQUANTOPT 256";
  #fi
      }
    else {
***************
*** 891,897 ****
    $GSDEVICE = $GSALIASDEVICE;
      $gs_aalias = '-dTextAlphaBits=4 ';
  #if @PPMQUANT@
!     $reduce_color = "$PPMQUANT -floyd 256";
  #fi
    }
  #fi
--- 892,898 ----
    $GSDEVICE = $GSALIASDEVICE;
      $gs_aalias = '-dTextAlphaBits=4 ';
  #if @PPMQUANT@
!     $reduce_color = "$PPMQUANT $PPMQUANTOPT 256";
  #fi
    }
  #fi
***************
*** 1137,1143 ****
        }
      my $had_nonwhite;
      if($opt{white}) {
!       $had_nonwhite = ($ps =~ s/(\n\d+ \d+ bop gsave) \d*\.\d+ (TeXcolorgray clippath fill grestore)/$1 1 $2/s);
        }
      $ps_changed = $had_papersize || $had_nonwhite;
      if($ps_changed) {
--- 1138,1144 ----
        }
      my $had_nonwhite;
      if($opt{white}) {
!       $had_nonwhite = ($ps =~ s/(\d+ \d+ bop gsave) \d*\.\d+ (TeXcolorgray clippath fill grestore)/$1 1 $2/s);
        }
      $ps_changed = $had_papersize || $had_nonwhite;
      if($ps_changed) {
diff -rcN latex2html-2008/styles/ascmac.perl l2h-2K8-jp1.10b2.9/styles/ascmac.perl
*** latex2html-2008/styles/ascmac.perl	Thu Jan  1 09:00:00 1970
--- l2h-2K8-jp1.10b2.9/styles/ascmac.perl	Fri Oct  3 15:02:19 2008
***************
*** 0 ****
--- 1,74 ----
+ # ascmac.perl by Kouji KODAMA <kdm@kobe-kosen.ac.jp>
+ # copied from:
+ # ascmac.perl, version 3.0 1999/9/15
+ #
+ # ascmac.perl by Kenshi Muto <kmuto@debian.org>
+ 
+ # Implemented features:
+ #   Commands: \yen, \keytop{}, \return, \Return
+ #   Environments: screen, itembox, shadebox, boxnote
+ 
+ ### shadebox と boxnote はscreen のコピ−で手抜き. (kdm)
+ 
+ # Not implemented for the followings:
+ # \ascii, \Ascii, \ASCII, \mask,
+ # \Maskbox{width}{height}{mask_char}{pos}{rule_wid}{body},
+ # \maskbox{width}{height}{mask_char}{pos}{body}
+ 
+ sub do_cmd_yen { local($_) = @_; "￥$_"; }
+ sub do_cmd_keytop{
+ 	local($_)=@_;
+ 	s/$next_pair_pr_rx//o; local($key)=&translate_commands($2);
+ 	"[".$key."]".$_;
+ }
+ sub do_cmd_return {
+   local($_) = @_;
+   if ($HTML_VERSION < 4.0) {
+     "[Enter]$_";
+   } else {
+     "<SPAN STYLE=\"border-width: thin; border-style: solid\">Enter</SPAN>$_";
+   }
+ }
+ sub do_cmd_Return {
+   local($_) = @_;
+   if ($HTML_VERSION < 4.0) {
+     "[Enter]$_";
+   } else {
+     "<SPAN STYLE=\"border-width: thin; border-style: solid\">Enter</SPAN>$_";
+   }
+ }
+ sub do_env_screen {
+   if ($HTML_VERSION < 4.0) {
+     join('',"<TABLE BORDER=\"1\"><TR><TD>","@_","</TD></TR></TABLE>");
+   } else {
+     join('',"<DIV STYLE=\"border: inset blue; background-color: white\">","@_","</DIV>")
+   }
+ }
+ sub do_env_shadebox{
+   if ($HTML_VERSION < 4.0) {
+     join('',"<TABLE BORDER=\"1\"><TR><TD>","@_","</TD></TR></TABLE>");
+   } else {
+     join('',"<DIV STYLE=\"border: inset blue; background-color: white\">","@_","</DIV>")
+   }
+ }
+ sub do_env_boxnote{
+   if ($HTML_VERSION < 4.0) {
+     join('',"<TABLE BORDER=\"1\"><TR><TD>","@_","</TD></TR></TABLE>");
+   } else {
+     join('',"<DIV STYLE=\"border: inset blue; background-color: white\">","@_","</DIV>")
+   }
+ }
+ sub do_env_itembox {
+    local($_) = @_; local($title) = '';
+    $title = &missing_braces unless
+      ((s/$next_pair_rx/$title=$2;''/e) ||
+       (s/$next_pair_pr_rx/$title=$2;''/e));
+    $_ = &translate_environments($_);
+    if ($HTML_VERSION < 4.0) {
+      join('',"<TABLE BORDER=\"1\"><TR><TD>$title</TD></TR>","<TR><TD>$_\n</TD></TR></TABLE>\n");
+    } else {
+      join('',"<TABLE STYLE=\"border: sold; background-color: lime\"><TR><TH STYLE=\"background-color: green\">$title</TH></TR>","<TR><TD>$_\n</TD></TR></TABLE>\n");
+    }
+  }
+ 
+ 1; # end
diff -rcN latex2html-2008/styles/japanese.perl l2h-2K8-jp1.10b2.9/styles/japanese.perl
*** latex2html-2008/styles/japanese.perl	Thu Jan  1 09:00:00 1970
--- l2h-2K8-jp1.10b2.9/styles/japanese.perl	Fri Oct  3 16:26:11 2008
***************
*** 0 ****
--- 1,149 ----
+ # japanese.perl, version 3.0 1999/9/15
+ # japanese.perl, for latex2html 2K.1beta + ja 1.0 2001/06/25
+ # japanese.perl, l2h-2K21-jp1.10b2.7 2006/11/04
+ #
+ # japanese.perl by Kenshi Muto <kmuto@debian.org>
+ # modified by Shigeharu TAKENO <shige@iee.niit.ac.jp>
+ # 
+ 
+ package japanese;
+ 
+ print " [japanese]";
+ 
+ sub main'japanese_translation { #'
+     @_[0];
+ }
+ 
+ package main;
+ 
+ sub japanese_titles {
+     $toc_title = "目次";
+     $lof_title = "図目次";
+     $lot_title = "表目次";
+     $idx_title = "索引";
+     $bib_title = "参考文献";
+     $abs_title = "概要";
+     $fig_name  = "図";
+     $tab_name  = "表";
+     $info_title = "この文書について..."; 
+     @japanese_Month1 = ('', '1月', '2月', '3月', '4月', '5月',
+ 		       '6月', '7月', '8月', '9月', '10月',
+ 		       '11月', '12月');
+     @japanese_Month2 = ('', '睦月', '如月', '弥生', '卯月', '皐月',
+ 			'水無月', '文月', '葉月', '長月', '神無月',
+ 			'霜月', '師走');
+     @japanese_Month3 = ('', '孟春', '仲春', '季春', '孟夏', '仲夏',
+ 			'季夏', '孟秋', '仲秋', '季秋', '孟冬',
+ 			'仲冬', '季冬');
+     @Month = @japanese_Month1;
+     if ( defined $JAPANESEMONTHNAME ){
+ 	if ( $JAPANESEMONTHNAME == 1 ) { 
+ 	    @Month = @japanese_Month1;
+ 	} elsif ( $JAPANESEMONTHNAME == 2 ) {
+ 	    @Month = @japanese_Month2;
+ 	} elsif ( $JAPANESEMONTHNAME == 3 ) {
+ 	    @Month = @japanese_Month3;
+ 	}
+     }
+ }
+ 
+ sub japanese_infopage {
+     local($_) = @_;
+     local($argv) = $argv;
+     if (-f "../$argv") { $argv = &make_href ("../$argv", $argv, ); }
+     $_ = (($INFO == 1)
+       ? join('', "<STRONG>$t_title</STRONG><P>\nこの文書は"
+         , "<A HREF=\"$TEX2HTMLADDRESS\"><STRONG>LaTeX</STRONG>2<tt>HTML</tt></A> 翻訳プログラム Version $TEX2HTMLVERSION\n"
+         , "<P>Copyright &#169; 1993, 1994, 1995, 1996,\n"
+         , "<A HREF=\"$AUTHORADDRESS\">Nikos Drakos</A>, \n"
+         , "Computer Based Learning Unit, University of Leeds,\n"
+         , "<BR>Copyright &#169; 1997, 1998, 1999,\n"
+         , "<A HREF=\"$AUTHORADDRESS2\">Ross Moore</A>, \n"
+         , "Mathematics Department, Macquarie University, Sydney.\n"
+         , "<P>を<A HREF=\"$JTEX2HTMLADDRESS\">日本語化したもの</A>(
+ $JTEX2HTMLVERSION 版)\n"
+         , "<P>Copyright &#169; 1998, 1999,\n"
+         , "<A HREF=\"$JAUTHORADDRESS\">Kenshi Muto</A>, \n"
+         , "Debian Project.\n"
+ 	, "<BR>Copyright &#169; 2001, 2002, 2003, 2004, 2005, 2006, 2008,\n"
+ 	, "<A HREF=\"$JAUTHORADDRESS2\">Shige TAKENO</A>, \n"
+ 	, "Niigata Inst.Tech.\n"
+         , "<P>を用いて生成されました。\n"
+         , "<P>コマンド行は以下の通りでした。: <BR>\n "
+         , "<STRONG>latex2html</STRONG> <tt>$argv</tt>.\n"
+         , (($SHOW_INIT_FILE && ($INIT_FILE ne ''))?
+ 	   "\n<P>初期化ファイル: <TT>$INIT_FILE</TT>\n$init_file_mark\n" :'')
+         , "<P>翻訳は $address_data[0] によって $address_data[1] に実行されました。"
+ 	, $open_all, $_)
+    : join('', $close_all, $INFO,"\n", $open_all, $_));
+    $_;
+ }
+ 
+ sub japanese_today {
+     local($today); 
+     if ( 1 ) { # オリジナルの get_date() を使うなら
+ 	local($m,$d,$y) = split(/\//,&get_date());
+ 	if ( $y < 1989 || $USEJAPANESESEIREKI ) { # 西暦
+ 	    $y = "$y年"; 
+ 	} else { # 平成のみ元号対応
+ 	    $y -= 1988; 
+ 	    $y = "元" if $y == 1; 
+ 	    $y = "平成$y年"; 
+ 	} 
+ 	$today = "$y$Month[$m]$d日";
+     } else { # 武藤さんの get_date() を使うなら
+ 	$today = &get_date();
+     }
+     join('',$today,$_[0]);
+ }
+ 
+ #sub get_date {
+ #        #平成のみ対応
+ #    local($format,$order) = @_;
+ #    local(@lt) = localtime;
+ #    local($d,$m,$y) = @lt[3,4,5];
+ #        $y += 1900;
+ #        $y -= 1988;
+ #        if ($y == 1) {
+ #                $y = "元";
+ #        } else {
+ #                $y .= "";
+ #        }
+ #        sprintf("平成%s年%s%d日", $y, @Month[$m+1], $d);
+ #}
+ #if (defined &address_data) {
+ #  @address_data = &address_data('ISO');
+ #  $ADDRESS = "$address_data[0]\n$address_data[1]";
+ #}
+ 
+ if ( defined &english_titles ) { &english_titles; }
+ &japanese_titles;
+ $default_language = 'japanese';
+ $TITLES_LANGUAGE = 'japanese';
+ # $ISO_LANGUAGE = 'JA';
+ if ( $REQUIRE_LANGUAGE eq 'euc' ) {
+     $charset = $CHARSET = 'EUC-JP';
+     $japanese_encoding = 'EUC-JP';
+     $TOHTML = "| nkf -e";
+ } elsif ( $REQUIRE_LANGUAGE eq 'sjis' ) {
+     $charset = $CHARSET = 'Shift_JIS';
+     $japanese_encoding = 'Shift_JIS';
+     $TOHTML = "| nkf -s";
+     # $TOHTML = "| nkf -s -Lw";
+ } elsif ( $REQUIRE_LANGUAGE eq 'jutf' ) {
+     $charset = $CHARSET = 'UTF-8';
+     $japanese_encoding = 'UTF-8';
+     $TOHTML = "| nkf -w";
+ } else { # 'jis'
+     $charset = $CHARSET = 'iso-2022-jp';
+     $japanese_encoding = 'iso-2022-jp';
+     $TOHTML = "| nkf -j";
+ }
+ 
+ if ( $USEBOTTOMLOCALDATE ) {
+     # @address_data = &address_data('ISO');
+     $address_data[1]=&japanese_today();
+     $ADDRESS = "$address_data[0]\n$address_data[1]";
+ }
+ 
+ 1;
diff -rcN latex2html-2008/styles/more_amsmath.perl l2h-2K8-jp1.10b2.9/styles/more_amsmath.perl
*** latex2html-2008/styles/more_amsmath.perl	Fri Nov 29 20:49:18 2002
--- l2h-2K8-jp1.10b2.9/styles/more_amsmath.perl	Fri Oct  3 15:02:19 2008
***************
*** 30,42 ****
  sub do_htmlmath_array {
      local($colspec) = @_;
      if (defined &do_env_array) {
! 	join('', $comment, "<P ALIGN=\"CENTER\">$sbig"
! 	    , $labels, "\n<MATH CLASS=\"EQNARRAY\">"
! 	    , &do_env_array("$O$max_id${C}$colspec$O$max_id$C$_")
! 	    , "</MATH>\n$ebig</P>" )
      } else {
! 	join('', $comment, '<P ALIGN="CENTER">', $labels,
! 	    , &process_undefined_environment($env, $id , $_),'</P>')
      }
  }
  
--- 30,57 ----
  sub do_htmlmath_array {
      local($colspec) = @_;
      if (defined &do_env_array) {
! 	# shige 11/02 2006
! 	if ($USEFLEQNINDENT && $FLUSH_EQN) {	
! 	    join('', $comment, "<blockquote>$sbig"
! 		 , $labels, "\n<MATH CLASS=\"EQNARRAY\">"
! 		 , &do_env_array("$O$max_id${C}$colspec$O$max_id$C$_")
! 		 , "</MATH>\n$ebig</blockquote>" );
! 	} else {
! 	    join('', $comment, "<P ALIGN=\"CENTER\">$sbig"
! 		 , $labels, "\n<MATH CLASS=\"EQNARRAY\">"
! 		 , &do_env_array("$O$max_id${C}$colspec$O$max_id$C$_")
! 	     , "</MATH>\n$ebig</P>" );
! 	}
      } else {
! 	# shige 11/02 2006
! 	if ($USEFLEQNINDENT && $FLUSH_EQN) {	
! 	    join('', $comment, '<blockquote>', $labels,
! 		 , &process_undefined_environment($env, $id , $_)
! 		 , '</blockquote>');
! 	} else {
! 	    join('', $comment, '<P ALIGN="CENTER">', $labels,
! 		 , &process_undefined_environment($env, $id , $_),'</P>');
! 	}
      }
  }
  
***************
*** 95,100 ****
--- 110,117 ----
  	}
      } else { $tag = ';SPMnbsp;;SPMnbsp;;SPMnbsp;' }
      $*=0;
+     # shige 10/01 2004
+     $scan =~ s/($comment_mark\d+) /$1\n/g;
      if ($labels) {
  	$labels =~ s/$anchor_mark/$tag/o;
  	($labels , $scan);
***************
*** 113,128 ****
  }
  
  sub start_math_display {
!     join(''
! #	, (($border||($attribs)||!($outer_math))? '': "<P></P>")
! 	, ((($doimage)||!($outer_math))? '': "\n<DIV$math_class>")
! 	, (($labels)? $labels : '') , $comment
! 	, @_ );
  }
  
  sub end_math_display {
!     join('', @_ , ((($doimage)||!($outer_math))? '' : 
! 	"</DIV>\n<BR CLEAR=\"ALL\">" ));
  }
  
  sub embed_display {
--- 130,160 ----
  }
  
  sub start_math_display {
!     # shige 11/02 2006
!     if ($USEFLEQNINDENT && $FLUSH_EQN && $EQN_TAGS =~ /R/) {
! 	join(''
! #	     , (($border||($attribs)||!($outer_math))? '': "<P></P>")
! 	     , ((($doimage)||!($outer_math))? '': "\n<blockquote>")
! 	     , (($labels)? $labels : '') , $comment
! 	     , @_ );
!     } else {
! 	join(''
! #	     , (($border||($attribs)||!($outer_math))? '': "<P></P>")
! 	     , ((($doimage)||!($outer_math))? '': "\n<DIV$math_class>")
! 	     , (($labels)? $labels : '') , $comment
! 	     , @_ );
!     }
  }
  
  sub end_math_display {
!     # shige 11/02 2006
!     if ($USEFLEQNINDENT && $FLUSH_EQN && $EQN_TAGS =~ /R/) {
! 	join('', @_ , ((($doimage)||!($outer_math))? '' : 
! 		       "</blockquote>\n<br clear=\"all\">" ));
!     } else {
! 	join('', @_ , ((($doimage)||!($outer_math))? '' : 
! 		       "</DIV>\n<BR CLEAR=\"ALL\">" ));
!     }
  }
  
  sub embed_display {
***************
*** 134,142 ****
  
      # at the outermost level
      if (($border)||($attribs)) {
! 	join('',"<BR>\n<DIV$math_class>\n"
! 	    , &make_table( $border, $attribs, '', '', '', @_ )
! 	    , "\n<BR CLEAR=\"ALL\">");
      } else { join('', "<P></P>", @_ , "<P></P>") }
  }
  
--- 166,181 ----
  
      # at the outermost level
      if (($border)||($attribs)) {
! 	# shige 11/02 2006
! 	if ($USEFLEQNINDENT && $FLUSH_EQN) {
! 	    join('',"\n<blockquote>\n"
! 		 , &make_table( $border, $attribs, '', '', '', @_ )
! 		 , "\n</blockquote><br clear=\"all\">");
! 	} else {
! 	    join('',"<BR>\n<DIV$math_class>\n"
! 		 , &make_table( $border, $attribs, '', '', '', @_ )
! 		 , "\n<BR CLEAR=\"ALL\">"); # </DIV> ?
! 	}
      } else { join('', "<P></P>", @_ , "<P></P>") }
  }
  
***************
*** 216,222 ****
  	$_ = &process_undefined_environment($this_env, $id, $saved);
  	$falign = (($EQN_TAGS =~ /L/)? 'LEFT' : 'RIGHT') if $numbered;
  	local($fsdisplay,$fedisplay) = ($spdisplay,$epdisplay);
! 	if (!($fsdisplay =~ s/(ALIGN\s*=\s*\")[^\"]*\"/$1$falign\"/)) {
  	    $fsdisplay .= "<DIV$env_id ALIGN=\"$falign\">";
  	    $fedisplay = '</DIV>'.$epdisplay;
  	}
--- 255,271 ----
  	$_ = &process_undefined_environment($this_env, $id, $saved);
  	$falign = (($EQN_TAGS =~ /L/)? 'LEFT' : 'RIGHT') if $numbered;
  	local($fsdisplay,$fedisplay) = ($spdisplay,$epdisplay);
! 	# shige 11/02 2006
! 	if ($USEFLEQNINDENT && $FLUSH_EQN) {
! 	    if (!$numbered || $EQN_TAGS =~ /R/) {
! 		$fsdisplay .= "<blockquote>";
! 		$fedisplay = "</blockquote><br clear=\"all\">";
! 	    } else {
! 		$fsdisplay .= "<div$env_id align=\"$falign\">";
! 		$fedisplay = "</div>".$epdisplay;
! 	    }
! 	}
! 	elsif (!($fsdisplay =~ s/(ALIGN\s*=\s*\")[^\"]*\"/$1$falign\"/)) {
  	    $fsdisplay .= "<DIV$env_id ALIGN=\"$falign\">";
  	    $fedisplay = '</DIV>'.$epdisplay;
  	}
***************
*** 299,305 ****
  		}
  	    }
  	    if ($thismath ne '') {
! 	        $return .= join('', $calign
  		    , (($thismath =~ /^$smarray/)? $thismath
  			: $sbig . $thismath . $ebig )
  		    , $ecell);
--- 348,357 ----
  		}
  	    }
  	    if ($thismath ne '') {
! #	        $return .= join('', $calign
! 		# shige 11/02 2006
! 	        $return .= join('' 
! 		    , (($USEFLEQNINDENT && $FLUSH_EQN)? $emtag : $calign)
  		    , (($thismath =~ /^$smarray/)? $thismath
  			: $sbig . $thismath . $ebig )
  		    , $ecell);
***************
*** 353,359 ****
  		'multline'.(($numbered) ? '':"*"), $id, $saved);
  	$falign = (($EQN_TAGS =~ /L/)? 'LEFT' : 'RIGHT') if $numbered;
  	local($fsdisplay,$fedisplay) = ($spdisplay,$epdisplay);
! 	if (!($fsdisplay =~ s/(ALIGN\s*=\s*\")[^\"]*\"/$1$falign\"/)) {
  	    $fsdisplay .= "<DIV ALIGN=\"$falign\">";
  	    $fedisplay = '</DIV>'.$epdisplay;
  	}
--- 405,421 ----
  		'multline'.(($numbered) ? '':"*"), $id, $saved);
  	$falign = (($EQN_TAGS =~ /L/)? 'LEFT' : 'RIGHT') if $numbered;
  	local($fsdisplay,$fedisplay) = ($spdisplay,$epdisplay);
! 	# shige 11/02 2006
! 	if ($USEFLEQNINDENT && $FLUSH_EQN) {
! 	    if (!$numbered || $EQN_TAGS =~ /R/) {
! 		$fsdisplay .= "<blockquote>";
! 		$fedisplay = "</blockquote><br clear=\"all\">";
! 	    } else {
! 		$fsdisplay .= "<div align=\"$falign\">";
! 		$fedisplay = "</div>".$epdisplay;
! 	    }
! 	}
! 	elsif (!($fsdisplay =~ s/(ALIGN\s*=\s*\")[^\"]*\"/$1$falign\"/)) {
  	    $fsdisplay .= "<DIV ALIGN=\"$falign\">";
  	    $fedisplay = '</DIV>'.$epdisplay;
  	}
***************
*** 439,445 ****
  		    , $thismath) unless ( $thismath eq '' );
  	    }
  	    if ($thismath ne '') {
! 	        $return .= join('', $calign
  		    , (($row_cnt == 1)? $mspace.$mspace : '')
  		    , (($thismath=~/^$smarray/)? $thismath
  			    : $sbig.$thismath.$ebig )
--- 501,510 ----
  		    , $thismath) unless ( $thismath eq '' );
  	    }
  	    if ($thismath ne '') {
! #	        $return .= join('', $calign
! 		# shige 11/02 2006
! 	        $return .= join('' 
! 		    , (($USEFLEQNINDENT && $FLUSH_EQN)? $emtag  : $calign)
  		    , (($row_cnt == 1)? $mspace.$mspace : '')
  		    , (($thismath=~/^$smarray/)? $thismath
  			    : $sbig.$thismath.$ebig )
***************
*** 655,661 ****
  
  	$falign = (($EQN_TAGS =~ /L/)? 'LEFT' : 'RIGHT') if $numbered;
  	local($fsdisplay,$fedisplay) = ($spdisplay,$epdisplay);
! 	if (!($fsdisplay =~ s/(ALIGN\s*=\s*\")[^\"]*\"/$1$falign\"/)) {
  	    $fsdisplay .= "<DIV ALIGN=\"$falign\">";
  	    $fedisplay = '</DIV>'.$epdisplay;
  	}
--- 720,736 ----
  
  	$falign = (($EQN_TAGS =~ /L/)? 'LEFT' : 'RIGHT') if $numbered;
  	local($fsdisplay,$fedisplay) = ($spdisplay,$epdisplay);
! 	# shige 11/02 2006
! 	if ($USEFLEQNINDENT && $FLUSH_EQN) {
! 	    if (!$numbered || $EQN_TAGS =~ /R/) {
! 		$fsdisplay .= "<blockquote>";
! 		$fedisplay = "</blockquote><br clear=\"all\">";
! 	    } else {
! 		$fsdisplay .= "<div align=\"$falign\">";
! 		$fedisplay = '</div>'.$epdisplay;
! 	    }
! 	}
! 	elsif (!($fsdisplay =~ s/(ALIGN\s*=\s*\")[^\"]*\"/$1$falign\"/)) {
  	    $fsdisplay .= "<DIV ALIGN=\"$falign\">";
  	    $fedisplay = '</DIV>'.$epdisplay;
  	}
***************
*** 859,865 ****
  		$outer_math.(($numbered) ? '':"*"), $id, $saved);
  	$falign = (($EQN_TAGS =~ /L/)? 'LEFT' : 'RIGHT') if $numbered;
  	local($fsdisplay,$fedisplay) = ($spdisplay,$epdisplay);
! 	if (!($fsdisplay =~ s/(ALIGN\s*=\s*\")[^\"]*\"/$1$falign\"/)) {
  	    $fsdisplay .= "<DIV ALIGN=\"$falign\">";
  	    $fedisplay = '</DIV>'.$epdisplay;
  	}
--- 934,950 ----
  		$outer_math.(($numbered) ? '':"*"), $id, $saved);
  	$falign = (($EQN_TAGS =~ /L/)? 'LEFT' : 'RIGHT') if $numbered;
  	local($fsdisplay,$fedisplay) = ($spdisplay,$epdisplay);
! 	# shige 11/02 2006
! 	if ($USEFLEQNINDENT && $FLUSH_EQN) {
! 	    if (!$numbered || $EQN_TAGS =~ /R/) {
! 		$fsdisplay .= "<blockquote>";
! 		$fedisplay = "</blockquote><br clear=\"all\">";
! 	    } else {
! 		$fsdisplay .= "<div align=\"$falign\">";
! 		$fedisplay = '</div>'.$epdisplay;
! 	    }
! 	}
! 	elsif (!($fsdisplay =~ s/(ALIGN\s*=\s*\")[^\"]*\"/$1$falign\"/)) {
  	    $fsdisplay .= "<DIV ALIGN=\"$falign\">";
  	    $fedisplay = '</DIV>'.$epdisplay;
  	}
diff -rcN latex2html-2008/styles/psfrag.perl l2h-2K8-jp1.10b2.9/styles/psfrag.perl
*** latex2html-2008/styles/psfrag.perl	Fri Nov 29 20:49:18 2002
--- l2h-2K8-jp1.10b2.9/styles/psfrag.perl	Fri Oct  3 15:02:19 2008
***************
*** 24,31 ****
  _RAW_ARG_CMDS_
  
  &process_commands_nowrap_in_tex (<<_RAW_ARG_CMDS_);
! psfragstar # {} # {}
! psfrag # {} # {}
  _RAW_ARG_CMDS_
  
  
--- 24,31 ----
  _RAW_ARG_CMDS_
  
  &process_commands_nowrap_in_tex (<<_RAW_ARG_CMDS_);
! psfragstar # {} # [] # [] # [] # [] # {}
! psfrag # {} # [] # [] # [] # [] # {}
  _RAW_ARG_CMDS_
  
  
diff -rcN latex2html-2008/texexpand.pin l2h-2K8-jp1.10b2.9/texexpand.pin
*** latex2html-2008/texexpand.pin	Sat Jan  3 15:14:59 2004
--- l2h-2K8-jp1.10b2.9/texexpand.pin	Fri Oct  3 15:02:19 2008
***************
*** 411,417 ****
  my %opt = ();
  unless(GetOptions(\%opt, qw(-help -version -debug -verbose -w
       -do_include=s@ -dont_include=s@ -auto_exclude -unsegment
!      -save_styles=s -texinputs=s@ -output=s -out=s))) {
    die "$prompt Error: Invalid option(s) specified.\n";
  }
  
--- 411,418 ----
  my %opt = ();
  unless(GetOptions(\%opt, qw(-help -version -debug -verbose -w
       -do_include=s@ -dont_include=s@ -auto_exclude -unsegment
!      -save_styles=s -texinputs=s@ -output=s -out=s -ntrans=s))) {
!      # -save_styles=s -texinputs=s@ -output=s -out=s))) {
    die "$prompt Error: Invalid option(s) specified.\n";
  }
  
***************
*** 677,683 ****
      # Keep track of input/include level
      $includelevel++;
  
!     open(IN,"<$infile") || die "$prompt Cannot open $infile\n";
      print STDERR "$prompt %--- Processing $infile" if ($debug > 1);
  
      # if we don't include this file marker LaTeX2HTML won't split
--- 678,691 ----
      # Keep track of input/include level
      $includelevel++;
  
!     # shige 09/25 2004; 12/29 2004
!     if ( $opt{ntrans} ) { 
! 	open(IN,"$opt{ntrans} $infile |") || die "$prompt Cannot open $infile\n";
! 	print STDERR "\nntrans: $opt{ntrans}\n" if ($debug>1);
!     } else {
! 	open(IN,"<$infile") || die "$prompt Cannot open $infile\n";
! 	print STDERR "\nno ntrans\n" if ($debug>1);
!     }
      print STDERR "$prompt %--- Processing $infile" if ($debug > 1);
  
      # if we don't include this file marker LaTeX2HTML won't split
diff -rcN latex2html-2008/versions/html2_2.pl l2h-2K8-jp1.10b2.9/versions/html2_2.pl
*** latex2html-2008/versions/html2_2.pl	Fri Nov 29 20:49:19 2002
--- l2h-2K8-jp1.10b2.9/versions/html2_2.pl	Fri Oct  3 15:02:19 2008
***************
*** 91,97 ****
      ($pxs,$len);
  }
  # should no longer be needed, as this is defined in latex2html.pin
! if (undefined &convert_length) { sub convert_length {&convert_length_table(@_)} }
  
  # Translates LaTeX column specifications to HTML. Again, Netscape
  # needs some extra work with its width attributes in the <td> tags.
--- 91,97 ----
      ($pxs,$len);
  }
  # should no longer be needed, as this is defined in latex2html.pin
! if (!defined(&convert_length)) { sub convert_length {&convert_length_table(@_)} }
  
  # Translates LaTeX column specifications to HTML. Again, Netscape
  # needs some extra work with its width attributes in the <td> tags.
diff -rcN latex2html-2008/versions/html3_2.pl l2h-2K8-jp1.10b2.9/versions/html3_2.pl
*** latex2html-2008/versions/html3_2.pl	Fri Nov 29 20:49:19 2002
--- l2h-2K8-jp1.10b2.9/versions/html3_2.pl	Fri Oct  3 15:02:19 2008
***************
*** 1114,1131 ****
  	$_ = join('', $comment, $labels, $math_start, $_, $math_end );
      }
      if ($border||($attribs)) { 
! 	join('',"<BR>\n<DIV$math_class>\n"
! 	    , &make_table( $border, $attribs, '', '', '', $_ )
! 	    , "\n<BR CLEAR=\"ALL\">");
      } elsif ($failed) {
  	$falign = (($EQN_TAGS =~ /L/)? 'LEFT' : 'RIGHT') if ($eqno);
  	local($fclass) = $math_class;
! 	$fclass =~ s/(ALIGN=\")[^"]*/$1$falign/;
! 	join('',"<BR>\n<DIV$fclass>\n"
! 	    , $_ , "\n<BR CLEAR=\"ALL\"></DIV><P></P>")
      } else { 
! 	join('', "<BR><P></P>\n<DIV$math_class>\n"
! 	    , $_ ."\n</DIV><BR CLEAR=\"ALL\"><P></P>");
      }
  }
  
--- 1114,1166 ----
  	$_ = join('', $comment, $labels, $math_start, $_, $math_end );
      }
      if ($border||($attribs)) { 
!         # shige 10/24 2006
! 	if ($USEFLEQNINDENT && $FLUSH_EQN) {
! 	    if ($EQN_TAGS =~ /R/) {
! 		join('',"\n<blockquote>\n"
! 		     , &make_table( $border, $attribs, '', '', '', $_ )
! 		     , "\n</blockquote><br clear=\"all\">");
! 	    } else {
! 		join('',"<br>\n<div>\n"
! 		     , &make_table( $border, $attribs, '', '', '', $_ )
! 		     , "\n</div><br clear=\"all\">");
! 	    }
! 	} else {
! 	    join('',"<BR>\n<DIV$math_class>\n"
! 		 , &make_table( $border, $attribs, '', '', '', $_ )
! 		 , "\n</DIV><BR CLEAR=\"ALL\">");
! 	}
      } elsif ($failed) {
  	$falign = (($EQN_TAGS =~ /L/)? 'LEFT' : 'RIGHT') if ($eqno);
  	local($fclass) = $math_class;
! 	$fclass =~ s/(ALIGN=\")[^"]*/$1$falign/; #";
!         # shige 10/24 2006
! 	if ($USEFLEQNINDENT && $FLUSH_EQN) {
! 	    if ($EQN_TAGS =~ /R/) {
! 		join('',"\n<blockquote>\n"
! 		     , $_ , "\n</blockquote><br clear=\"all\">");
! 	    } else {
! 		join('',"<br>\n<div>\n"
! 		     , $_ , "\n<br clear=\"all\"></div><p></p>");
! 	    }
! 	} else {      			
! 	    join('',"<BR>\n<DIV$fclass>\n"
! 		 , $_ , "\n<BR CLEAR=\"ALL\"></DIV><P></P>");
! 	}
      } else { 
!         # shige 10/24 2006
! 	if ($USEFLEQNINDENT && $FLUSH_EQN) {
! 	    if ($EQN_TAGS =~ /R/) {
! 		join('', "\n<blockquote>\n"
! 		     , $_ ."\n</blockquote><br clear=\"all\">");
! 	    } else {
! 		join('', "<br><p></p>\n<div>\n"
! 		     , $_ ."\n</div><br clear=\"all\"><p></p>");
! 	    }
! 	} else {
! 	    join('', "<BR><P></P>\n<DIV$math_class>\n"
! 		 , $_ ."\n</DIV><BR CLEAR=\"ALL\"><P></P>");
! 	}
      }
  }
  
***************
*** 1151,1162 ****
  	$_ = (($comment.$labels)? "$comment$labels\n":'').$sbig.$_.$ebig;
      }
      if ($border||($attribs)) {
! 	join('',"<BR>\n<DIV$math_class>\n"
!             , &make_table( $border, $attribs, '', '', '', $_ )
! 	    , "</DIV>\n<BR CLEAR=\"ALL\">");
      } else { 
!         join('',"<BR><P></P>\n<DIV$math_class>",$_
!             ,"</DIV><BR CLEAR=\"ALL\">\n<P></P>");
      }
  }
  
--- 1186,1210 ----
  	$_ = (($comment.$labels)? "$comment$labels\n":'').$sbig.$_.$ebig;
      }
      if ($border||($attribs)) {
!         # shige 10/24 2006
! 	if ($USEFLEQNINDENT && $FLUSH_EQN) {
! 	    join('',"\n<blockquote>\n"
! 		 , &make_table( $border, $attribs, '', '', '', $_ )
! 		 , "\n</blockquote><br clear=\"all\">");
! 	} else {
! 	    join('',"<BR>\n<DIV$math_class>\n"
! 		 , &make_table( $border, $attribs, '', '', '', $_ )
! 		 , "</DIV>\n<BR CLEAR=\"ALL\">");
! 	}
      } else { 
!         # shige 10/24 2006
! 	if ($USEFLEQNINDENT && $FLUSH_EQN) {
! 	    join('',"\n<blockquote>",$_
! 		 ,"\n</blockquote><br clear=\"all\">");
! 	} else {
! 	    join('',"<BR><P></P>\n<DIV$math_class>",$_
! 		 ,"</DIV><BR CLEAR=\"ALL\">\n<P></P>");
! 	}
      }
  }
  
***************
*** 1190,1197 ****
  		"eqnarray".(($no_eqn_numbers) ? "star" : '')
  		, $id, $saved));
  	local($fclass) = $math_class;
! 	$fclass =~ s/(ALIGN=\")[^"]*/$1$falign/;
! 	$_ = join('',"<P></P><DIV$fclass>", $_, "</DIV>\n");
      } else {
  	$failed = 0;
  	s/$htmlimage_rx/$doimage = $&;''/eo ; # force an image
--- 1238,1251 ----
  		"eqnarray".(($no_eqn_numbers) ? "star" : '')
  		, $id, $saved));
  	local($fclass) = $math_class;
! 	$fclass =~ s/(ALIGN=\")[^"]*/$1$falign/; #"]
! 	# shige 10/24 2006
! 	#$_ = join('',"<P></P><DIV$fclass>", $_, "</DIV>\n");
!         if ($USEFLEQNINDENT && $FLUSH_EQN) {
! 	    $_ = join('',"<blockquote>", $_, "</blockquote>\n");
! 	} else {
! 	    $_ = join('',"<P></P><DIV$fclass>", $_, "</DIV>\n");
! 	}
      } else {
  	$failed = 0;
  	s/$htmlimage_rx/$doimage = $&;''/eo ; # force an image
***************
*** 1202,1207 ****
--- 1256,1265 ----
  	    , "</TD>\n<TD ALIGN=\"CENTER\" NOWRAP>"
  	    , "</TD>\n<TD ALIGN=\"LEFT\" NOWRAP>"
  	    , "</TD></TR>", "\n</TABLE>", "</TD>\n<TD>" );
+ 	# shige 10/24 2006
+         # if ($USEFLEQNINDENT && ! $FLUSH_EQN) {
+ 	#    $srcell = "</TD>\n<TD ALIGN=\"LEFT\" WIDTH=\"50%\" NOWRAP>";
+ 	#}
  	$sarray .= (($no_eqn_numbers) ? ">" :  " WIDTH=\"100%\">" );
  	local($seqno) = join('',"\n<TD$eqno_class WIDTH=10 ALIGN=\""
  		, (($EQN_TAGS =~ /L/)? 'LEFT': 'RIGHT')
***************
*** 1210,1219 ****
--- 1268,1285 ----
  	    ($srow, $slcell, $ercell) = (
  		"\n<TR$valign>" . $seqno
  		, "</TD>\n<TD NOWRAP ALIGN=", '');
+ 	    # shige 10/24 2006
+ 	    #if ($USEFLEQNINDENT && ! $FLUSH_EQN) {
+ 	    #	$slcell = "</TD>\n<TD NOWRAP WIDTH=\"50%\" ALIGN=";
+ 	    #}
  	} else { # equation number on right
  	    ($srow, $slcell, $ercell) = ("\n<TR$valign>"
  		, "<TD NOWRAP ALIGN="
  		, '</TD>'. $seqno );
+ 	    # shige 10/24 2006
+ 	    #if ($USEFLEQNINDENT && ! $FLUSH_EQN) {
+ 	    #    $slcell = "<TD NOWRAP WIDTH=\"50%\" ALIGN=";
+ 	    #}
  	}
  
  	$_ = &protect_array_envs($_);
***************
*** 1395,1406 ****
      } elsif ($failed) {
  	$_ =~ s/^[ \t]*\n?/\n/; 
  	$_ =~ s/\n?[ \t]*/\n/;
! 	join('', "<BR><P></P>\n<DIV$math_class>"
! 	    , $_ ,"\n</DIV><P></P><BR CLEAR=\"ALL\">");
      } elsif ($_ =~ s!(</TABLE></DIV>)\s*(<BR[^>]*><P></P>)?\s*$!$1!si) {
  	join('', $_ ,"<BR>\n");
      } elsif ($_ =~ m!<P></P>\s*$!si) { # below-display space present 
! 	$_
      } else {
  	join('', $_ ,"<BR CLEAR=\"ALL\"><P></P>");
      }
--- 1461,1478 ----
      } elsif ($failed) {
  	$_ =~ s/^[ \t]*\n?/\n/; 
  	$_ =~ s/\n?[ \t]*/\n/;
! 	# shige 10/24 2006
! 	if ($USEFLEQNINDENT && $FLUSH_EQN) {
! 	    join('', "\n<blockquote>\n"
! 		 , $_ ,"\n</blockquote><br clear=\"all\">");
! 	} else {
! 	    join('', "<BR><P></P>\n<DIV$math_class>"
! 		 , $_ ,"\n</DIV><P></P><BR CLEAR=\"ALL\">");
! 	}
      } elsif ($_ =~ s!(</TABLE></DIV>)\s*(<BR[^>]*><P></P>)?\s*$!$1!si) {
  	join('', $_ ,"<BR>\n");
      } elsif ($_ =~ m!<P></P>\s*$!si) { # below-display space present 
! 	$_;
      } else {
  	join('', $_ ,"<BR CLEAR=\"ALL\"><P></P>");
      }
diff -rcN latex2html-2008/versions/html4_0.pl l2h-2K8-jp1.10b2.9/versions/html4_0.pl
*** latex2html-2008/versions/html4_0.pl	Thu Jan  1 15:15:00 2004
--- l2h-2K8-jp1.10b2.9/versions/html4_0.pl	Sat Dec 20 20:51:05 2008
***************
*** 1477,1494 ****
  	$_ = join('', $comment, $labels, $math_start, $_, $math_end );
      }
      if ($border||($attribs)) { 
! 	join('',"<BR>\n<DIV$math_class>\n"
! 	    , &make_table( $border, $attribs, '', '', '', $_ )
! 	    , "\n<BR CLEAR=\"ALL\">");
      } elsif ($failed) {
  	$falign = (($EQN_TAGS =~ /L/)? 'LEFT' : 'RIGHT') if ($eqno);
  	local($fclass) = $math_class;
! 	$fclass =~ s/(ALIGN=\")[^"]*/$1$falign/;
! 	join('',"<BR>\n<DIV$fclass>\n"
! 	    , $_ , "\n<BR CLEAR=\"ALL\"></DIV><P></P>")
      } else { 
! 	join('', "<BR><P></P>\n<DIV$math_class>\n"
! 	    , $_ ."\n</DIV><BR CLEAR=\"ALL\"><P></P>");
      }
  }
  
--- 1477,1529 ----
  	$_ = join('', $comment, $labels, $math_start, $_, $math_end );
      }
      if ($border||($attribs)) { 
! 	# shige 10/31 2006
! 	if ($USEFLEQNINDENT && $FLUSH_EQN) {
! 	    if ($EQN_TAGS =~ /R/) {
! 		join('',"\n<blockquote>\n"
! 		     , &make_table( $border, $attribs, '', '', '', $_ )
! 		     , "\n</blockquote><br clear=\"all\">");
! 	    } else {
! 		join('',"<br>\n<div>\n"
! 		     , &make_table( $border, $attribs, '', '', '', $_ )
! 		     , "\n</div><br clear=\"all\">");
! 	    }
! 	} else {
! 	    join('',"<BR>\n<DIV$math_class>\n"
! 		 , &make_table( $border, $attribs, '', '', '', $_ )
! 		 , "\n</DIV><BR CLEAR=\"ALL\">");
! 	}
      } elsif ($failed) {
  	$falign = (($EQN_TAGS =~ /L/)? 'LEFT' : 'RIGHT') if ($eqno);
  	local($fclass) = $math_class;
! 	$fclass =~ s/(ALIGN=\")[^"]*/$1$falign/; #"]
! 	# shige 10/31 2006
! 	if ($USEFLEQNINDENT && $FLUSH_EQN) {
! 	    if($EQN_TAGS =~ /R/) {
! 		join('',"\n<blockquote>\n"
! 		     , $_ , "\n</blockquote><br clear=\"all\">");
! 	    } else {
! 		join('',"<br>\n<div>\n"
! 		     , $_ , "\n<br clear=\"all\"></div><p></p>");
! 	    }
! 	} else {
! 	    join('',"<BR>\n<DIV$fclass>\n"
! 		 , $_ , "\n<BR CLEAR=\"ALL\"></DIV><P></P>");
! 	}
      } else { 
! 	# shige 10/31 2006
! 	if ($USEFLEQNINDENT && $FLUSH_EQN) {
! 	    if ($EQN_TAGS =~ /R/) {
! 		join('', "\n<blockquote>\n"
! 		     , $_ ."\n</blockquote><br clear=\"all\">");
! 	    } else {
! 		join('', "<br><p></p>\n<div>\n"
! 		     , $_ ."\n</div><br clear=\"all\"><p></p>");
! 	    }
! 	} else {
! 	    join('', "<BR><P></P>\n<DIV$math_class>\n"
! 		 , $_ ."\n</DIV><BR CLEAR=\"ALL\"><P></P>");
! 	}
      }
  }
  
***************
*** 1514,1525 ****
  	$_ = (($comment.$labels)? "$comment$labels\n":'').$sbig.$_.$ebig;
      }
      if ($border||($attribs)) {
! 	join('',"<BR>\n<DIV$math_class>\n"
!             , &make_table( $border, $attribs, '', '', '', $_ )
! 	    , "</DIV>\n<BR CLEAR=\"ALL\">");
      } else { 
!         join('',"<BR><P></P>\n<DIV$math_class>",$_
!             ,"</DIV><BR CLEAR=\"ALL\">\n<P></P>");
      }
  }
  
--- 1549,1573 ----
  	$_ = (($comment.$labels)? "$comment$labels\n":'').$sbig.$_.$ebig;
      }
      if ($border||($attribs)) {
! 	# shige 10/31 2006
! 	if ($USEFLEQNINDENT && $FLUSH_EQN) {	
! 	    join('',"\n<blockquote>\n"
! 		 , &make_table( $border, $attribs, '', '', '', $_ )
! 		 , "\n</blockquote><br clear=\"all\">");
! 	} else {
! 	    join('',"<BR>\n<DIV$math_class>\n"
! 		 , &make_table( $border, $attribs, '', '', '', $_ )
! 		 , "</DIV>\n<BR CLEAR=\"ALL\">");
! 	}
      } else { 
! 	# shige 10/31 2006
! 	if ($USEFLEQNINDENT && $FLUSH_EQN) {	
! 	    join('',"\n<blockquote>",$_
! 		 ,"\n</blockquote><br clear=\"all\">\n");
! 	} else {
! 	    join('',"<BR><P></P>\n<DIV$math_class>",$_
! 		 ,"</DIV><BR CLEAR=\"ALL\">\n<P></P>");
! 	}
      }
  }
  
***************
*** 1553,1561 ****
  		"eqnarray".(($no_eqn_numbers) ? "star" : '')
  		, $id, $saved));
  	local($fclass) = $math_class;
! 	$fclass =~ s/(ALIGN=\")[^"]*/$1$falign/;
! 	$_ = join('',"<P></P><DIV$fclass>"
! 	    , $_, "</DIV><BR CLEAR=\"ALL\"><P></P>\n");
      } else {
  	$failed = 0;
  	s/$htmlimage_rx/$doimage = $&;''/eo ; # force an image
--- 1601,1615 ----
  		"eqnarray".(($no_eqn_numbers) ? "star" : '')
  		, $id, $saved));
  	local($fclass) = $math_class;
! 	$fclass =~ s/(ALIGN=\")[^"]*/$1$falign/; #"]
! 	# shige 10/31 2006
!         if ($USEFLEQNINDENT && $FLUSH_EQN) {
! 	    $_ = join('',"<blockquote>"
! 		      , $_, "</blockquote><br clear=\"all\">\n");
! 	} else {
! 	    $_ = join('',"<P></P><DIV$fclass>"
! 		      , $_, "</DIV><BR CLEAR=\"ALL\"><P></P>\n");
! 	}
      } else {
  	$failed = 0;
  	s/$htmlimage_rx/$doimage = $&;''/eo ; # force an image
***************
*** 1566,1571 ****
--- 1620,1629 ----
  	    , "</TD>\n<TD ALIGN=\"CENTER\" NOWRAP>"
  	    , "</TD>\n<TD ALIGN=\"LEFT\" WIDTH=\"50%\" NOWRAP>"
  	    , "</TD></TR>", "\n</TABLE>", "</TD>\n<TD>" );
+ 	# shige 12/20 2008
+         if ($USEFLEQNINDENT && $FLUSH_EQN) {
+ 	    $srcell = "</TD>\n<TD ALIGN=\"LEFT\" width=\"90%\" NOWRAP>";
+ 	}
  	$env_id = '';
  	$sarray .= (($no_eqn_numbers) ? ">" :  " WIDTH=\"100%\">" );
  	local($seqno) = join('',"\n<TD$eqno_class WIDTH=10 ALIGN=\""
***************
*** 1575,1584 ****
--- 1633,1652 ----
  	    ($srow, $slcell, $ercell) = (
  		"\n<TR$valign>" . $seqno
  		, "</TD>\n<TD NOWRAP WIDTH=\"50%\" ALIGN=", '');
+ 	    # shige 12/20 2008
+ 	    if ($USEFLEQNINDENT && $FLUSH_EQN) {
+ 		$slcell = "</TD>\n<td width=\"10%\"><!-- empty --></td>"
+ 		    . "<TD width=\"0\" NOWRAP ALIGN=";
+ 	    }
  	} else { # equation number on right
  	    ($srow, $slcell, $ercell) = ("\n<TR$valign>"
  		, "<TD NOWRAP WIDTH=\"50%\" ALIGN="
  		, '</TD>'. $seqno );
+ 	    # shige 12/20 2008
+ 	    if ($USEFLEQNINDENT && $FLUSH_EQN) {
+ 		$slcell = "<td width=\"10%\"><!-- empty --></td>"
+ 		    . "<TD width=\"0\" NOWRAP ALIGN=";
+ 	    }
  	}
  
  	$_ = &protect_array_envs($_);
***************
*** 1713,1718 ****
--- 1781,1788 ----
  	join('' #,"<BR>\n<DIV$math_class>"
  	    , &make_table( $border, $attribs, '', '', '', $_ )
  	    , "\n</DIV><P></P><BR CLEAR=\"ALL\">");
+     } elsif ($no_eqn_numbers) {
+ 	$_;
      } else {
  	join('', $_ ,"<BR CLEAR=\"ALL\"><P></P>");
      }
***************
*** 1760,1771 ****
      } elsif ($failed) {
  	$_ =~ s/^[ \t]*\n?/\n/; 
  	$_ =~ s/\n?[ \t]*/\n/;
! 	join('', "<BR><P></P>\n<DIV$math_class>"
! 	    , $_ ,"\n</DIV><P></P><BR CLEAR=\"ALL\">");
      } elsif ($_ =~ s!(</TABLE></DIV>)\s*(<BR[^>]*><P></P>)?\s*$!$1!si) {
  	join('', $_ ,"<BR>\n");
      } elsif ($_ =~ m!<P></P>\s*$!si) { # below-display space present 
! 	$_
      } else {
  	join('', $_ ,"<BR CLEAR=\"ALL\"><P></P>");
      }
--- 1830,1847 ----
      } elsif ($failed) {
  	$_ =~ s/^[ \t]*\n?/\n/; 
  	$_ =~ s/\n?[ \t]*/\n/;
! 	# shige 10/31 2006
! 	if ($USEFLEQNINDENT && $FLUSH_EQN) {	
! 	    join('', "\n<blockquote>\n",
! 		 , $_ ,"\n</blockquote><br clear=\"all\">");
! 	} else {
! 	    join('', "<BR><P></P>\n<DIV$math_class>"
! 		 , $_ ,"\n</DIV><P></P><BR CLEAR=\"ALL\">");
! 	}
      } elsif ($_ =~ s!(</TABLE></DIV>)\s*(<BR[^>]*><P></P>)?\s*$!$1!si) {
  	join('', $_ ,"<BR>\n");
      } elsif ($_ =~ m!<P></P>\s*$!si) { # below-display space present 
! 	$_;
      } else {
  	join('', $_ ,"<BR CLEAR=\"ALL\"><P></P>");
      }
diff -rcN latex2html-2008/versions/html4_01.pl l2h-2K8-jp1.10b2.9/versions/html4_01.pl
*** latex2html-2008/versions/html4_01.pl	Thu Jan  1 15:15:01 2004
--- l2h-2K8-jp1.10b2.9/versions/html4_01.pl	Sat Dec 20 20:51:15 2008
***************
*** 1498,1515 ****
  	$_ = join('', $comment, $labels, $math_start, $_, $math_end );
      }
      if ($border||($attribs)) { 
! 	join('',"<BR>\n<DIV$math_class>\n"
! 	    , &make_table( $border, $attribs, '', '', '', $_ )
! 	    , "\n<BR CLEAR=\"ALL\">");
      } elsif ($failed) {
  	$falign = (($EQN_TAGS =~ /L/)? 'LEFT' : 'RIGHT') if ($eqno);
  	local($fclass) = $math_class;
! 	$fclass =~ s/(ALIGN=\")[^"]*/$1$falign/;
! 	join('',"<BR>\n<DIV$fclass>\n"
! 	    , $_ , "\n<BR CLEAR=\"ALL\"></DIV><P></P>")
      } else { 
! 	join('', "<BR><P></P>\n<DIV$math_class>\n"
! 	    , $_ ."\n</DIV><BR CLEAR=\"ALL\"><P></P>");
      }
  }
  
--- 1498,1550 ----
  	$_ = join('', $comment, $labels, $math_start, $_, $math_end );
      }
      if ($border||($attribs)) { 
! 	# shige 11/02 2006
! 	if ($USEFLEQNINDENT && $FLUSH_EQN) {
! 	    if ($EQN_TAGS =~ /R/) {
! 		join('',"\n<blockquote>\n"
! 		     , &make_table( $border, $attribs, '', '', '', $_ )
! 		     , "\n</blockquote><br clear=\"all\">");
! 	    } else {
! 		join('',"<br>\n<div>\n"
! 		     , &make_table( $border, $attribs, '', '', '', $_ )
! 		     , "\n</div><br clear=\"all\">");
! 	    }
! 	} else {
! 	    join('',"<BR>\n<DIV$math_class>\n"
! 		 , &make_table( $border, $attribs, '', '', '', $_ )
! 		 , "\n</DIV><BR CLEAR=\"ALL\">");
! 	}
      } elsif ($failed) {
  	$falign = (($EQN_TAGS =~ /L/)? 'LEFT' : 'RIGHT') if ($eqno);
  	local($fclass) = $math_class;
! 	$fclass =~ s/(ALIGN=\")[^"]*/$1$falign/; #"]
! 	# shige 11/02 2006
! 	if ($USEFLEQNINDENT && $FLUSH_EQN) {
! 	    if ($EQN_TAGS =~ /R/) {
! 		join('',"\n<blockquote>\n"
! 		     , $_ , "\n</blockquote><br clear=\"all\">");
! 	    } else {
! 		join('',"<br>\n<div>\n"
! 		     , $_ , "\n<br clear=\"all\"></div><p></p>");
! 	    }
! 	} else {
! 	    join('',"<BR>\n<DIV$fclass>\n"
! 		 , $_ , "\n<BR CLEAR=\"ALL\"></DIV><P></P>");
! 	}
      } else { 
! 	# shige 11/02 2006
! 	if ($USEFLEQNINDENT && $FLUSH_EQN) {
! 	    if ($EQN_TAGS =~ /R/) {
! 		join('', "\n<blockquote>\n"
! 		     , $_ ."\n</blockquote><br clear=\"all\">");
! 	    } else {
! 		join('', "<br><p></p>\n<div>\n"
! 		     , $_ ."\n</div><br clear=\"all\"><p></p>");
! 	    }
! 	} else {
! 	    join('', "<BR><P></P>\n<DIV$math_class>\n"
! 		 , $_ ."\n</DIV><BR CLEAR=\"ALL\"><P></P>");
! 	}
      }
  }
  
***************
*** 1535,1546 ****
  	$_ = (($comment.$labels)? "$comment$labels\n":'').$sbig.$_.$ebig;
      }
      if ($border||($attribs)) {
! 	join('',"<BR>\n<DIV$math_class>\n"
!             , &make_table( $border, $attribs, '', '', '', $_ )
! 	    , "</DIV>\n<BR CLEAR=\"ALL\">");
      } else { 
!         join('',"<BR><P></P>\n<DIV$math_class>",$_
!             ,"</DIV><BR CLEAR=\"ALL\">\n<P></P>");
      }
  }
  
--- 1570,1594 ----
  	$_ = (($comment.$labels)? "$comment$labels\n":'').$sbig.$_.$ebig;
      }
      if ($border||($attribs)) {
! 	# shige 11/02 2006
! 	if ($USEFLEQNINDENT && $FLUSH_EQN) {	
! 	    join('',"\n<blockquote>\n"
! 		 , &make_table( $border, $attribs, '', '', '', $_ )
! 		 , "\n</blockquote><br clear=\"all\">");
! 	} else {
! 	    join('',"<BR>\n<DIV$math_class>\n"
! 		 , &make_table( $border, $attribs, '', '', '', $_ )
! 		 , "</DIV>\n<BR CLEAR=\"ALL\">");
! 	}
      } else { 
! 	# shige 11/02 2006
! 	if ($USEFLEQNINDENT && $FLUSH_EQN) {	
! 	    join('',"\n<blockquote>",$_
! 		 ,"\n</blockquote><br clear=\"all\">");
! 	} else {
! 	    join('',"<BR><P></P>\n<DIV$math_class>",$_
! 		 ,"</DIV><BR CLEAR=\"ALL\">\n<P></P>");
! 	}
      }
  }
  
***************
*** 1574,1582 ****
  		"eqnarray".(($no_eqn_numbers) ? "star" : '')
  		, $id, $saved));
  	local($fclass) = $math_class;
! 	$fclass =~ s/(ALIGN=\")[^"]*/$1$falign/;
! 	$_ = join('',"<P></P><DIV$fclass>"
! 	    , $_, "</DIV><BR CLEAR=\"ALL\"><P></P>\n");
      } else {
  	$failed = 0;
  	s/$htmlimage_rx/$doimage = $&;''/eo ; # force an image
--- 1622,1636 ----
  		"eqnarray".(($no_eqn_numbers) ? "star" : '')
  		, $id, $saved));
  	local($fclass) = $math_class;
! 	$fclass =~ s/(ALIGN=\")[^"]*/$1$falign/; #"]
! 	# shige 11/02 2006
!         if ($USEFLEQNINDENT && $FLUSH_EQN) {
! 	    $_ = join('',"<blockquote>"
! 		      , $_, "</blockquote><br clear=\"all\">\n");
! 	} else {
! 	    $_ = join('',"<P></P><DIV$fclass>"
! 		      , $_, "</DIV><BR CLEAR=\"ALL\"><P></P>\n");
! 	}
      } else {
  	$failed = 0;
  	s/$htmlimage_rx/$doimage = $&;''/eo ; # force an image
***************
*** 1587,1592 ****
--- 1641,1650 ----
  	    , "</TD>\n<TD ALIGN=\"CENTER\" NOWRAP>"
  	    , "</TD>\n<TD ALIGN=\"LEFT\" WIDTH=\"50%\" NOWRAP>"
  	    , "</TD></TR>", "\n</TABLE>", "</TD>\n<TD>" );
+ 	# shige 12/20 2008
+         if ($USEFLEQNINDENT && $FLUSH_EQN) {
+ 	    $srcell = "</TD>\n<TD ALIGN=\"LEFT\" width=\"90%\" NOWRAP>";
+ 	}
  	$env_id = '';
  	$sarray .= (($no_eqn_numbers) ? ">" :  " WIDTH=\"100%\">" );
  	local($seqno) = join('',"\n<TD$eqno_class WIDTH=10 ALIGN=\""
***************
*** 1596,1605 ****
--- 1654,1673 ----
  	    ($srow, $slcell, $ercell) = (
  		"\n<TR$valign>" . $seqno
  		, "</TD>\n<TD NOWRAP WIDTH=\"50%\" ALIGN=", '');
+ 	    # shige 12/20 2008
+ 	    if ($USEFLEQNINDENT && $FLUSH_EQN) {
+ 		$slcell = "</TD>\n<td width=\"10%\"><!-- empty --></td>"
+ 		    . "<TD width=\"0\" NOWRAP ALIGN=";
+ 	    }
  	} else { # equation number on right
  	    ($srow, $slcell, $ercell) = ("\n<TR$valign>"
  		, "<TD NOWRAP WIDTH=\"50%\" ALIGN="
  		, '</TD>'. $seqno );
+ 	    # shige 12/20 2008
+ 	    if ($USEFLEQNINDENT && $FLUSH_EQN) {
+ 		$slcell = "<td width=\"10%\"><!-- empty --></td>"
+ 		    . "<TD width=\"0\" NOWRAP ALIGN=";
+ 	    }
  	}
  
  	$_ = &protect_array_envs($_);
***************
*** 1781,1792 ****
      } elsif ($failed) {
  	$_ =~ s/^[ \t]*\n?/\n/; 
  	$_ =~ s/\n?[ \t]*/\n/;
! 	join('', "<BR><P></P>\n<DIV$math_class>"
! 	    , $_ ,"\n</DIV><P></P><BR CLEAR=\"ALL\">");
      } elsif ($_ =~ s!(</TABLE></DIV>)\s*(<BR[^>]*><P></P>)?\s*$!$1!si) {
  	join('', $_ ,"<BR>\n");
      } elsif ($_ =~ m!<P></P>\s*$!si) { # below-display space present 
! 	$_
      } else {
  	join('', $_ ,"<BR CLEAR=\"ALL\"><P></P>");
      }
--- 1849,1866 ----
      } elsif ($failed) {
  	$_ =~ s/^[ \t]*\n?/\n/; 
  	$_ =~ s/\n?[ \t]*/\n/;
! 	# shige 10/31 2006
! 	if ($USEFLEQNINDENT && $FLUSH_EQN) {	
! 	    join('', "\n<blockquote>"
! 		 , $_ ,"\n</blockquote><br clear=\"all\">");
! 	} else {
! 	    join('', "<BR><P></P>\n<DIV$math_class>"
! 		 , $_ ,"\n</DIV><P></P><BR CLEAR=\"ALL\">");
! 	}
      } elsif ($_ =~ s!(</TABLE></DIV>)\s*(<BR[^>]*><P></P>)?\s*$!$1!si) {
  	join('', $_ ,"<BR>\n");
      } elsif ($_ =~ m!<P></P>\s*$!si) { # below-display space present 
! 	$_;
      } else {
  	join('', $_ ,"<BR CLEAR=\"ALL\"><P></P>");
      }
diff -rcN latex2html-2008/versions/html4_1.pl l2h-2K8-jp1.10b2.9/versions/html4_1.pl
*** latex2html-2008/versions/html4_1.pl	Thu Jan  1 15:15:01 2004
--- l2h-2K8-jp1.10b2.9/versions/html4_1.pl	Sat Dec 20 20:52:17 2008
***************
*** 1498,1515 ****
  	$_ = join('', $comment, $labels, $math_start, $_, $math_end );
      }
      if ($border||($attribs)) { 
! 	join('',"<BR>\n<DIV$math_class>\n"
! 	    , &make_table( $border, $attribs, '', '', '', $_ )
! 	    , "\n<BR CLEAR=\"ALL\">");
      } elsif ($failed) {
  	$falign = (($EQN_TAGS =~ /L/)? 'LEFT' : 'RIGHT') if ($eqno);
  	local($fclass) = $math_class;
! 	$fclass =~ s/(ALIGN=\")[^"]*/$1$falign/;
! 	join('',"<BR>\n<DIV$fclass>\n"
! 	    , $_ , "\n<BR CLEAR=\"ALL\"></DIV><P></P>")
      } else { 
! 	join('', "<BR><P></P>\n<DIV$math_class>\n"
! 	    , $_ ."\n</DIV><BR CLEAR=\"ALL\"><P></P>");
      }
  }
  
--- 1498,1550 ----
  	$_ = join('', $comment, $labels, $math_start, $_, $math_end );
      }
      if ($border||($attribs)) { 
! 	# shige 11/02 2006
! 	if ($USEFLEQNINDENT && $FLUSH_EQN) {
! 	    if ($EQN_TAGS =~ /R/) {
! 		join('',"\n<blockquote>\n"
! 		     , &make_table( $border, $attribs, '', '', '', $_ )
! 		     , "\n</blockquote><br clear=\"all\">");
! 	    } else {
! 		join('',"<br>\n<div>\n"
! 		     , &make_table( $border, $attribs, '', '', '', $_ )
! 		     , "\n</div><br clear=\"all\">");
! 	    }
! 	} else {
! 	    join('',"<BR>\n<DIV$math_class>\n"
! 		 , &make_table( $border, $attribs, '', '', '', $_ )
! 		 , "\n</DIV><BR CLEAR=\"ALL\">");
! 	}
      } elsif ($failed) {
  	$falign = (($EQN_TAGS =~ /L/)? 'LEFT' : 'RIGHT') if ($eqno);
  	local($fclass) = $math_class;
! 	$fclass =~ s/(ALIGN=\")[^"]*/$1$falign/; #"]
! 	# shige 11/02 2006
! 	if ($USEFLEQNINDENT && $FLUSH_EQN) {
! 	    if ($EQN_TAGS =~ /R/) {
! 		join('',"\n<blockquote>\n"
! 		     , $_ , "\n</blockquote><br clear=\"all\">");
! 	    } else {
! 		join('',"<br>\n<div>\n"
! 		     , $_ , "\n<br clear=\"all\"></div><p></p>");
! 	    }
! 	} else {
! 	    join('',"<BR>\n<DIV$fclass>\n"
! 		 , $_ , "\n<BR CLEAR=\"ALL\"></DIV><P></P>");
! 	}
      } else { 
! 	# shige 11/02 2006
! 	if ($USEFLEQNINDENT && $FLUSH_EQN) {
! 	    if ($EQN_TAGS =~ /R/) {
! 		join('', "\n<blockquote>\n"
! 		     , $_ ."\n</blockquote><br clear=\"all\">");
! 	    } else {
! 		join('', "<br><p></p>\n<div>\n"
! 		     , $_ ."\n</div><br clear=\"all\"><p></p>");
! 	    }
! 	} else {
! 	    join('', "<BR><P></P>\n<DIV$math_class>\n"
! 		 , $_ ."\n</DIV><BR CLEAR=\"ALL\"><P></P>");
! 	}
      }
  }
  
***************
*** 1535,1546 ****
  	$_ = (($comment.$labels)? "$comment$labels\n":'').$sbig.$_.$ebig;
      }
      if ($border||($attribs)) {
! 	join('',"<BR>\n<DIV$math_class>\n"
!             , &make_table( $border, $attribs, '', '', '', $_ )
! 	    , "</DIV>\n<BR CLEAR=\"ALL\">");
      } else { 
!         join('',"<BR><P></P>\n<DIV$math_class>",$_
!             ,"</DIV><BR CLEAR=\"ALL\">\n<P></P>");
      }
  }
  
--- 1570,1594 ----
  	$_ = (($comment.$labels)? "$comment$labels\n":'').$sbig.$_.$ebig;
      }
      if ($border||($attribs)) {
! 	# shige 11/02 2006
! 	if ($USEFLEQNINDENT && $FLUSH_EQN) {	
! 	    join('',"\n<blockquote>\n"
! 		 , &make_table( $border, $attribs, '', '', '', $_ )
! 		 , "\n</blockquote><br clear=\"all\">");
! 	} else {
! 	    join('',"<BR>\n<DIV$math_class>\n"
! 		 , &make_table( $border, $attribs, '', '', '', $_ )
! 		 , "</DIV>\n<BR CLEAR=\"ALL\">");
! 	}
      } else { 
! 	# shige 11/02 2006
! 	if ($USEFLEQNINDENT && $FLUSH_EQN) {	
! 	    join('',"\n<blockquote>",$_
! 		 ,"\n</blockquote><br clear=\"all\">");
! 	} else {
! 	    join('',"<BR><P></P>\n<DIV$math_class>",$_
! 		 ,"</DIV><BR CLEAR=\"ALL\">\n<P></P>");
! 	}
      }
  }
  
***************
*** 1574,1582 ****
  		"eqnarray".(($no_eqn_numbers) ? "star" : '')
  		, $id, $saved));
  	local($fclass) = $math_class;
! 	$fclass =~ s/(ALIGN=\")[^"]*/$1$falign/;
! 	$_ = join('',"<P></P><DIV$fclass>"
! 	    , $_, "</DIV><BR CLEAR=\"ALL\"><P></P>\n");
      } else {
  	$failed = 0;
  	s/$htmlimage_rx/$doimage = $&;''/eo ; # force an image
--- 1622,1636 ----
  		"eqnarray".(($no_eqn_numbers) ? "star" : '')
  		, $id, $saved));
  	local($fclass) = $math_class;
! 	$fclass =~ s/(ALIGN=\")[^"]*/$1$falign/; #"]
! 	# shige 11/02 2006
!         if ($USEFLEQNINDENT && $FLUSH_EQN) {
! 	    $_ = join('',"<blockquote>"
! 		      , $_, "</blockquote><br clear=\"all\">\n");
! 	} else {
! 	    $_ = join('',"<P></P><DIV$fclass>"
! 		      , $_, "</DIV><BR CLEAR=\"ALL\"><P></P>\n");
! 	}
      } else {
  	$failed = 0;
  	s/$htmlimage_rx/$doimage = $&;''/eo ; # force an image
***************
*** 1587,1592 ****
--- 1641,1650 ----
  	    , "</TD>\n<TD ALIGN=\"CENTER\" NOWRAP>"
  	    , "</TD>\n<TD ALIGN=\"LEFT\" WIDTH=\"50%\" NOWRAP>"
  	    , "</TD></TR>", "\n</TABLE>", "</TD>\n<TD>" );
+ 	# shige 12/20 2008
+         if ($USEFLEQNINDENT && $FLUSH_EQN) {
+ 	    $srcell = "</TD>\n<TD ALIGN=\"LEFT\" width=\"90%\" NOWRAP>";
+ 	}
  	$env_id = '';
  	$sarray .= (($no_eqn_numbers) ? ">" :  " WIDTH=\"100%\">" );
  	local($seqno) = join('',"\n<TD$eqno_class WIDTH=10 ALIGN=\""
***************
*** 1596,1605 ****
--- 1654,1673 ----
  	    ($srow, $slcell, $ercell) = (
  		"\n<TR$valign>" . $seqno
  		, "</TD>\n<TD NOWRAP WIDTH=\"50%\" ALIGN=", '');
+ 	    # shige 12/20 2008
+ 	    if ($USEFLEQNINDENT && $FLUSH_EQN) {
+ 		$slcell = "</TD>\n<td width=\"10%\"><!-- empty --></td>"
+ 		    . "<TD width=\"0\" NOWRAP ALIGN=";
+ 	    }
  	} else { # equation number on right
  	    ($srow, $slcell, $ercell) = ("\n<TR$valign>"
  		, "<TD NOWRAP WIDTH=\"50%\" ALIGN="
  		, '</TD>'. $seqno );
+ 	    # shige 12/20 2008
+ 	    if ($USEFLEQNINDENT && $FLUSH_EQN) {
+ 		$slcell = "<td width=\"10%\"><!-- empty --></td>"
+ 		    . "<TD width=\"0\" NOWRAP ALIGN=";
+ 	    }
  	}
  
  	$_ = &protect_array_envs($_);
***************
*** 1781,1792 ****
      } elsif ($failed) {
  	$_ =~ s/^[ \t]*\n?/\n/; 
  	$_ =~ s/\n?[ \t]*/\n/;
! 	join('', "<BR><P></P>\n<DIV$math_class>"
! 	    , $_ ,"\n</DIV><P></P><BR CLEAR=\"ALL\">");
      } elsif ($_ =~ s!(</TABLE></DIV>)\s*(<BR[^>]*><P></P>)?\s*$!$1!si) {
  	join('', $_ ,"<BR>\n");
      } elsif ($_ =~ m!<P></P>\s*$!si) { # below-display space present 
! 	$_
      } else {
  	join('', $_ ,"<BR CLEAR=\"ALL\"><P></P>");
      }
--- 1849,1866 ----
      } elsif ($failed) {
  	$_ =~ s/^[ \t]*\n?/\n/; 
  	$_ =~ s/\n?[ \t]*/\n/;
! 	# shige 10/31 2006
! 	if ($USEFLEQNINDENT && $FLUSH_EQN) {	
! 	    join('', "\n<blockquote>"
! 		 , $_ ,"\n</blockquote><br clear=\"all\">");
! 	} else {
! 	    join('', "<BR><P></P>\n<DIV$math_class>"
! 		 , $_ ,"\n</DIV><P></P><BR CLEAR=\"ALL\">");
! 	}
      } elsif ($_ =~ s!(</TABLE></DIV>)\s*(<BR[^>]*><P></P>)?\s*$!$1!si) {
  	join('', $_ ,"<BR>\n");
      } elsif ($_ =~ m!<P></P>\s*$!si) { # below-display space present 
! 	$_;
      } else {
  	join('', $_ ,"<BR CLEAR=\"ALL\"><P></P>");
      }
diff -rcN latex2html-2008/versions/math.pl l2h-2K8-jp1.10b2.9/versions/math.pl
*** latex2html-2008/versions/math.pl	Thu Jan  1 15:15:01 2004
--- l2h-2K8-jp1.10b2.9/versions/math.pl	Sat Dec 20 20:52:44 2008
***************
*** 240,247 ****
  #	    , &make_table( $border, $attribs, '', '', '', $_ )
  #	    , "\n<BR CLEAR=\"ALL\">");
  #    } else { $_ }
!     $pre_math = "\n<P></P><DIV$math_class>\n";
!     $post_math = "\n</DIV>";
      if ($failed) {
  	$_ = join ('', $labels, $comment, $math_start
  	    , &process_undefined_environment('displaymath', $id, $saved)
--- 240,258 ----
  #	    , &make_table( $border, $attribs, '', '', '', $_ )
  #	    , "\n<BR CLEAR=\"ALL\">");
  #    } else { $_ }
!     # shige 10/24 2006
!     if ($USEFLEQNINDENT && $FLUSH_EQN) {
! 	if ($EQN_TAGS =~ /R/) {
! 	    $pre_math = "\n<blockquote>\n";
! 	    $post_math = "\n</blockquote>\n";
! 	} else {
! 	    $pre_math = "\n<p></p><div>\n";
! 	    $post_math = "\n</div>";
! 	}
!     } else {
! 	$pre_math = "\n<P></P><DIV$math_class>\n";
! 	$post_math = "\n</DIV>";
!     }
      if ($failed) {
  	$_ = join ('', $labels, $comment, $math_start
  	    , &process_undefined_environment('displaymath', $id, $saved)
***************
*** 250,268 ****
  	$_ = join('', $labels, $comment
  		, $math_start, "\n$_\n", $math_end );
      } else {
!         $pre_math = "<P$math_class>";
!         $post_math = '</P>';
  	$_ = join('', $labels, $comment, $math_start
  	    , "\n<MATH CLASS=\"EQUATION\">\n"
  	    , $_ , "\n</MATH>", $math_end );
      }
      if (($border||($attribs))&&($HTML_VERSION > 2.1 )) { 
!         $pre_math = "<BR>\n<DIV$math_class>\n";
!         $post_math = "\n</DIV><BR CLEAR=\"ALL\">";
  	$_ = &make_table( $border, $attribs, '', '', '', $_ );
      } elsif ($HTML_VERSION < 2.2) {
!         $pre_math = "<BR>\n<P>\n";
!         $post_math = "\n</P>\n";
      }
      $pre_math . $_ . $post_math
  }
--- 261,312 ----
  	$_ = join('', $labels, $comment
  		, $math_start, "\n$_\n", $math_end );
      } else {
! 	# shige 10/24 2006
! 	if ($USEFLEQNINDENT && $FLUSH_EQN) {
! 	    if($EQN_TAGS =~ /R/) {
! 		$pre_math = "<blockquote>";
! 		$post_math = "</blockquote>";
! 	    } else {
! 		$pre_math = "<p>";
! 		$post_math = "</p>";
! 	    }
! 	} else {
! 	    $pre_math = "<P$math_class>";
! 	    $post_math = '</P>';
! 	}
  	$_ = join('', $labels, $comment, $math_start
  	    , "\n<MATH CLASS=\"EQUATION\">\n"
  	    , $_ , "\n</MATH>", $math_end );
      }
      if (($border||($attribs))&&($HTML_VERSION > 2.1 )) { 
! 	# shige 10/24 2006
! 	if ($USEFLEQNINDENT && $FLUSH_EQN) {
! 	    if ($EQN_TAGS =~ /R/) {
! 		$pre_math = "\n<blockquote>\n";
! 		$post_math = "\n</blockquote><br clear=\"all\">";
! 	    } else {
! 		$pre_math = "<br>\n<div>\n";
! 		$post_math = "\n</div><br clear=\"all\">";
! 	    }
! 	} else {
! 	    $pre_math = "<BR>\n<DIV$math_class>\n";
! 	    $post_math = "\n</DIV><BR CLEAR=\"ALL\">";
! 	}
  	$_ = &make_table( $border, $attribs, '', '', '', $_ );
      } elsif ($HTML_VERSION < 2.2) {
! 	# shige 10/24 2006
! 	if ($USEFLEQNINDENT && $FLUSH_EQN) {
! 	    if ($EQN_TAGS =~ /R/) {
! 		$pre_math = "\n<blockquote>\n";
! 		$post_math = "\n</blockquote>\n";
! 	    } else {
! 		$pre_math = "<br>\n<p>\n";
! 		$post_math = "\n</p>\n";
! 	    }
! 	} else {
! 	    $pre_math = "<BR>\n<P>\n";
! 	    $post_math = "\n</P>\n";
! 	}
      }
      $pre_math . $_ . $post_math
  }
***************
*** 279,301 ****
      ($sbig,$ebig) = ('<BIG>','</BIG>')
  	if (($DISP_SCALE_FACTOR)&&($DISP_SCALE_FACTOR >= 1.2 ));
      ($labels, $comment, $_) = &process_math_env($math_mode,$_);
      if ($failed) {
! 	$_ = join('', $labels, $comment, "<P$math_class>"
!             , &process_undefined_environment("displaymath", $id, $saved )
!             , '</P>', $mathend_mark );
      } elsif ($NO_SIMPLE_MATH) {
  	$_ =~ s/<TABLE/$ebig$&/sg; $_ =~ s/<\/TABLE>/$&$sbig/sg;
! 	$_ = "<P>$labels$comment</P><DIV$math_class>$labels\n$sbig$_$ebig\n"
! 		. "</DIV><P>$mathend_mark</P>"
      } else { 
!         $_ = join('', "<P$math_class>", $labels, $comment
              , "$sbig\n<MATH CLASS=\"DISPLAYMATH\">\n",$_
  	    , "\n</MATH>\n$ebig$mathend_mark</P>");
      }
      if (($border||($attribs))&&($HTML_VERSION > 2.1 )) { 
! 	join('',"<BR>\n<DIV$math_class>\n"
              , &make_table( $border, $attribs, '', '', '', $_ )
  	    , "\n<BR CLEAR=\"ALL\">");
      } else { $_ }
  }
  
--- 323,362 ----
      ($sbig,$ebig) = ('<BIG>','</BIG>')
  	if (($DISP_SCALE_FACTOR)&&($DISP_SCALE_FACTOR >= 1.2 ));
      ($labels, $comment, $_) = &process_math_env($math_mode,$_);
+     # shige 10/24 2006
+     if ($USEFLEQNINDENT && $FLUSH_EQN) {
+ 	$fclass = "";
+     } else {
+ 	$fclass = "$math_class";	
+     }
      if ($failed) {
! 	# shige 10/24 2006
! 	# $_ = join('', $labels, $comment, "<P$math_class>"
! 	$_ = join('', $labels, $comment, "<P$fclass>"
! 		  , &process_undefined_environment("displaymath", $id, $saved )
! 		  , '</P>', $mathend_mark );
      } elsif ($NO_SIMPLE_MATH) {
  	$_ =~ s/<TABLE/$ebig$&/sg; $_ =~ s/<\/TABLE>/$&$sbig/sg;
! 	# shige 10/24 2006
! 	# $_ = "<P>$labels$comment</P><DIV$math_class>$labels\n$sbig$_$ebig\n"
! 	$_ = "<P>$labels$comment</P><DIV$fclass>$labels\n$sbig$_$ebig\n"
! 	    . "</DIV><P>$mathend_mark</P>";
      } else { 
! 	# shige 10/24 2006
!         # $_ = join('', "<P$math_class>", $labels, $comment
!         $_ = join('', "<P$fclass>", $labels, $comment
              , "$sbig\n<MATH CLASS=\"DISPLAYMATH\">\n",$_
  	    , "\n</MATH>\n$ebig$mathend_mark</P>");
      }
      if (($border||($attribs))&&($HTML_VERSION > 2.1 )) { 
! 	# shige 10/24 2006
! 	# join('',"<BR>\n<DIV$math_class>\n"
! 	join('',"<BR>\n<DIV$fclass>\n"
              , &make_table( $border, $attribs, '', '', '', $_ )
  	    , "\n<BR CLEAR=\"ALL\">");
+     # shige 10/24 2006
+     } elsif ($USEFLEQNINDENT && $FLUSH_EQN){
+ 	join('', "\n<blockquote>\n", $_ , "\n</blockquote>\n");
      } else { $_ }
  }
  
***************
*** 984,989 ****
--- 1045,1054 ----
  	    , "</TD>\n<TD ALIGN=\"LEFT\" NOWRAP"
  		. (($HTML_VERSION >3.3)? ' WIDTH="50%"':'').'>'
  	    , "</TD></TR>", "\n</TABLE>", "</TD>\n<TD>" );
+ 	# shige 12/20 2008
+ 	if ($HTML_VERSION >3.3 && $USEFLEQNINDENT && $FLUSH_EQN) {
+ 	    $srcell = "</TD>\n<TD ALIGN=\"LEFT\" width=\"90%\" NOWRAP>";
+ 	}
  	$sarray .= "ALIGN=\"CENTER\" WIDTH=\"100%\">";
  	$env_id = '';
  
***************
*** 996,1006 ****
--- 1061,1081 ----
  		, "</TD>\n<TD NOWRAP"
  		    . (($HTML_VERSION >3.3)? ' WIDTH="50%"':'') .' ALIGN='
  		, '');
+ 	    # shige 12/20 2008
+ 	    if ($HTML_VERSION >3.3 && $USEFLEQNINDENT && $FLUSH_EQN) {
+ 		$slcell = "</TD>\n<td width=\"10%\"><!-- empty --></td>"
+ 		    . "<TD width=\"0\" NOWRAP ALIGN=";
+ 	    }
  	} else { # equation number on right
  	    ($srow, $slcell, $ercell) = (
  		"\n<TR$valign>" , "<TD NOWRAP"
  		    . (($HTML_VERSION >3.3)? ' WIDTH="50%"':'') .' ALIGN='
  		, '</TD>'. $seqno );
+ 	    # shige 12/20 2008
+ 	    if ($HTML_VERSION >3.3 && $USEFLEQNINDENT && $FLUSH_EQN) {
+ 		$slcell = "<td width=\"10%\"><!-- empty --></td>"
+ 		    . "<TD width=\"0\" NOWRAP ALIGN=";
+ 	    }
  	}
  
  	$_ = &protect_array_envs($_);
***************
*** 1113,1119 ****
  	    , "\n<BR CLEAR=\"ALL\"></DIV>");
      } elsif ($failed &&($HTML_VERSION > 2.1 )) {
  	local($fclass) = $math_class;
! 	$fclass =~ s/(ALIGN=\")[^"]*/$1$falign/;
  	join('',"<BR>\n<DIV$fclass>\n"
  	    , $_ , "\n<BR CLEAR=\"ALL\"></DIV><P></P>")
      } elsif ($_ =~ m!</TABLE></DIV>\s*!si) { 
--- 1188,1194 ----
  	    , "\n<BR CLEAR=\"ALL\"></DIV>");
      } elsif ($failed &&($HTML_VERSION > 2.1 )) {
  	local($fclass) = $math_class;
! 	$fclass =~ s/(ALIGN=\")[^"]*/$1$falign/; #"
  	join('',"<BR>\n<DIV$fclass>\n"
  	    , $_ , "\n<BR CLEAR=\"ALL\"></DIV><P></P>")
      } elsif ($_ =~ m!</TABLE></DIV>\s*!si) { 
diff -rcN latex2html-2008/versions/table.pl l2h-2K8-jp1.10b2.9/versions/table.pl
*** latex2html-2008/versions/table.pl	Fri Nov 29 20:49:19 2002
--- l2h-2K8-jp1.10b2.9/versions/table.pl	Fri Oct  3 15:02:19 2008
***************
*** 91,97 ****
      ($pxs,$len);
  }
  # should no longer be needed, as this is defined in latex2html.pin
! if (undefined &convert_length) { sub convert_length {&convert_length_table(@_)} }
  
  # Translates LaTeX column specifications to HTML. Again, Netscape
  # needs some extra work with its width attributes in the <td> tags.
--- 91,97 ----
      ($pxs,$len);
  }
  # should no longer be needed, as this is defined in latex2html.pin
! if (!defined(&convert_length)) { sub convert_length {&convert_length_table(@_)} }
  
  # Translates LaTeX column specifications to HTML. Again, Netscape
  # needs some extra work with its width attributes in the <td> tags.
