--- loncom/xml/londefdef.pm	2010/08/16 16:14:32	1.415.4.1
+++ loncom/xml/londefdef.pm	2010/08/04 14:20:26	1.419
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Tags Default Definition Module 
 #
-# $Id: londefdef.pm,v 1.415.4.1 2010/08/16 16:14:32 raeburn Exp $
+# $Id: londefdef.pm,v 1.419 2010/08/04 14:20:26 raeburn Exp $
 # 
 #
 # Copyright Michigan State University Board of Trustees
@@ -2048,36 +2048,26 @@ sub start_table {
 	my $width  = &Apache::lonxml::get_param('TeXwidth', $parstack, $safeeval, undef, 0);
 	my $theme  = &Apache::lonxml::get_param('TeXtheme', $parstack, $safeeval, undef, 0);
 	my $align  = &Apache::lonxml::get_param('align', $parstack, $safeeval, undef, 0);
-        my $cell_border = &Apache::lonxml::get_param('rules', $parstack, $safeeval, undef, 0);
 
 	# The only thing that needs any figuring out is the width.. and then only if it is
 	# a percent. If not it's assumed to be some valid TeX measurement unit e.g. 3.0cm
 	#
 
 	my $table = new Apache::lontable();
-        if ((defined $border) && ($border > 0)) {
-        #    &Apache::lonnet::logthis("Turning on table borders: $border");
-            $table->table_border(1);
-            if ($cell_border ne 'none') {
-                $table->cell_border(1); # html specs that border turns on both...unless rules='none'.
-            }
-        }
-        # Only all or nothing for cell borders for now:
-
-        if ((defined $cell_border) && ($cell_border ne 'none')) {
-        #    &Apache::lonnet::logthis("Turning on cell borders: $cell_border");
+	if ($border ne '' && $border != 0) {
+	    $table->table_border(1);
 	    $table->cell_border(1);
 	}
-        if (defined $theme) {
+	if ($theme ne '') {
 	    $table->theme($theme);
 	}
-	if (defined $align) {
+	if ($align ne '') {
 	    $table->alignment($align);
 	}
 
 	# Missing width is most of page width
 
-	if (!(defined $width)) {
+	if ($width eq "") {
 	    $width = '70%';
 	}
 	
@@ -3169,24 +3159,13 @@ sub start_img {
    # Render unto browsers that which are the browser's...
 
     if ($target eq 'web' || $target eq 'webgrade') {
-	if ($env{'browser.imagesuppress'} ne 'on') {
-	    my $enc = ('yes' eq 
-		       lc(&Apache::lonxml::get_param('encrypturl',$parstack,
-						     $safeeval)));
-	    $currentstring.=&Apache::lonenc::encrypt_ref($token,{'src'=>$src},
-							 $enc);
-	} else {
-	    my $alttag = &Apache::lonxml::get_param('alt',$parstack,$safeeval,
-						    undef,1);
-	    if (!$alttag) {
-		$alttag = &Apache::lonmeta::alttag($Apache::lonxml::pwd[-1],
-						   $src);
-	    }
-	    $currentstring.='[IMAGE: '.$alttag.']';
-	}
-
-	# and render unto TeX that which is LaTeX
+        my $enc = ('yes' eq 
+                   lc(&Apache::lonxml::get_param('encrypturl',$parstack,
+                      $safeeval)));
+        $currentstring.=&Apache::lonenc::encrypt_ref($token,{'src'=>$src},
+                         $enc);
 
+    # and render unto TeX that which is LaTeX
     } elsif ($target eq 'tex') {
 	#
 	#  The alignment will require some superstructure to be put around
@@ -3287,7 +3266,7 @@ sub start_img {
 						   ['', 'none','parbox', 'parpic', 'wrapfigure'], $token, 2);
         my $alt=    &Apache::lonxml::get_param('alt',$parstack,$safeeval);
         my $enc=    &Apache::lonxml::get_param('encrypturl',$parstack,$safeeval);
-
+ 
 	$currentstring .=&Apache::edit::select_arg('Encrypt URL:','encrypturl',
 						   ['no','yes'], $token, 2);
         if (($alt=~/\S/) && (lc($enc) eq 'yes')) {
@@ -3301,10 +3280,10 @@ sub start_img {
         if ($token->[2]{'src'}=~/\$/) {
            $currentstring.=&mt('Variable image source');
         } elsif ($token->[2]{'src'}=~/\S/) {
-           $currentstring .= '<img src="'.$src.'" alt="'.$alt.'" ';
-           if ($width) { $currentstring.=' width="'.$width.'" '; }
-           if ($height) { $currentstring.=' height="'.$height.'" '; }
-           $currentstring .= ' />';
+	   $currentstring .= '<img src="'.$src.'" alt="'.$alt.'" ';
+	   if ($width) { $currentstring.=' width="'.$width.'" '; }
+	   if ($height) { $currentstring.=' height="'.$height.'" '; }
+	   $currentstring .= ' />';
         } else {
            $currentstring.=&mt("No image source specified");
         }
@@ -3375,23 +3354,12 @@ sub start_applet {
     &Apache::lonxml::extlink($archive);
     my $currentstring = '';
     if ($target eq 'web' || $target eq 'webgrade') {
-	if ($env{'browser.appletsuppress'} ne 'on') {
-	    $currentstring = &Apache::lonenc::encrypt_ref($token,
-							  {'code'=>$code,
-							   'archive'=>$archive}
-							  );
-	} else {
-	    my $alttag= &Apache::lonxml::get_param('alt',$parstack,
-						   $safeeval,undef,1);
-	    unless ($alttag) {
-		$alttag=&Apache::lonmeta::alttag($Apache::lonxml::pwd[-1],
-						 $code);
-	    }
-	    $currentstring='[APPLET: '.$alttag.']';
-	}
+        $currentstring = &Apache::lonenc::encrypt_ref($token,
+                                                      {'code'=>$code,
+                                                       'archive'=>$archive}
+                                                     );
     } elsif ($target eq 'tex') {
-	# Turn off some stuff we can't be inside thank you LaTeX
-	
+        # Turn off some stuff we can't be inside thank you LaTeX
 
 	my $restart_sub = 0;
 	my $restart_sup = 0;
@@ -3455,16 +3423,7 @@ sub start_embed {
     &Apache::lonxml::extlink($src);
     my $currentstring = '';
     if ($target eq 'web' || $target eq 'webgrade') {
-	if ($env{'browser.embedsuppress'} ne 'on') {
-	    $currentstring=&Apache::lonenc::encrypt_ref($token,{'src'=>$src});
-	} else {
-	    my $alttag=&Apache::lonxml::get_param
-		('alt',$parstack,$safeeval,undef,1);
-	    unless ($alttag) {
-		$alttag=&Apache::lonmeta::alttag($Apache::lonxml::pwd[-1],$src);
-	    }
-	    $currentstring='[EMBED: '.$alttag.']';
-	}
+    $currentstring=&Apache::lonenc::encrypt_ref($token,{'src'=>$src}); 
     } elsif ($target eq 'tex') {
     } 
     return $currentstring;
@@ -3474,9 +3433,10 @@ sub end_embed {
     my ($target,$token) = @_;
     my $currentstring = '';
     if ($target eq 'web' || $target eq 'webgrade') {
-	$currentstring = $token->[2];     
-    } elsif ($target eq 'tex') {  
-    } 
+        $currentstring = $token->[2];
+    } elsif ($target eq 'tex') {
+        # ./.
+    }
     return $currentstring;
 }
 
@@ -3914,12 +3874,16 @@ sub end_colgroup {
     return $currentstring;
 }
 
+
 #-- <del> tag (end tag required)
 sub start_del {
     my ($target,$token) = @_;
     my $currentstring = '';
     if ($target eq 'web' || $target eq 'webgrade') {
 	$currentstring = $token->[4];     
+    } elsif ($target eq 'tex') {
+	&disable_para();
+	$currentstring .= '\st{';  
     } 
     return $currentstring;
 }
@@ -3928,7 +3892,10 @@ sub end_del {
     my ($target,$token) = @_;
     my $currentstring = '';
     if ($target eq 'web' || $target eq 'webgrade') {
-	$currentstring = $token->[2];    
+	$currentstring = $token->[2];     
+    } elsif ($target eq 'tex') {
+	&enable_para();
+	$currentstring = '}';
     } 
     return $currentstring;
 }
@@ -4864,6 +4831,7 @@ sub latex_header {
 	"\\usepackage{xcolor}\n".
 	'\usepackage{calc}'.
 	'\usepackage{amsmath}'.
+    '\usepackage{soul}',
 	'\usepackage{amssymb}'.
 	'\usepackage{amsfonts}'.
 	'\usepackage{amsthm}'.