--- loncom/xml/londefdef.pm 2003/10/01 20:45:05 1.177 +++ loncom/xml/londefdef.pm 2003/10/10 19:05:31 1.179 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Tags Default Definition Module # -# $Id: londefdef.pm,v 1.177 2003/10/01 20:45:05 albertel Exp $ +# $Id: londefdef.pm,v 1.179 2003/10/10 19:05:31 sakharuk Exp $ # # # Copyright Michigan State University Board of Trustees @@ -92,9 +92,15 @@ sub start_m { $Apache::lontexconvert::errorstring=''; } #&Apache::lonxml::debug("M is ends with:$currentstring:"); + $Apache::lonxml::post_evaluate=0; } elsif ($target eq 'tex') { $currentstring = &Apache::lonxml::get_all_text_unbalanced("/m",$parser); + my $eval=&Apache::lonxml::get_param('eval',$parstack,$safeeval); + if ($eval eq 'on') { + $currentstring=&Apache::run::evaluate($currentstring,$safeeval,$$parstack[-1]); + } if ($currentstring=~/^(\s*\\\\\s*)*$/) {$currentstring = ' \vskip 0 mm ';} + $Apache::lonxml::post_evaluate=0; } else { my $inside = &Apache::lonxml::get_all_text_unbalanced("/m",$parser); } @@ -887,7 +893,7 @@ sub start_cite { if ($target eq 'web') { $currentstring .= $token->[4]; } elsif ($target eq 'tex') { - $currentstring .= "\\textit{"; + $currentstring .= '\textit{'; } return $currentstring; } @@ -898,7 +904,7 @@ sub end_cite { if ($target eq 'web') { $currentstring .= $token->[2]; } elsif ($target eq 'tex') { - $currentstring .= "}"; + $currentstring .= '}'; } return $currentstring; } @@ -933,7 +939,7 @@ sub start_address { if ($target eq 'web') { $currentstring .= $token->[4]; } elsif ($target eq 'tex') { - $currentstring .= "\\textit{"; + $currentstring .= '\textit{'; } return $currentstring; } @@ -944,7 +950,7 @@ sub end_address { if ($target eq 'web') { $currentstring .= $token->[2]; } elsif ($target eq 'tex') { - $currentstring .= "}"; + $currentstring .= '}'; } return $currentstring; } @@ -956,7 +962,7 @@ sub start_dfn { if ($target eq 'web') { $currentstring .= $token->[4]; } elsif ($target eq 'tex') { - $currentstring .= "\\textit{"; + $currentstring .= '\textit{'; } return $currentstring; } @@ -967,7 +973,7 @@ sub end_dfn { if ($target eq 'web') { $currentstring .= $token->[2]; } elsif ($target eq 'tex') { - $currentstring .= "}"; + $currentstring .= '}'; } return $currentstring; } @@ -1002,7 +1008,7 @@ sub start_kbd { if ($target eq 'web') { $currentstring .= $token->[4]; } elsif ($target eq 'tex') { - $currentstring .= "\\texttt"; + $currentstring .= '\texttt{'; } return $currentstring; } @@ -1013,7 +1019,7 @@ sub end_kbd { if ($target eq 'web') { $currentstring .= $token->[2]; } elsif ($target eq 'tex') { - $currentstring .= "}"; + $currentstring .= '}'; } return $currentstring; } @@ -1071,7 +1077,7 @@ sub start_q { if ($target eq 'web') { $currentstring .= $token->[4]; } elsif ($target eq 'tex') { - $currentstring .= "\\emph{"; + $currentstring .= '\emph{'; } return $currentstring; } @@ -1082,7 +1088,7 @@ sub end_q { if ($target eq 'web') { $currentstring .= $token->[2]; } elsif ($target eq 'tex') { - $currentstring .= "}"; + $currentstring .= '}'; } return $currentstring; } @@ -2920,8 +2926,8 @@ sub end_marquee { return $currentstring; } -#-- tag -sub start_malticol { +#-- tag (end tag required) +sub start_multicol { my ($target,$token) = @_; my $currentstring = ''; if ($target eq 'web') { @@ -2930,7 +2936,7 @@ sub start_malticol { return $currentstring; } -sub end_malticol { +sub end_multicol { my ($target,$token) = @_; my $currentstring = ''; if ($target eq 'web') { @@ -2939,13 +2945,15 @@ sub end_malticol { return $currentstring; } -#-- tag +#-- tag (end tag required) sub start_nobr { my ($target,$token) = @_; my $currentstring = ''; if ($target eq 'web') { $currentstring = $token->[4]; - } + } elsif ($target eq 'tex') { + $currentstring='\mbox{'; + } return $currentstring; } @@ -2954,11 +2962,13 @@ sub end_nobr { my $currentstring = ''; if ($target eq 'web') { $currentstring = $token->[2]; - } + } elsif ($target eq 'tex') { + $currentstring='}'; + } return $currentstring; } -#-- tag +#-- <noembed> tag (end tag required) sub start_noembed { my ($target,$token) = @_; my $currentstring = ''; @@ -2977,7 +2987,7 @@ sub end_noembed { return $currentstring; } -#-- <noframes> tag +#-- <noframes> tag (end tag required) sub start_noframes { my ($target,$token) = @_; my $currentstring = ''; @@ -2996,7 +3006,7 @@ sub end_noframes { return $currentstring; } -#-- <nolayer> tag +#-- <nolayer> tag (end tag required) sub start_nolayer { my ($target,$token) = @_; my $currentstring = ''; @@ -3015,7 +3025,7 @@ sub end_nolayer { return $currentstring; } -#-- <noscript> tag +#-- <noscript> tag (end tag required) sub start_noscript { my ($target,$token) = @_; my $currentstring = ''; @@ -3034,7 +3044,7 @@ sub end_noscript { return $currentstring; } -#-- <object> tag +#-- <object> tag (end tag required) sub start_object { my ($target,$token) = @_; my $currentstring = ''; @@ -3053,7 +3063,7 @@ sub end_object { return $currentstring; } -#-- <optgroup> tag +#-- <optgroup> tag (end tag required) sub start_optgroup { my ($target,$token) = @_; my $currentstring = ''; @@ -3072,13 +3082,15 @@ sub end_optgroup { return $currentstring; } -#-- <samp> tag +#-- <samp> tag (end tag required) sub start_samp { my ($target,$token) = @_; my $currentstring = ''; if ($target eq 'web') { $currentstring = $token->[4]; - } + } elsif ($target eq 'tex') { + $currentstring='\texttt{'; + } return $currentstring; } @@ -3087,7 +3099,9 @@ sub end_samp { my $currentstring = ''; if ($target eq 'web') { $currentstring = $token->[2]; - } + } elsif ($target eq 'tex') { + $currentstring='}'; + } return $currentstring; } @@ -3110,7 +3124,7 @@ sub end_server { return $currentstring; } -#-- <spacer> tag +#-- <spacer> tag (end tag forbidden) sub start_spacer { my ($target,$token) = @_; my $currentstring = ''; @@ -3129,7 +3143,7 @@ sub end_spacer { return $currentstring; } -#-- <span> tag +#-- <span> tag (end tag required) sub start_span { my ($target,$token) = @_; my $currentstring = ''; @@ -3148,7 +3162,7 @@ sub end_span { return $currentstring; } -#-- <tbody> tag +#-- <tbody> tag (end tag optional) sub start_tbody { my ($target,$token) = @_; my $currentstring = '';