--- loncom/xml/londefdef.pm 2003/04/18 15:14:18 1.130 +++ loncom/xml/londefdef.pm 2003/05/07 17:24:16 1.132 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Tags Default Definition Module # -# $Id: londefdef.pm,v 1.130 2003/04/18 15:14:18 sakharuk Exp $ +# $Id: londefdef.pm,v 1.132 2003/05/07 17:24:16 sakharuk Exp $ # # # Copyright Michigan State University Board of Trustees @@ -1697,7 +1697,7 @@ sub end_dd { sub start_table { my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_; my $textwidth; - if ($#Apache::londefdef::table==0) { + if (not defined @Apache::londefdef::table) { $textwidth=&recalc($ENV{'form.textwidth'}); $textwidth=~/(\d+)/; $textwidth=$1; @@ -1742,7 +1742,7 @@ sub start_table { $Apache::londefdef::table[-1]{'vvinc'} = ''; } $Apache::londefdef::table[-1]{'output'} = ' \noindent \begin{tabular} '; - $currentstring = '\keephidden{NEW TABLE ENTRY}'; + $currentstring = '\keephidden{NEW TABLE ENTRY '.$textwidth.'}'; } return $currentstring; } @@ -1894,7 +1894,7 @@ sub end_td { } else { if ($data=~m/width\s*=\s*(\d+\.?\d*\s*(mm|cm|in|pc|pt)*)/) { my $current_length=&recalc($1); - $current_length=~/(\d+)/; + $current_length=~/(\d+\.?\d*)/; $Apache::londefdef::table[-1]{'TeXlength'} .= $1.','; $Apache::londefdef::table[-1]{'length'} .= '0,'; } else { @@ -3123,7 +3123,7 @@ sub image_replication { sub recalc { my $argument = shift; if (not $argument=~/(mm|cm|in|pc|pt)/) {return $argument.' mm';} - $argument=~/\s*(\d+)\s*(mm|cm|in|pc|pt)/; + $argument=~/\s*(\d+\.?\d*)\s*(mm|cm|in|pc|pt)/; my $value=$1; my $units=$2; if ($units eq 'cm') {