[LON-CAPA-cvs] cvs: loncom(version_1_0_1) /xml londefdef.pm

albertel lon-capa-cvs@mail.lon-capa.org
Tue, 02 Sep 2003 21:31:11 -0000


albertel		Tue Sep  2 17:31:11 2003 EDT

  Modified files:              (Branch: version_1_0_1)
    /loncom/xml	londefdef.pm 
  Log:
  - fixing my backport of 1.166
  
  
Index: loncom/xml/londefdef.pm
diff -u loncom/xml/londefdef.pm:1.158.4.5 loncom/xml/londefdef.pm:1.158.4.6
--- loncom/xml/londefdef.pm:1.158.4.5	Tue Sep  2 10:30:31 2003
+++ loncom/xml/londefdef.pm	Tue Sep  2 17:31:11 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Tags Default Definition Module 
 #
-# $Id: londefdef.pm,v 1.158.4.5 2003/09/02 14:30:31 albertel Exp $
+# $Id: londefdef.pm,v 1.158.4.6 2003/09/02 21:31:11 albertel Exp $
 # 
 #
 # Copyright Michigan State University Board of Trustees
@@ -1894,30 +1894,31 @@
 	    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/;
-	    $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,';
-  	}
+		$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]/;
 	}