version 1.200, 2004/03/02 20:59:24
|
version 1.204, 2004/03/31 05:24:00
|
Line 117 sub start_m {
|
Line 117 sub start_m {
|
sub end_m { |
sub end_m { |
my ($target,$token) = @_; |
my ($target,$token) = @_; |
my $currentstring = ''; |
my $currentstring = ''; |
if ($target eq 'web') { |
if ($target eq 'tex') { |
$Apache::lonxml::prevent_entity_encode--; |
|
} elsif ($target eq 'tex') { |
|
$currentstring = ""; |
$currentstring = ""; |
} elsif ($target eq 'meta') { |
|
} |
} |
return $currentstring; |
return $currentstring; |
} |
} |
Line 393 sub start_meta {
|
Line 390 sub start_meta {
|
my $display=&Apache::lonxml::get_param |
my $display=&Apache::lonxml::get_param |
('display',$parstack,$safeeval,undef,1); |
('display',$parstack,$safeeval,undef,1); |
if ($display) { |
if ($display) { |
$display=&HTML::Entities::encode($display); |
$display=&HTML::Entities::encode($display,'<>&"'); |
$currentstring.='<'.$name.'.display>'.$display. |
$currentstring.='<'.$name.'.display>'.$display. |
'</'.$name.'.display>'; |
'</'.$name.'.display>'; |
} |
} |
Line 541 EDITBUTTON
|
Line 538 EDITBUTTON
|
} else { |
} else { |
$currentstring.=&Apache::lonmenu::menubuttons(undef,$target,1); |
$currentstring.=&Apache::lonmenu::menubuttons(undef,$target,1); |
} |
} |
|
$currentstring.=&Apache::lonxml::message_location(); |
} elsif ($target eq 'tex') { |
} elsif ($target eq 'tex') { |
$currentstring = '\begin{document}'; |
$currentstring = '\begin{document}'; |
} |
} |
Line 1246 sub start_font {
|
Line 1244 sub start_font {
|
my $currentstring = ''; |
my $currentstring = ''; |
if ($target eq 'web') { |
if ($target eq 'web') { |
my $face=&Apache::lonxml::get_param('face',$parstack,$safeeval); |
my $face=&Apache::lonxml::get_param('face',$parstack,$safeeval); |
if ($face=~/symbol/i) { |
if ($face!~/symbol/i) { |
$Apache::lonxml::prevent_entity_encode++; |
|
} else { |
|
if (($ENV{'browser.fontenhance'} eq 'on') || |
if (($ENV{'browser.fontenhance'} eq 'on') || |
($ENV{'browser.blackwhite'} eq 'on')) { return ''; } |
($ENV{'browser.blackwhite'} eq 'on')) { return ''; } |
} |
} |
Line 1266 sub end_font {
|
Line 1262 sub end_font {
|
my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_; |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_; |
my $currentstring = ''; |
my $currentstring = ''; |
if ($target eq 'web') { |
if ($target eq 'web') { |
my $face=&Apache::lonxml::get_param('face',$parstack,$safeeval); |
|
if ($face=~/symbol/i) {$Apache::lonxml::prevent_entity_encode--;} |
|
$currentstring = $token->[2]; |
$currentstring = $token->[2]; |
} elsif ($target eq 'tex') { |
} elsif ($target eq 'tex') { |
my $fontsize=&Apache::lonxml::get_param('TeXsize',$parstack,$safeeval); |
my $fontsize=&Apache::lonxml::get_param('TeXsize',$parstack,$safeeval); |
Line 1337 sub start_sub {
|
Line 1331 sub start_sub {
|
if ($target eq 'web') { |
if ($target eq 'web') { |
$currentstring .= $token->[4]; |
$currentstring .= $token->[4]; |
} elsif ($target eq 'tex') { |
} elsif ($target eq 'tex') { |
$currentstring .= "\$_{"; |
$currentstring .= '\ensuremath{_{'; |
} |
} |
return $currentstring; |
return $currentstring; |
} |
} |
Line 1348 sub end_sub {
|
Line 1342 sub end_sub {
|
if ($target eq 'web') { |
if ($target eq 'web') { |
$currentstring .= $token->[2]; |
$currentstring .= $token->[2]; |
} elsif ($target eq 'tex') { |
} elsif ($target eq 'tex') { |
$currentstring .= "}\$"; |
$currentstring .= '}}'; |
} |
} |
return $currentstring; |
return $currentstring; |
} |
} |
Line 1360 sub start_sup {
|
Line 1354 sub start_sup {
|
if ($target eq 'web') { |
if ($target eq 'web') { |
$currentstring .= $token->[4]; |
$currentstring .= $token->[4]; |
} elsif ($target eq 'tex') { |
} elsif ($target eq 'tex') { |
$currentstring .= "\$^{"; |
$currentstring .= '\ensuremath{^{'; |
} |
} |
return $currentstring; |
return $currentstring; |
} |
} |
Line 1371 sub end_sup {
|
Line 1365 sub end_sup {
|
if ($target eq 'web') { |
if ($target eq 'web') { |
$currentstring .= $token->[2]; |
$currentstring .= $token->[2]; |
} elsif ($target eq 'tex') { |
} elsif ($target eq 'tex') { |
$currentstring .= "}\$"; |
$currentstring .= '}}'; |
} |
} |
return $currentstring; |
return $currentstring; |
} |
} |
Line 1794 sub start_table {
|
Line 1788 sub start_table {
|
if (not defined $TeXwidth) { |
if (not defined $TeXwidth) { |
my $htmlwidth = &Apache::lonxml::get_param('width',$parstack,$safeeval,undef,1); |
my $htmlwidth = &Apache::lonxml::get_param('width',$parstack,$safeeval,undef,1); |
if ($htmlwidth=~/%/) { |
if ($htmlwidth=~/%/) { |
|
$Apache::londefdef::table[-1]{'percent'}=1; |
$htmlwidth=~/(\d+)/; |
$htmlwidth=~/(\d+)/; |
my $value=$1*$textwidth/100; |
$Apache::londefdef::table[-1]{'width'}=$1*$textwidth/100;; |
$Apache::londefdef::table[-1]{'width'}=$value; |
|
} else { |
} else { |
$Apache::londefdef::table[-1]{'width'}=$textwidth; |
$Apache::londefdef::table[-1]{'width'}=$textwidth; |
} |
} |
} elsif ($TeXwidth=~/%/) { |
} elsif ($TeXwidth=~/%/) { |
|
$Apache::londefdef::table[-1]{'percent'}=1; |
$TeXwidth=~/(\d+)/; |
$TeXwidth=~/(\d+)/; |
my $value=$1*$textwidth/100; |
my $value=$1*$textwidth/100; |
$Apache::londefdef::table[-1]{'width'}=$value; |
$Apache::londefdef::table[-1]{'width'}=$value; |
Line 1880 sub end_table {
|
Line 1875 sub end_table {
|
$length_row_final[$jn]=0.9*$available_length/$needed; |
$length_row_final[$jn]=0.9*$available_length/$needed; |
} |
} |
} |
} |
|
#recalculation for the use of all available width if width is defined in % |
|
if ($Apache::londefdef::table[-1]{'percent'}==1) { |
|
my $current=0; |
|
for (my $i=0;$i<=$#length_row_final;$i++) { |
|
$current+=$length_row_final[$i]; |
|
} |
|
my $coef=$Apache::londefdef::table[-1]{'width'}/$current; |
|
for (my $i=0;$i<=$#length_row_final;$i++) { |
|
$length_row_final[$i]*=$coef; |
|
} |
|
} |
#fill the table |
#fill the table |
for (my $in=0;$in<=$Apache::londefdef::table[-1]{'row_number'};$in++) { |
for (my $in=0;$in<=$Apache::londefdef::table[-1]{'row_number'};$in++) { |
for (my $jn=0;$jn<=$#length_row_final;$jn++) { |
for (my $jn=0;$jn<=$#length_row_final;$jn++) { |