--- loncom/xml/londefdef.pm 2003/03/19 16:50:14 1.123 +++ loncom/xml/londefdef.pm 2003/04/10 14:31:09 1.124 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Tags Default Definition Module # -# $Id: londefdef.pm,v 1.123 2003/03/19 16:50:14 www Exp $ +# $Id: londefdef.pm,v 1.124 2003/04/10 14:31:09 sakharuk Exp $ # # # Copyright Michigan State University Board of Trustees @@ -46,7 +46,7 @@ package Apache::londefdef; use Apache::lonnet(); use strict; -use Apache::lonxml(); +use Apache::lonxml; use Apache::File(); use Image::Magick; use Apache::lonmenu(); @@ -1202,12 +1202,31 @@ sub end_sup { #--
tag sub start_hr { - 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 \noindent\makebox[\textwidth/2 ][b]{\hrulefill}\vskip 0 mm '; + my $LaTeXwidth = &Apache::lonxml::get_param('TeXwidth',$parstack,$safeeval); + if (defined $LaTeXwidth) { + if ($LaTeXwidth=~/^%/) { + substr($LaTeXwidth,0,1)=''; + $LaTeXwidth=($LaTeXwidth/100).'\textwidth'; + } + } else { + $LaTeXwidth ='0.95\textwidth'; + } + my ($pre,$post); + my $align=&Apache::lonxml::get_param('align',$parstack,$safeeval,undef,1); + if (($align eq 'center') || (not defined $align)) { + $pre=''; $post=''; + } elsif ($align eq 'left') { + $pre='\rlap{'; $post='} \hfill'; + } elsif ($align eq 'right') { + $pre=' \hfill \llap{'; $post='}'; + } + $currentstring .= ' \vskip 0 mm \noindent\makebox[\textwidth]{'.$pre.'\makebox['. + $LaTeXwidth.'][b]{\hrulefill}'.$post.'}\vskip 0 mm '; } return $currentstring; }