tag (end tag optional)
sub start_tr {
my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
my $currentstring = '';
@@ -1851,7 +1858,7 @@ sub end_tr {
return $currentstring;
}
-#-- tag
+#-- | tag (end tag optional)
sub start_td {
my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
my $currentstring = '';
@@ -1887,16 +1894,30 @@ sub end_td {
if ($data=~m/width\s*=\s*(\d+\.?\d*\s*(mm|cm|in|pc|pt)*)/) {
my $current_length=&recalc($1);
$current_length=~/(\d+\.?\d*)/;
- $Apache::londefdef::table[-1]{'TeXlength'} .= $1.',';
- $Apache::londefdef::table[-1]{'length'} .= '0,';
- } else {
- $data=~s/^\s+(\S.*)/$1/;
- $data=~s/(.*\S)\s+$/$1/;
- my $current_length=2*length($data);
- $Apache::londefdef::table[-1]{'length'} .= $current_length.',';
- $Apache::londefdef::table[-1]{'TeXlength'} .= '0,';
- }
- }
+ $Apache::londefdef::table[-1]{'TeXlength'} .= $1.',';
+ $Apache::londefdef::table[-1]{'length'} .= '0,';
+ } else {
+ $data=~s/^\s+(\S.*)/$1/;
+ $data=~s/(.*\S)\s+$/$1/;
+ $data=~s/(\s)+/$1/;
+ my $current_length=0;
+ if ($data=~/\\vskip/) {
+ my $newdata=$data;
+ $newdata=~s/\\vskip \d*\.?\d*\s*mm/THISISJUSTTEMPORARYSEPARATOR/g;
+ my @newdata=split(/THISISJUSTTEMPORARYSEPARATOR/,$newdata);
+ foreach my $elementdata (@newdata) {
+ $elementdata=~s/^\s+(\S.*)/$1/;
+ $elementdata=~s/(.*\S)\s+$/$1/;
+ $elementdata=~s/(\s)+/$1/;
+ my $lengthnewdata=1.8*length($elementdata);
+ if ($lengthnewdata>$current_length) {$current_length=$lengthnewdata;}
+ }
+ } else {
+ $current_length=1.8*length($data);
+ }
+ $Apache::londefdef::table[-1]{'length'} .= $current_length.',';
+ $Apache::londefdef::table[-1]{'TeXlength'} .= '0,';
+ }
for (my $in=0; $in<=$#{$Apache::londefdef::table[-1]{'include'}};$in++) {
$data=~s/\\keephidden\{NEW TABLE ENTRY\}/$Apache::londefdef::table[-1]{'include'}[$in]/;
}
@@ -1905,7 +1926,7 @@ sub end_td {
return $currentstring;
}
-#-- | tag
+#-- | tag (end tag optional)
sub start_th {
my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
my $currentstring = '';
@@ -3036,7 +3057,7 @@ sub end_tbody {
return $currentstring;
}
-#-- |