--- loncom/xml/londefdef.pm 2001/01/04 19:15:20 1.14 +++ loncom/xml/londefdef.pm 2001/01/05 19:20:01 1.15 @@ -10,7 +10,9 @@ use strict; use Apache::lonxml; sub BEGIN { - &Apache::lonxml::register('Apache::londefdef',('m','html','head','map','applet','select','option','input','textarea','form','meta','title','body','center','b','strong','table','dt','h1','h2','h3','h4','h5','h6','cite','i','address','dd','dl','dir','ol','ul','menu','dfn','kbd','tt','code','em','q','p','br','big','small','basefont','font','s','sub','strike','sup','hr','a','li','u','output','param','applet','img','embed')); + + &Apache::lonxml::register('Apache::londefdef',('m','html','head','map','applet','select','option','input','textarea','form','meta','title','body','center','b','strong','table','dt','h1','h2','h3','h4','h5','h6','cite','i','address','dd','dl','dir','ol','ul','menu','dfn','kbd','tt','code','em','q','p','br','big','small','basefont','font','s','sub','strike','sup','hr','a','li','u','output','param','applet','img','embed','tr','td')); + } #===================================================================== TAG SUBROUTINES @@ -631,7 +633,7 @@ sub BEGIN { if ($target eq 'web') { $currentstring .= $token->[4]; } elsif ($target eq 'tex') { - $currentstring .= "{ \\emph "; + $currentstring .= "\\emph{"; } return $currentstring; } @@ -905,7 +907,7 @@ sub BEGIN { my $tempor_var = $stackref->[$#$stackref]; if (index($tempor_var,'name') != -1 ) { $tempor_var =~ s/name=([^,]*),/$1/g; - $currentstring .= " \\label{$tempor_var}"; +# $currentstring .= " \\label{$tempor_var}"; } elsif (index($tempor_var,'href') != -1 ) { $tempor_var =~ s/href=([^,]*),/$1/g; $currentstring .= " \\ref{$tempor_var}"; @@ -920,12 +922,16 @@ sub BEGIN { if ($target eq 'web') { $currentstring = $token->[4]; } elsif ($target eq 'tex') { - my $tempor_var = $stackref->[$#$stackref-1]; + my $tempor_var = $stackref->[$#$stackref]; if (index($tempor_var,'circle') != -1 ) { $currentstring .= " \\item[o] "; } elsif (index($tempor_var,'square') != -1 ) { $currentstring .= " \\item[$\Box$] "; - } else { + } elsif ($tempor_var ne '') { + $_ = $tempor_var; + m/my\s*([^=]*)=/; + $currentstring .= " \\item[$1] "; + } else { $currentstring .= " \\item "; } } @@ -1110,7 +1116,7 @@ sub BEGIN { if ($target eq 'web') { $currentstring = $token->[4]; } elsif ($target eq 'tex') { - $currentstring = " \\begin{tabular} "; + $currentstring = ""; } return $currentstring; } @@ -1120,11 +1126,52 @@ sub BEGIN { if ($target eq 'web') { $currentstring = $token->[2]; } elsif ($target eq 'tex') { - $currentstring = " \\end{tabular}"; + $currentstring = ""; + } + return $currentstring; + } +#------------------------------------------------------------------------- tag + sub start_tr { + my ($target,$token) = @_; + my $currentstring = ''; + if ($target eq 'web') { + $currentstring = $token->[4]; + } elsif ($target eq 'tex') { + $currentstring = ''; + } + return $currentstring; + } + sub end_tr { + my ($target,$token) = @_; + my $currentstring = ''; + if ($target eq 'web') { + $currentstring = $token->[2]; + } elsif ($target eq 'tex') { + $currentstring = ""; + } + return $currentstring; + } +#------------------------------------------------------------------------- tag + sub start_td { + my ($target,$token) = @_; + my $currentstring = ''; + if ($target eq 'web') { + $currentstring = $token->[4]; + } elsif ($target eq 'tex') { + $currentstring = ''; + } + return $currentstring; + } + sub end_td { + my ($target,$token) = @_; + my $currentstring = ''; + if ($target eq 'web') { + $currentstring = $token->[2]; + } elsif ($target eq 'tex') { + $currentstring = ""; } return $currentstring; } - # -------------------------------------------------------------------------- tag sub start_img {