[l2h] intertext bug (and possible fix)

David Rourke David Rourke <rourke@magres.nottingham.ac.uk>
Thu, 30 Nov 2000 16:48:26 +0000 (GMT)


Using \intertext{...} within an amsmath align or align* environment seems
to be broken. E.g.,

\documentclass{article}
\usepackage[leqno]{amsmath}
\begin{document}
\begin{align*}
a&=b\\
\intertext{hello $x=y$. latex2html tries to put the intertext test (when using leqno) into just the left equation number cell (which does exist, even though
there's nothing in it)}
x&=y
\end{align*}
\end{document}

when passed through latex2html (99.2beta8, downloaded 30 Nov 2000)

gives "hello tex2html_wrap_inline$x=y$ ..." as the intertext line.

The intertext also doesn't give the text the correct colspan when used
inside an align* environment, which can mess things up for a long
intertext text (particularly with the leqno option set).

The following diff on styles/more_amsmath.perl seems to fix these
problems:

David Rourke

*** more_amsmath.perl.orig	Thu Nov 30 16:29:56 2000
--- more_amsmath.perl	Thu Nov 30 16:42:22 2000
***************
*** 474,481 ****
  	(s/$next_pair_pr_rx/$text = $2;''/e)
  	||(s/$next_pair_rx/$text = $2;''/e));
      $post = $_; $post =~ s/(^\s*|\s*$)//go;
!     $text = &translate_environments(&translate_commands($text))
  	if ($text =~ /\\/);
      $text = join('', $smrow, $emtag
  	, (($span > 1) ? $smcell." COLSPAN=$span".$mlalign : $smlcell)
  	, "<BR>", $text, "<P><BR>", $emcell, $emrow);
--- 474,484 ----
  	(s/$next_pair_pr_rx/$text = $2;''/e)
  	||(s/$next_pair_rx/$text = $2;''/e));
      $post = $_; $post =~ s/(^\s*|\s*$)//go;
! 
! # changed by der
!     $text = &translate_commands(&translate_environments($text))
  	if ($text =~ /\\/);
+ 
      $text = join('', $smrow, $emtag
  	, (($span > 1) ? $smcell." COLSPAN=$span".$mlalign : $smlcell)
  	, "<BR>", $text, "<P><BR>", $emcell, $emrow);
***************
*** 708,714 ****
  
  	    if (/\\intertext/) {
  		local($extra_row);
! 		($extra_row,$_) = &process_intertext($numbered,$_);
  		$return .= $extra_row;
  	    }
  	    ($eqno, $_) = &get_eqn_number($numbered,$_);
--- 711,720 ----
  
  	    if (/\\intertext/) {
  		local($extra_row);
! # changed der, always give extra an cell span to the intertext, as
! # a cell is always allocated for an equation number on a normal line, even
! # if align* is used.
! 		($extra_row,$_) = &process_intertext(1,$_);
  		$return .= $extra_row;
  	    }
  	    ($eqno, $_) = &get_eqn_number($numbered,$_);