");
$return .= $table_captions;
# $return .= "\n$captions";
# $captions = '';
# $cap_anchors = '';
} else {
$return = join('', "")
}
local($firstrow) = 1;
local($lastrow) = '';
local($headcell) = 0;
local($table_tail_marker) = "";
@rows = ($TABLE_TITLE_TEXT, @rows) if ($TABLE_TITLE_TEXT);
@rows = (@rows, $table_tail_marker . $TABLE_TAIL_TEXT)
if ($TABLE_TAIL_TEXT);
local @row_spec = map {'0'} @colspec if $has_multirow;
foreach (@rows) {
#ignore lone caused by extra blank line in table; e.g. at end
next if (/^\s*(<[<#]\d+[#>]>)
]*>\1\s*$/s);
next if (/^\s*${closures}
]*>${reopens}\s*$/s);
#ignore
at the start of a row
s/^\s*(${closures})\s*
]*>\n/$1/s;
# discard long-table headers, footers and kill-rows;
s/^.*\\end(first|last)?(head|foot)//mg if $firstrow;
next if /\\kill/;
next if ((/^\s*$/)&&($firstrow));
#ignore widowed \hline and \cline commands; e.g. on last line
next if (
(/^\s*\\(hline|cline(<[<#]\d+[#>]>)(<[<#]\d+[#>]>)?\d+\3?\-(<[<#]\d+[#>]>)?\d+\4?\2)?\s*$/)
&&($border));
$lastrow = 1 if (s/^$table_tail_marker//);
print "\nTABLE-ROW: $_\n" if ($VERBOSITY > 3);
local($valign) = ' VALIGN=';
if ($NETSCAPE_HTML) { $valign .= '"BASELINE"' }
else { $valign = '' }
$return .= "\n
";
@cols = split(/$html_specials{'&'}/o);
if ($has_multirow) {
my @trow_spec = map {$_>0? --$_ : 0 } @row_spec;
@row_spec = @trow_spec;
}
for ( $i = 0; $i <= $#colspec; $i++ ) {
# skip this cell if it is covered by a \multirow
next if ($has_multirow && @row_spec[$i] > 0);
$colspec = $colspec[$i];
if (!($colspec =~ $content_mark)) {
# no data required in this column
$colspec = &translate_environments($colspec);
$colspec = &translate_commands($colspec)
if ($colspec =~ /\\/);
$return .= $colspec;
next;
}
$colspan = 0; $cell_done = '';
$cell = shift(@cols);
# Attempt to identify title cells
if (($firstrow || !$i)
&& ($cell =~ /^\s*\\((text)?(bf|it|sf)|large)/i)) {
$headcell = 'TH';
} else { $headcell = '' }
$colspec =~ s/(<\/?T)D/$1H/g
if (($firstrow &&($TABLE_TITLE_TEXT))
||($lastrow &&($TABLE_TAIL_TEXT)));
print "\nTABLE-CELL: $cell\n" if ($VERBOSITY > 3);
# remove any \parbox commands, leaving the contents
#RRM: actually, there shouldn't be any left :-)
$cell =~ s/\\parbox[^<]*<<(\d*)>>([\w\W]*)<<\1>>/$1/g;
local($num);
# May modify $colspec
if ($cell =~ /\s*\\(multicolumn|omit)/) {
$cell_done = 1 if ($1 =~ /omit/);
if(@save_open_tags_tabular) {
$open_tags_R = [ @save_open_tags_tabular ];
@save_open_tags = @save_open_tags_tabular;
}
$cell = &translate_environments($cell);
$cell = $reopens . &translate_commands($cell);
$cell .= &close_all_tags() if (@$open_tags_R);
} elsif ($colspec =~ /\\/g) {
local($tmp, $cmd, $endspec);
$colspec =~ /$content_mark/; $colspec = $`.$&;
$endspec = $'; $endspec =~ s/$ecell\s*//;
$colspec .= $endspec;
local($orig_spec) = $colspec;
local(@cmds) = (split(/\\/,$colspec));
$colspec = '';
while ($tmp = pop @cmds) {
$cmd = '';
$tmp =~ s/^([a-zA-Z]+)\s*/$cmd=$1;''/e;
if ($declarations{$cmd}||
($cmd =~ /($sizechange_rx)|($image_switch_rx)|($env_switch_rx)/)) {
$id = ++$global{'max_id'};
$colspec = join('',"$O$id$C","\\$cmd"
, (($tmp =~/^[a-zA-Z]/)? " ":'')
, "$tmp", $colspec, "$O$id$C");
} else {
$colspec = join('',"\\$cmd"
, (($tmp =~/^[a-zA-Z]/)? " ":''), "$tmp", $colspec);
}
}
$colspec =~ s/^\\//; #remove unwanted initial \
$colspec = join('',@cmds,$colspec);
if ($colspec =~ /\\/) {
$colspec =~ s/$content_mark/$cell/;
} else {
$colspec =~ s/$content_mark${O}1$C/$cell${O}1$C/;
}
$colspec =~ s/\\mathon([.\n]*)\\mathoff/
local($tmp) = ++$global{'max_id'};
"\\begin$OP$tmp${CP}math$OP$tmp$CP$1\\end$OP$tmp${CP}math$OP$tmp$CP"
/eg;
undef $cmd; undef $tmp; undef $endspec; undef @cmds;
local($tmp) = ++$global{'max_id'};
if(@save_open_tags_tabular) {
$open_tags_R = [ @save_open_tags_tabular ];
@save_open_tags = @save_open_tags_tabular;
}
$colspec = &translate_environments("$OP$tmp$CP$colspec$OP$tmp$CP");
$colspec = &translate_commands($colspec);
$* = 1;
while ($colspec =~ s/<(\w+)>\s*<\/\1>//g) {};
$* = 0;
$colspec = ';SPMnbsp;' if ($colspec =~ /^\s*$/);
$colspec = join('', $reopens, $colspec
, (@$open_tags_R ? &close_all_tags() : '')
, $ecell, "\n" );
local($cell_done);
} else {
local($tmp) = ++$global{'max_id'};
if(@save_open_tags_tabular) {
$open_tags_R = [ @save_open_tags_tabular ];
@save_open_tags = @save_open_tags_tabular;
}
$cell = &translate_environments("$OP$tmp$CP$cell$OP$tmp$CP");
$cell = &translate_commands($cell) if ($cell =~ /\\/);
$cell = join('', $reopens, $cell
, (@$open_tags_R ? &close_all_tags() : '')
);
}
# remove remains of empty braces
$cell =~ s/(($O|$OP)\d+($C|$CP))//g;
# remove leading/trailing space
$cell =~ s/^\s*|\s*$//g;
$cell = ";SPMnbsp;" if ($cell eq '');
if ( $colspan ) {
for ( $cellcount = 0; $colspan > 0; $colspan-- ) {
# $colspec[$i++] =~ s/ | $content_mark/ COLSPAN=$cellcount$&/;
};
# if ($colspec =~ /\\/) {
# $colspec =~ /$content_mark/;
# $colspec = join ('', &translate_commands($`.$cell)
# , &close_all_tags(), $');
# } else {
$colspec =~ s/$content_mark/$cell/ unless ($cell_done);
# }
if ($headcell) {
$colspec =~ s/]+)?>\s*($content_mark)?(<\/\1>)/<$1$2>;SPMnbsp;$4/g;
$return . "\n |
";
}
### Define the multicolumn command
# Modifies the $colspec and $colspan variables of the tabular subroutine
sub do_cmd_multicolumn {
local($_) = @_;
local($dmy1,$dmy2,$dmy3,$dmy4,$spancols,$text);
$spancols = &missing_braces unless (
(s/$next_pair_pr_rx/$spancols=$2;''/eo)
||(s/$next_pair_rx/$spancols=$2;''/eo));
$colspan = 0+$spancols;
$colspec =~ /^<([A-Z]+)/;
local($celltag) = $1;
$malign = &missing_braces unless (
(s/$next_pair_pr_rx/$malign=$2;''/eo)
||(s/$next_pair_rx/$malign=$2;''/eo));
# catch cases where the \textwidth has been discarded
$malign =~s!^(\w)($OP\d+$CP)\s*(\d|\d*\.\d+)\2$!$1\{$3\\textwidth\}!;
($dmy1,$dmy2,$dmy3,$dmy4,$colspec) = &translate_colspec($2, $celltag);
s/$next_pair_pr_rx/$text=$2;''/eo;
$text = &translate_commands($text) if ($text =~ /\\/);
$text;
}
sub do_cmd_multirow {
local($_) = @_;
local($dmy1,$dmy2,$dmy3,$dmy4,$spanrows,$pxs,$rwidth,$valign,$vspec,$text);
$spanrows = &missing_braces unless (
(s/$next_pair_pr_rx/$spanrows=$2;''/eo)
||(s/$next_pair_rx/$spanrows=$2;''/eo));
my $rowspan = 0+$spanrows;
# set the counter for this column to the number of rows covered
@row_spec[$i] = $rowspan;
$colspec =~ /^<([A-Z]+)/;
local($celltag) = $1;
# read the width, save it for later use
$rwidth = &missing_braces unless (
(s/$next_pair_pr_rx/$rwidth=$2;''/eo)
||(s/$next_pair_rx/$rwidth=$2;''/eo));
# catch cases where the \textwidth has been discarded
$rwidth =~s!^(\w)($OP\d+$CP)\s*(\d|\d*\.\d+)\2$!$1\{$3\\textwidth\}!;
($pxs,$rwidth) = &convert_length($rwidth);
$valign = &missing_braces unless (
(s/$next_pair_pr_rx/$valign=$2;''/eo)
||(s/$next_pair_rx/$valign=$2;''/eo));
$vspec = ' VALIGN="TOP"' if $valign;
if ($valign =~ /m/i) { $vspec =~ s/TOP/MIDDLE/ }
elsif ($valign =~ /b/i) { $vspec =~ s/TOP/BOTTOM/ }
$colspec =~ s/VALIGN="\w+"// if $vspec; # avoid duplicate tags
$colspec =~ s/>$content_mark/$vspec ROWSPAN=$rowspan WIDTH=$pxs$&/;
s/$next_pair_pr_rx/$text=$2;''/eo;
$text = &translate_commands($text) if ($text =~ /\\/);
$text;
}
## Mathematics environments
sub process_math_env {
local($mode,$_) = @_;
local($labels, $comment);
($_,$labels) = &extract_labels($_); # extract labels
$comment = &make_math_comment($_);
local($max_id) = ++$global{'max_id'};
if ($failed) { return($labels, $comment, $_) };
$_ = &simple_math_env($_);
if ($BOLD_MATH) { ($labels, $comment, join('',"", $_, ""))
} else { ($labels, $comment, $_ ) }
}
sub make_math_comment{
local($_) = @_;
local($scomm,$ecomm)=("\$","\$");
return() if ($inside_tabbing||(/$image_mark/));
do {
$scomm = "\\begin{$env}\n";
$ecomm = "\n\\end{$env}";
} unless ($env =~/tex2html/);
$_ = &revert_to_raw_tex;
$* = 1; s/^\s+//s; s/\s+$//s; $* = 0;
$_ = $scomm . $_ . $ecomm;
return() if (length($_) < 16);
$global{'verbatim_counter'}++;
$verbatim{$global{'verbatim_counter'}} = $_;
&write_mydb('verbatim_counter', $global{'verbatim_counter'}, $_ );
join('', "\n", $verbatim_mark, '#math' , $global{'verbatim_counter'},'#')
}
sub do_env_math {
local($_) = @_;
local($math_mode, $failed, $labels, $comment, $img_params) = ("inline",'','');
$failed = (/$htmlimage_rx|$htmlimage_pr_rx/); # force an image
local($attribs, $border);
if (s/$htmlborder_rx//o) { $attribs = $2; $border = (($4)? "$4" : 1) }
elsif (s/$htmlborder_pr_rx//o) { $attribs = $2; $border = (($4)? "$4" : 1) }
local($saved) = $_;
$saved =~ s/^\s*(\$|\\\()?\s*/\$/;
$saved =~ s/\s*(\$|\\\))?\s*$/\$/;
($labels, $comment, $_) = &process_math_env($math_mode,$_);
$comment =~ s/^\n//; # remove the leading \n
if ($failed) {
$_ = join ('', $comment, $labels
, &process_undefined_environment("tex2html_wrap_inline", $id, $saved));
} else { $_ = join('', $comment, $labels, " ", $_ ); }
if ($border||($attributes)) {
&make_table( $border, $attribs, '', '', '', $_ )
} else { $_ }
}
sub do_env_tex2html_wrap {
local($_) = @_;
local($math_mode, $failed, $labels, $comment,$img_params) = ("inline",'','');
$failed = (/$htmlimage_rx|$htmlimage_pr_rx/); # force an image
local($attribs, $border);
if (s/$htmlborder_rx//o) { $attribs = $2; $border = (($4)? "$4" : 1) }
elsif (s/$htmlborder_pr_rx//o) { $attribs = $2; $border = (($4)? "$4" : 1) }
local($saved) = $_;
s/^\\\(//; s/\\\)$//;
($labels, $comment, $_) = &process_math_env($math_mode,$_);
$comment =~ s/^\n//; # remove the leading \n
if ($failed) {
$_ = join ('', $comment, $labels
, &process_undefined_environment("tex2html_wrap", $id, $saved));
} else { $_ = $comment . $labels ." ".$_; }
if ($border||($attribs)) {
&make_table( $border, $attribs, '', '', '', $_ )
} else { $_ }
}
sub do_env_tex2html_wrap_inline {
local($_) = @_;
local($math_mode, $failed, $labels, $comment) = ("inline",'','');
$failed = (/$htmlimage_rx|$htmlimage_pr_rx/); # force an image
local($attribs, $border);
if (s/$htmlborder_rx//o) { $attribs = $2; $border = (($4)? "$4" : 1) }
elsif (s/$htmlborder_pr_rx//o) { $attribs = $2; $border = (($4)? "$4" : 1) }
local($saved) = $_;
s/(^\s*(\$|\\\()\s*|\s*(\$|\\\))\s*$)//g; # remove the \$ signs or \(..\)
($labels, $comment, $_) = &process_math_env($math_mode,$_);
$comment =~ s/^\n//; # remove the leading \n
if ($failed) {
$_ = join ('', $labels, $comment
, &process_undefined_environment("tex2html_wrap_inline", $id, $saved));
} else { $_ = join('', $labels, $comment, $_); }
if ($border||($attribs)) {
&make_table( $border, $attribs, '', '', '', $_ )
} else { $_ }
}
# Allocate a fixed width for the equation-numbers:
#$seqno = "\n\n";
sub do_env_equation {
local($_) = @_;
local($math_mode, $failed, $labels, $comment) = ("equation",'','');
$failed = (/$htmlimage_rx|$htmlimage_pr_rx/); # force an image
local($attribs, $border);
if (s/$htmlborder_rx//o) { $attribs = $2; $border = (($4)? "$4" : 1) }
elsif (s/$htmlborder_pr_rx//o) { $attribs = $2; $border = (($4)? "$4" : 1) }
local($saved) = $_;
local($sbig,$ebig,$falign) = ('','','CENTER');
($sbig,$ebig) = ('','')
if (($DISP_SCALE_FACTOR)&&($DISP_SCALE_FACTOR >= 1.2 ));
local($math_start,$math_end)= ($sbig,$ebig);
local($eqno);
local($seqno) = join('',"\n | \n");
$* = 1;
do { # get the equation number
$global{'eqn_number'}++;
$eqno = &translate_commands('\theequation');
} unless ((s/(\\nonumber|\\notag)//g)||(/\\tag/));
if (/\\tag(\*)?/){
# AmS-TEX line-number tags.
if (defined &get_eqn_number ) {
($eqno, $_) = &get_eqn_number(1,$_);
} else {
s/\\tag(\*)?//;
local($nobrack,$before) = ($1,$`);
$_ = $';
s/next_pair_pr_rx//o;
if ($nobrack) { $eqno = $2; }
else { $eqno = join('',$EQNO_START, $2, $EQNO_END) };
$_ = $before;
}
} elsif ($eqno) {
$eqno = join('',$EQNO_START, $eqno, $EQNO_END)
} else { $eqno = ' ' } # spacer, when no numbering
$* = 0;
# include the equation-number, using a
local($halign) = $math_class unless $FLUSH_EQN;
if ($EQN_TAGS =~ /L/) {
# equation number on left
($math_start,$math_end) =
("\n\n". $seqno . $eqno
. "\n$sbig"
, "$ebig | \n ");
$border = $attribs = '';
} else {
# equation number on right
($math_start,$math_end) =
("\n\n | "
. "$sbig"
, $ebig .' | '. $seqno . $eqno ." \n ");
$border = $attribs = '';
}
($labels, $comment, $_) = &process_math_env($math_mode,$_);
if ($failed) {
$_ = join ('', $comment, $math_start
, &process_undefined_environment('displaymath', $id, $saved)
, $math_end );
} else {
s/^[ \t]*\n?/\n/; s/\n?[ \t]*$/\n/;
$_ = join('', $comment, $labels, $math_start, $_, $math_end );
}
if ($border||($attribs)) {
join(''," \n\n"
, &make_table( $border, $attribs, '', '', '', $_ )
, "\n ");
} elsif ($failed) {
$falign = (($EQN_TAGS =~ /L/)? 'LEFT' : 'RIGHT') if ($eqno);
local($fclass) = $math_class;
$fclass =~ s/(ALIGN=\")[^"]*/$1$falign/;
join(''," \n \n"
, $_ , "\n
")
} else {
join('', " \n \n"
, $_ ."\n ");
}
}
sub do_env_displaymath {
local($_) = @_;
local($math_mode, $failed, $labels, $comment) = ("display",'','');
$failed = (/$htmlimage_rx|$htmlimage_pr_rx/); # force an image
local($attribs, $border);
if (s/$htmlborder_rx//o) { $attribs = $2; $border = (($4)? "$4" : 1) }
elsif (s/$htmlborder_pr_rx//o) { $attribs = $2; $border = (($4)? "$4" : 1) }
local($saved) = $_;
local($halign) = $math_class unless $FLUSH_EQN;
local($sbig,$ebig);
($sbig,$ebig) = (' ','')
if (($DISP_SCALE_FACTOR)&&($DISP_SCALE_FACTOR >= 1.2 ));
($labels, $comment, $_) = &process_math_env($math_mode,$_);
if ($failed) {
$_ = &process_undefined_environment("displaymath", $id, $saved);
s/^[ \t]*\n?/\n/; s/\n?[ \t]*$/\n/;
$_ = (($comment.$labels)? "$comment$labels\n":''). $_;
} else {
s/^[ \t]*\n?/\n/; s/\n?[ \t]*$/\n/;
$_ = (($comment.$labels)? "$comment$labels\n":'').$sbig.$_.$ebig;
}
if ($border||($attribs)) {
join(''," \n \n"
, &make_table( $border, $attribs, '', '', '', $_ )
, " \n ");
} else {
join(''," \n ",$_
," \n ");
}
}
### Multiline formulas
sub do_env_eqnarray {
local($_) = @_;
local($math_mode, $failed, $labels, $comment, $doimage) = ("equation",'','');
local($attribs, $border);
if (s/$htmlborder_rx//o) { $attribs = $2; $border = (($4)? "$4" : 1) }
elsif (s/$htmlborder_pr_rx//o) { $attribs = $2; $border = (($4)? "$4" : 1) }
local($saved) = $_;
local($sbig,$ebig,$falign) = ('','','CENTER');
($sbig,$ebig) = (' ','')
if (($DISP_SCALE_FACTOR)&&($DISP_SCALE_FACTOR >= 1.2 ));
local($valign) = join('', ' VALIGN="',
($NETSCAPE_HTML)? "BASELINE" : "MIDDLE", '"');
$failed = 1; # simplifies the next call
($labels, $comment, $_) = &process_math_env($math_mode,$_);
$failed = 0 unless ($no_eqn_numbers);
if ((($failed)&&($NO_SIMPLE_MATH))
||(/$htmlimage_rx|$htmlimage_pr_rx/)) {
# ||((/$htmlimage_rx|$htmlimage_pr_rx/)&&($& =~/thumb/))) {
# image of whole environment, no equation-numbers
$failed = 1;
$falign = (($EQN_TAGS =~ /L/)? 'LEFT' : 'RIGHT')
unless $no_eqn_numbers;
$_ = join ('', $comment
, &process_undefined_environment(
"eqnarray".(($no_eqn_numbers) ? "star" : '')
, $id, $saved));
local($fclass) = $math_class;
$fclass =~ s/(ALIGN=\")[^"]*/$1$falign/;
$_ = join(''," ", $_, " \n");
} else {
$failed = 0;
s/$htmlimage_rx/$doimage = $&;''/eo ; # force an image
s/$htmlimage_pr_rx/$doimage .= $&;''/eo ; # force an image
local($sarray, $srow, $slcell, $elcell, $srcell, $ercell, $erow, $earray);
($sarray, $elcell, $srcell, $erow, $earray, $sempty) = (
"\n ", "\n " );
$sarray .= (($no_eqn_numbers) ? ">" : " WIDTH=\"100%\">" );
local($seqno) = join('',"\n | \n");
if ($EQN_TAGS =~ /L/) { # number on left
($srow, $slcell, $ercell) = (
"\n | " . $seqno
, "\n"
, " | ")
, (($doimage)? '' : "\n ")
, (($labels)? $labels : "\n") , $comment, $sarray);
foreach (@rows) { # displaymath
$eqno = '';
do {
$global{'eqn_number'}++ ;
$eqno = &simplify(&translate_commands('\theequation'));
} unless ((s/\\nonumber//)||($no_eqn_numbers));
if (/\\tag(\*)?/){
if (defined &get_eqn_number) {
# AmS-TEX line-number tags.
($eqno, $_) = &get_eqn_number(1,$_);
} else {
s/\\tag(\*)?//;
local($nobrack,$before) = ($1,$`);
$_ = $';
s/next_pair_pr_rx//o;
if ($nobrack) { $eqno = $2 }
else { $eqno = join('',$EQNO_START,$2,$EQNO_END) }
$_ = $before;
}
} elsif ($eqno) {
$eqno = join('',$EQNO_START, $eqno, $EQNO_END)
} else { $eqno = ' ' } # spacer, when no numbering
$return .= $srow;
$return .= $eqno if ($EQN_TAGS =~ /L/);
$return .= $slcell;
# if (s/\\lefteqn$OP(\d+)$CP(.*)$OP\1$CP/ $2 /) {
if (s/\\lefteqn//) {
$return .= "\"LEFT\" COLSPAN=\"3\">";
$* =1; s/(^\s*|$html_specials{'&'}|\s*$)//g; $*=0;
if (($NO_SIMPLE_MATH)||($doimage)||($failed)) {
$_ = (($_)? &process_math_in_latex(
"indisplay" , '', '', $doimage.$_ ):'');
$return .= join('', $_, $erow) if ($_);
} elsif ($_ ne '') {
$savemath = $_; $failed = 0;
$_ = &simple_math_env($_);
if ($failed) {
$_ = &process_math_in_latex(
"indisplay",'','',$savemath);
$return .= join('', $_, $erow) if ($_);
} elsif ($_ ne '') {
$return .= join('', $sbig, $_, $ebig, $erow)
}
}
$return .= join('',";SPMnbsp;", $erow) if ($_ eq '');
next;
}
# columns to be set using math-modes
@cols = split(/$html_specials{'&'}/o);
# left column, set using \displaystyle
$thismath = shift(@cols); $failed = 0;
$* =1; $thismath =~ s/(^\s*|\s*$)//g; $*=0;
if (($NO_SIMPLE_MATH)||($doimage)||($failed)) {
$thismath = (($thismath ne '')? &process_math_in_latex(
"indisplay" , '', '', $doimage.$thismath ):'');
$return .= join('',"\"RIGHT\">",$thismath) if ($thismath ne '');
} elsif ($thismath ne '') {
$savemath = $thismath;
$thismath = &simple_math_env($thismath);
if ($failed) {
$thismath = &process_math_in_latex(
"indisplay",'','',$savemath);
$return .= join('',"\"RIGHT\">",$thismath)
} elsif ($thismath ne '') {
$return .= join('',"\"RIGHT\">$sbig",$thismath,"$ebig")
}
}
$return .= "\"RIGHT\">\ " if ($thismath eq '');
# center column, set using \textstyle
$thismath = shift(@cols); $failed = 0;
$* =1; $thismath =~ s/(^\s*|\s*$)//g; $*=0;
if (($NO_SIMPLE_MATH)||($doimage)||($failed)) {
$thismath = (($thismath ne '')? &process_math_in_latex(
"indisplay" , 'text', '', $doimage.$thismath ):'');
$return .= join('', $elcell, $thismath) if ($thismath ne '');
} elsif ($thismath ne '') {
$savemath = $thismath;
$thismath = &simple_math_env($thismath);
if ($failed) {
$thismath = &process_math_in_latex(
"indisplay",'text','',$savemath);
$return .= join('', $elcell, $thismath)
} elsif ($thismath ne '') {
$return .= join('', $elcell, $sbig , $thismath, $ebig)
}
}
$return .= join('', $sempty,"\ ") if ($thismath eq '');
# right column, set using \displaystyle
$thismath = shift(@cols); $failed = 0;
$* =1; $thismath =~ s/(^\s*|\s*$)//g; $*=0;
if (($NO_SIMPLE_MATH)||($doimage)||($failed)) {
$thismath = (($thismath ne '')? &process_math_in_latex(
"indisplay" , '', '', $doimage.$thismath ):'');
$return .= join('', $srcell, $thismath, $ercell)
if ($thismath ne '');
} elsif ($thismath ne '') {
$savemath = $thismath;
$thismath = &simple_math_env($thismath);
if ($failed) {
$thismath = &process_math_in_latex(
"indisplay",'','',$savemath);
$return .= join('', $srcell, $thismath, $ercell)
} elsif ($thismath ne '') {
$return .= join('', $srcell, $sbig, $thismath, $ebig, $ercell)
}
}
$return .= join('', $sempty, "\ ", $ercell) if ($thismath eq '');
$return .= $eqno unless ($EQN_TAGS =~ /L/);
$return .= $erow;
}
$_ = join('', $return , $earray, (($doimage)? '' : " " ));
}
if ($border||($attribs)) {
join('' #," \n"
, &make_table( $border, $attribs, '', '', '', $_ )
, "\n ");
} else {
join('', $_ ," ");
}
}
sub do_env_eqnarraystar {
local($_) = @_;
local($math_mode, $failed, $labels, $comment) = ("equation",'','');
$failed = (/$htmlimage_rx|$htmlimage_pr_rx/); # force an image
local($attribs, $border);
local($saved) = $_;
local($sbig,$ebig);
($sbig,$ebig) = ('','')
if (($DISP_SCALE_FACTOR)&&($DISP_SCALE_FACTOR >= 1.2 ));
if (($NO_SIMPLE_MATH)||($failed)) {
local($no_eqn_numbers) = 1;
$_ = &do_env_eqnarray($_) unless ($failed);
if ($failed) {
if ($saved =~ s/$htmlborder_rx//o) {
$attribs = $2; $border = (($4)? "$4" : 1)
} elsif ($saved =~ s/$htmlborder_pr_rx//o) {
$attribs = $2; $border = (($4)? "$4" : 1)
}
$_ = join('', $labels
, &process_undefined_environment("eqnarray*", $id, $saved));
}
} else {
if (s/$htmlborder_rx//o) {
$attribs = $2; $border = (($4)? "$4" : 1)
} elsif (s/$htmlborder_pr_rx//o) {
$attribs = $2; $border = (($4)? "$4" : 1)
}
$saved = $_;
($labels, $comment, $_) = &process_math_env($math_mode,$_);
if ($failed) {
$_ = join('', $labels
, &process_undefined_environment("eqnarray*", $id, $saved));
}
}
if ($border||($attribs)) {
join('' #," \n"
, &make_table( $border, $attribs, '', '', '', $_ )
, "\n ");
} elsif ($failed) {
$_ =~ s/^[ \t]*\n?/\n/;
$_ =~ s/\n?[ \t]*/\n/;
join('', " \n"
, $_ ,"\n ");
} elsif ($_ =~ s!( | )\s*( ]*>)?\s*$!$1!si) {
join('', $_ ," \n");
} elsif ($_ =~ m!\s*$!si) { # below-display space present
$_
} else {
join('', $_ ," ");
}
}
$raw_arg_cmds{tabular} = 1;
$raw_arg_cmds{tabularstar} = 1;
$raw_arg_cmds{longtable} = 1;
$raw_arg_cmds{longtablestar} = 1;
$raw_arg_cmds{supertabular} = 1;
$raw_arg_cmds{supertabularstar} = 1;
#RRM: this package is automatically supported for {tabular} extensions
# so suppress the warning message:
$styles_loaded{'array'} = 1;
&ignore_commands( <<_IGNORED_CMDS_);
extracolsep # {}
PreserveBackslash # {}
_IGNORED_CMDS_
&process_commands_wrap_deferred (<<_RAW_ARG_DEFERRED_CMDS_);
tablehead # {}
tabletail # {}
centerline # {}
leftline # {}
rightline # {}
_RAW_ARG_DEFERRED_CMDS_
1;
|