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

albertel lon-capa-cvs@mail.lon-capa.org
Mon, 09 Jan 2006 22:54:47 -0000


albertel		Mon Jan  9 17:54:47 2006 EDT

  Modified files:              (Branch: version_2_1_X)
    /loncom/xml	londefdef.pm 
  Log:
  - backport 1.311
  
  
Index: loncom/xml/londefdef.pm
diff -u loncom/xml/londefdef.pm:1.302.2.1 loncom/xml/londefdef.pm:1.302.2.2
--- loncom/xml/londefdef.pm:1.302.2.1	Wed Jan  4 18:15:52 2006
+++ loncom/xml/londefdef.pm	Mon Jan  9 17:54:47 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Tags Default Definition Module 
 #
-# $Id: londefdef.pm,v 1.302.2.1 2006/01/04 23:15:52 albertel Exp $
+# $Id: londefdef.pm,v 1.302.2.2 2006/01/09 22:54:47 albertel Exp $
 # 
 #
 # Copyright Michigan State University Board of Trustees
@@ -1961,11 +1961,16 @@
 
 	# width either comes forced from the TeXwidth or the width parameters.
 	# in either case it can be a percentage or absolute width.
-
+	# in the width case we ignore absolute width 
 	my $TeXwidth = &Apache::lonxml::get_param('TeXwidth',$parstack,$safeeval,undef,0);
 	if (!defined($TeXwidth)) {
-	    $TeXwidth = &Apache::lonxml::get_param('width',$parstack,$safeeval,undef,1);
-	    if (!defined($TeXwidth)) { $TeXwidth = $textwidth; }
+	    my $htmlwidth = &Apache::lonxml::get_param('width',$parstack,
+						       $safeeval,undef,1);
+	    if ($htmlwidth =~ /%/) {
+		$TeXwidth = $htmlwidth;
+	    } else { 
+		$TeXwidth = $textwidth;
+	    }
 	} else {
 	    $Apache::londefdef::table[-1]{'forcedtablewidth'} = 1;
 	}