--- loncom/xml/londefdef.pm 2002/07/11 20:05:44 1.72 +++ loncom/xml/londefdef.pm 2002/07/24 20:23:21 1.77 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Tags Default Definition Module # -# $Id: londefdef.pm,v 1.72 2002/07/11 20:05:44 sakharuk Exp $ +# $Id: londefdef.pm,v 1.77 2002/07/24 20:23:21 sakharuk Exp $ # # # Copyright Michigan State University Board of Trustees @@ -74,7 +74,7 @@ sub start_m { my $currentstring = ''; if ($target eq 'web') { $Apache::lonxml::prevent_entity_encode++; - my $inside = &Apache::lonxml::get_all_text("/m",$$parser[-1]); + my $inside = &Apache::lonxml::get_all_text_unbalanced("/m",$parser); $inside ='\\documentstyle{article}'.$inside; &Apache::lonxml::debug("M is starting with:$inside:"); my $eval=&Apache::lonxml::get_param('eval',$parstack,$safeeval); @@ -90,7 +90,10 @@ sub start_m { } #&Apache::lonxml::debug("M is ends with:$currentstring:"); } elsif ($target eq 'tex') { - $currentstring = ""; + $currentstring = &Apache::lonxml::get_all_text_unbalanced("/m",$parser); + if ($currentstring=~/\s*\\\\\s*/) {$currentstring = ' \vskip 0 mm ';} + } else { + my $inside = &Apache::lonxml::get_all_text_unbalanced("/m",$parser); } return $currentstring; } @@ -120,7 +123,8 @@ sub end_m { } elsif ($target eq 'tex') { @Apache::londefdef::table = (); $currentstring .= '\documentclass[letterpaper]{article} - \newcommand{\keephidden}[1]{} + \newcommand{\keephidden}[1]{} + \renewcommand{\deg}{$^{\circ}$} \usepackage[dvips]{graphicx} \usepackage{epsfig}\usepackage{calc}'; } @@ -835,12 +839,14 @@ EDITBUTTON } #--
tag sub start_br { - my ($target,$token) = @_; + my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_; my $currentstring = ''; if ($target eq 'web') { $currentstring .= $token->[4]; } elsif ($target eq 'tex') { - $currentstring .= '\vskip 0 mm'; + if ($$tagstack[-2] ne 'sub' && $$tagstack[-2] ne 'sup') { + $currentstring .= '\vskip 0 mm'; + } } elsif ($target eq 'latexsource') { $currentstring .= '\\'; } @@ -949,7 +955,7 @@ EDITBUTTON if ($target eq 'web') { $currentstring .= $token->[4]; } elsif ($target eq 'tex') { - $currentstring .= "{\\underline "; + $currentstring .= '\underline{'; } return $currentstring; } @@ -959,7 +965,7 @@ EDITBUTTON if ($target eq 'web') { $currentstring .= $token->[2]; } elsif ($target eq 'tex') { - $currentstring .= " }"; + $currentstring .= '}'; } return $currentstring; } @@ -970,7 +976,7 @@ EDITBUTTON if ($target eq 'web') { $currentstring .= $token->[4]; } elsif ($target eq 'tex') { - $currentstring .= "{\\underline "; + $currentstring .= '\underline{'; } return $currentstring; } @@ -980,7 +986,7 @@ EDITBUTTON if ($target eq 'web') { $currentstring .= $token->[2]; } elsif ($target eq 'tex') { - $currentstring .= " }"; + $currentstring .= '}'; } return $currentstring; } @@ -1033,7 +1039,7 @@ EDITBUTTON if ($target eq 'web') { $currentstring .= $token->[4]; } elsif ($target eq 'tex') { - $currentstring .= "\\hline "; + $currentstring .= '\vskip 0 mm \noindent\makebox[\textwidth - 8 mm][b]{\hrulefill}'; } return $currentstring; } @@ -1110,7 +1116,7 @@ EDITBUTTON if ($target eq 'web') { $currentstring .= $token->[4]; } elsif ($target eq 'tex') { - $currentstring .= "{\\underline "; + $currentstring .= '\underline{'; } return $currentstring; } @@ -1120,7 +1126,7 @@ EDITBUTTON if ($target eq 'web') { $currentstring .= $token->[2]; } elsif ($target eq 'tex') { - $currentstring .= " }"; + $currentstring .= '}'; } return $currentstring; }