--- loncom/xml/londefdef.pm 2008/09/05 11:23:06 1.391 +++ loncom/xml/londefdef.pm 2008/12/11 23:57:04 1.396.2.1 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Tags Default Definition Module # -# $Id: londefdef.pm,v 1.391 2008/09/05 11:23:06 onken Exp $ +# $Id: londefdef.pm,v 1.396.2.1 2008/12/11 23:57:04 raeburn Exp $ # # # Copyright Michigan State University Board of Trustees @@ -107,13 +107,13 @@ sub start_m { my $eval=&Apache::lonxml::get_param('eval',$parstack,$safeeval); if ($eval eq 'on') { $inside=&Apache::run::evaluate($inside,$safeeval,$$parstack[-1]); - #&Apache::lonxml::debug("M is evaulated to:$inside:"); + #&Apache::lonxml::debug("M is evaluated to:$inside:"); } my $tex = $inside; my $display=&Apache::lonxml::get_param('display',$parstack,$safeeval); $currentstring = &Apache::lontexconvert::converted(\$inside,$display); if ($Apache::lontexconvert::errorstring) { - my $errormsg='
'.&HTML::Entities::encode($Apache::lontexconvert::errorstring,'<>&"').'
occured while attempting to convert this TeX:
';
+	    my $errormsg='
'.&HTML::Entities::encode($Apache::lontexconvert::errorstring,'<>&"').'
occurred while attempting to convert this TeX:
';
 	    $tex = &HTML::Entities::encode($tex,'<>&"');
 	    my ($linenumber) =
 		($Apache::lontexconvert::errorstring =~ /Line (\d+)/);
@@ -139,7 +139,7 @@ sub start_m {
 	# detect simple math mode entry exits, and convert them
         # to use \ensuremath ... unless there's a \verb inside.
 	if (! ($currentstring=~/\\verb/)) {
-	    if ($currentstring=~/^\s*\$[^\$].*[^\$]\$\s*$/) {
+	    if ($currentstring=~/^\s*\$[^\$].*\$\s*$/) {
 		$currentstring=~s/^(\s*)\$/$1/;
 		$currentstring=~s/\$(\s*)$/$1/;
 		$currentstring='\ensuremath{'.$currentstring.'}';
@@ -202,6 +202,7 @@ sub start_html {
 			  '\usepackage{wrapfig}'.
 			  '\usepackage{picins}'.
 			  '\usepackage[T1]{fontenc}'."\n".
+                          '\usepackage{lmodern}'."\n".
 			  '\usepackage[postscript]{ucs}'."\n".
 			  '\usepackage[utf8x]{inputenc}'."\n".
 			  '\usepackage{pifont}' ."\n".
@@ -211,14 +212,7 @@ sub start_html {
                           '\usepackage{amsmath}'.
                           '\usepackage{amssymb}'.
                           '\usepackage{amsfonts}'.
-                          '\usepackage{amsthm}'.
-                          '\usepackage{amscd}';
-
-        if($env{'form.pdfFormFields'} eq 'yes') {
-            $currentstring .= '\usepackage{hyperref}'.
-                              '\usepackage{eforms}'.
-                              '\usepackage{tabularx}';
-        } 
+                          '\usepackage{amsthm}';
 
         $currentstring .= '\newenvironment{choicelist}{\begin{list}{}{\setlength{\rightmargin}{0in}\setlength{\leftmargin}{0.13in}\setlength{\topsep}{0.05in}\setlength{\itemsep}{0.022in}\setlength{\parsep}{0in}\setlength{\belowdisplayskip}{0.04in}\setlength{\abovedisplayskip}{0.05in}\setlength{\abovedisplayshortskip}{-0.04in}\setlength{\belowdisplayshortskip}{0.04in}}}{\end{list}}'.
                           '\renewenvironment{theindex}{\begin{list}{}{{\vskip 1mm \noindent \large\textbf{Index}} \newline \setlength{\rightmargin}{0in}\setlength{\leftmargin}{0.13in}\setlength{\topsep}{0.01in}\setlength{\itemsep}{0.1in}\setlength{\parsep}{-0.02in}\setlength{\belowdisplayskip}{0.01in}\setlength{\abovedisplayskip}{0.01in}\setlength{\abovedisplayshortskip}{-0.04in}\setlength{\belowdisplayshortskip}{0.01in}}}{\end{list}}';
@@ -609,7 +603,7 @@ sub edit_controls {
 &Apache::lonxml::renderingoptions().'
 
 
-
+

'; return $result; @@ -2025,6 +2019,7 @@ sub start_table { if ($target eq 'web' || $target eq 'webgrade') { $currentstring .= $token->[4]; } elsif ($target eq 'tex') { + &disable_para(); # Can't have paras in a table. push(@Apache::londefdef::table, {}); $Apache::londefdef::table[-1]{'row_number'} = -1; #maximum table's width (default coincides with text line length) @@ -2523,7 +2518,8 @@ sub end_table { pop @Apache::londefdef::table; undef @Apache::londefdef::table; } - } + } + &enable_para(); } return $currentstring; }