--- loncom/xml/londefdef.pm 2006/12/19 22:30:52 1.348 +++ loncom/xml/londefdef.pm 2007/01/18 20:48:02 1.352 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Tags Default Definition Module # -# $Id: londefdef.pm,v 1.348 2006/12/19 22:30:52 albertel Exp $ +# $Id: londefdef.pm,v 1.352 2007/01/18 20:48:02 albertel Exp $ # # # Copyright Michigan State University Board of Trustees @@ -1559,17 +1559,6 @@ sub start_a { my $href=&Apache::lonxml::get_param('href',$parstack,$safeeval, undef,1); $currentstring=&Apache::lonenc::encrypt_ref($token,{'href'=>$href}); - } elsif ($target eq 'tex') { - my $a=&Apache::lonxml::get_param('href',$parstack,$safeeval,undef,1); - my $b=&Apache::lonxml::get_param('name',$parstack,$safeeval,undef,1); - if ($a=~/\S/) { - $a=~s/([^\\])%/$1\\\%/g; - $currentstring .= '\ref{URI: '.$a.'}'; - } elsif ($b=~/\S/) { - $currentstring .= '\ref{Anchor: '.$b.'}'; - } else { - $currentstring.=''; - } } return $currentstring; } @@ -1580,6 +1569,20 @@ sub end_a { if ($target eq 'web' || $target eq 'webgrade') { $currentstring .= $token->[2]; } + if ($target eq 'tex') { + my $href = + &Apache::lonxml::get_param('href',$parstack,$safeeval,undef,1); + my $name = + &Apache::lonxml::get_param('name',$parstack,$safeeval,undef,1); + if ($href =~ /\S/) { + $href =~ s/([^\\])%/$1\\\%/g; + $currentstring .= ' ({\tt URI:'.&Apache::lonxml::latex_special_symbols($href).'})'; + } elsif ($name =~ /\S/) { + $currentstring .= ' ({\tt Anchor:'.&Apache::lonxml::latex_special_symbols($name).'})'; + } else { + $currentstring.=''; + } + } return $currentstring; } @@ -2251,6 +2254,12 @@ sub end_table { } $have_rowspan++; $output .= '\multirow{'.$rowspan.'}[0]{*}{'; + + $Apache::londefdef::table[-1]{'content'}[$in][$jn] =~ + s{^\s*\\par\s*}{}; + $Apache::londefdef::table[-1]{'content'}[$in][$jn] =~ + s{\s*\\vskip\s*0pt\s*$}{}; + # # If we did not throw in a multicolumn to align, then add # an extra { @@ -2891,7 +2900,7 @@ sub start_img { $currentstring = '\begin{minipage}[l]{'.$width_param.'mm}' .$currentstring.'\end{minipage}'; } elsif ($latex_rendering eq "wrapfigure" - || $latexrendering ne 'none') { # wrapfig render + || $latex_rendering ne 'none') { # wrapfig render $currentstring = '\begin{wrapfigure}{l}{'.$width_param.'mm}' .'\scalebox{1.0}{'.$currentstring.'}\end{wrapfigure}'; @@ -2903,7 +2912,7 @@ sub start_img { $currentstring = '\begin{minipage}[r]{'.$width_param.'mm}' .$currentstring.'\end{minipage}'; } elsif ($latex_rendering eq "wrapfigure" - || $latexrendering ne 'none') { # wrapfig render + || $latex_rendering ne 'none') { # wrapfig render $currentstring = '\begin{wrapfigure}{r}{'.$width_param.'mm}' .'\scalebox{1.0}{'.$currentstring.'}\end{wrapfigure}';