version 1.243, 2004/10/18 22:02:02
|
version 1.247, 2004/11/19 22:16:33
|
Line 66 sub initialize_londefdef {
|
Line 66 sub initialize_londefdef {
|
undef(@Apache::londefdef::description); |
undef(@Apache::londefdef::description); |
@Apache::londefdef::DD=(0); |
@Apache::londefdef::DD=(0); |
@Apache::londefdef::DT=(0); |
@Apache::londefdef::DT=(0); |
|
@Apache::londefdef::seenDT=(0); |
$Apache::londefdef::list_index=0; |
$Apache::londefdef::list_index=0; |
} |
} |
|
|
Line 154 sub start_html {
|
Line 155 sub start_html {
|
$currentstring = &Apache::lonxml::xmlbegin(); |
$currentstring = &Apache::lonxml::xmlbegin(); |
} elsif ($target eq 'tex') { |
} elsif ($target eq 'tex') { |
@Apache::londefdef::table = (); |
@Apache::londefdef::table = (); |
$currentstring .= '\documentclass[letterpaper]{book}'; |
$currentstring .= '\documentclass[letterpaper]{article}'; |
if ($ENV{'form.latex_type'}=~'batchmode') {$currentstring .='\batchmode';} |
if ($ENV{'form.latex_type'}=~'batchmode') {$currentstring .='\batchmode';} |
$currentstring .= '\newcommand{\keephidden}[1]{}'. |
$currentstring .= '\newcommand{\keephidden}[1]{}'. |
'\renewcommand{\deg}{$^{\circ}$}'. |
'\renewcommand{\deg}{$^{\circ}$}'. |
Line 478 sub end_accessrule {
|
Line 479 sub end_accessrule {
|
sub start_body { |
sub start_body { |
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') { |
if ($Apache::lonhomework::parsing_a_problem) { |
if ($Apache::lonhomework::parsing_a_problem) { |
&Apache::lonxml::warning("<body> tag found inside of <problem> tag this can cause problems."); |
&Apache::lonxml::warning("<body> tag found inside of <problem> tag this can cause problems."); |
Line 529 sub start_body {
|
Line 531 sub start_body {
|
$token->[2]->{'onunload'}=&Apache::lonmenu::unloadevents(). |
$token->[2]->{'onunload'}=&Apache::lonmenu::unloadevents(). |
';'.$onUnload; |
';'.$onUnload; |
|
|
$currentstring .= '<'.$token->[1]; |
if ($ENV{'request.state'} ne 'construct') { |
|
$currentstring .= '<'.$token->[1]; |
|
} |
foreach (keys %{$token->[2]}) { |
foreach (keys %{$token->[2]}) { |
$currentstring.=' '.$_.'="'.$token->[2]->{$_}.'"'; |
$currentstring.=' '.$_.'="'.$token->[2]->{$_}.'"'; |
} |
} |
$currentstring.='>'; |
if ($ENV{'request.state'} ne 'construct') { |
|
$currentstring.='>'; |
|
} |
if ($ENV{'request.state'} ne 'published') { |
if ($ENV{'request.state'} ne 'published') { |
|
my $remote=($ENV{'environment.remote'} ne 'off'); |
|
$currentstring=&Apache::loncommon::bodytag(undef,undef, |
|
$currentstring,$remote); |
$currentstring.=(<<EDITBUTTON); |
$currentstring.=(<<EDITBUTTON); |
<form method="post"> |
<form method="post"> |
<input type="submit" name="editmode" accesskey="e" value="Edit" /> |
<input type="submit" name="editmode" accesskey="e" value="Edit" /> |
Line 1701 sub start_dl {
|
Line 1710 sub start_dl {
|
push(@Apache::londefdef::description,[]); |
push(@Apache::londefdef::description,[]); |
$Apache::londefdef::DD[$Apache::londefdef::DL]=0; |
$Apache::londefdef::DD[$Apache::londefdef::DL]=0; |
$Apache::londefdef::DT[$Apache::londefdef::DL]=0; |
$Apache::londefdef::DT[$Apache::londefdef::DL]=0; |
|
$Apache::londefdef::seenDT[$Apache::londefdef::DL]=0; |
} |
} |
return $currentstring; |
return $currentstring; |
} |
} |
Line 1720 sub end_dl {
|
Line 1730 sub end_dl {
|
$currentstring.='\end{description}'; |
$currentstring.='\end{description}'; |
delete($Apache::londefdef::DD[$Apache::londefdef::DL]); |
delete($Apache::londefdef::DD[$Apache::londefdef::DL]); |
delete($Apache::londefdef::DT[$Apache::londefdef::DL]); |
delete($Apache::londefdef::DT[$Apache::londefdef::DL]); |
|
delete($Apache::londefdef::seenDT[$Apache::londefdef::DL]); |
$Apache::londefdef::DL--; |
$Apache::londefdef::DL--; |
} |
} |
return $currentstring; |
return $currentstring; |
Line 1736 sub start_dt {
|
Line 1747 sub start_dt {
|
if ($Apache::londefdef::DD[-1]) { &end_dd(@_); } |
if ($Apache::londefdef::DD[-1]) { &end_dd(@_); } |
&Apache::lonxml::startredirection(); |
&Apache::lonxml::startredirection(); |
$Apache::londefdef::DT[-1]++; |
$Apache::londefdef::DT[-1]++; |
|
$Apache::londefdef::seenDT[-1]=1; |
} |
} |
return $currentstring; |
return $currentstring; |
} |
} |
Line 1748 sub end_dt {
|
Line 1760 sub end_dt {
|
} elsif ($target eq 'tex') { |
} elsif ($target eq 'tex') { |
if ($Apache::londefdef::DT[-1]) { |
if ($Apache::londefdef::DT[-1]) { |
my $data=&item_cleanup(); |
my $data=&item_cleanup(); |
push(@{$Apache::londefdef::description[-1]},'\item['.$data.']'); |
push(@{$Apache::londefdef::description[-1]},'\item['.$data.'] \strut \vskip 0mm'); |
$Apache::londefdef::DT[-1]--; |
$Apache::londefdef::DT[-1]--; |
} |
} |
} |
} |
Line 1771 sub start_dd {
|
Line 1783 sub start_dd {
|
} elsif ($target eq 'tex') { |
} elsif ($target eq 'tex') { |
if ($Apache::londefdef::DT[-1]) { &end_dt(@_); } |
if ($Apache::londefdef::DT[-1]) { &end_dt(@_); } |
if ($Apache::londefdef::DD[-1]) { &end_dd(@_);} |
if ($Apache::londefdef::DD[-1]) { &end_dd(@_);} |
|
if (!$Apache::londefdef::seenDT[-1]) { |
|
push(@{$Apache::londefdef::description[-1]},'\item[\strut] \strut \vskip 0mm '); |
|
} |
push(@{$Apache::londefdef::description[-1]},''); |
push(@{$Apache::londefdef::description[-1]},''); |
$Apache::londefdef::description[-1]->[-1].=' \strut '; |
$Apache::londefdef::description[-1]->[-1].=' \strut '; |
$Apache::londefdef::DD[-1]++; |
$Apache::londefdef::DD[-1]++; |
Line 2444 sub start_img {
|
Line 2459 sub start_img {
|
if (-e $newsrc) { |
if (-e $newsrc) { |
#eps counterpart for image exist |
#eps counterpart for image exist |
if ($path) { |
if ($path) { |
$currentstring .= '\vskip 1 mm \noindent\graphicspath{{'.$path.'}}\includegraphics[width='.$width_param.' mm]{'.$file.'} '; |
$currentstring .= '\graphicspath{{'.$path.'}}\includegraphics[width='.$width_param.' mm]{'.$file.'} '; |
} |
} |
} else { |
} else { |
#there is no eps counterpart for image - check for ps one |
#there is no eps counterpart for image - check for ps one |
Line 2453 sub start_img {
|
Line 2468 sub start_img {
|
#ps counterpart for image exist |
#ps counterpart for image exist |
$file =~ s/\.eps$/\.ps/; |
$file =~ s/\.eps$/\.ps/; |
if ($path) { |
if ($path) { |
$currentstring .= '\vskip 1 mm \noindent\graphicspath{{'.$path.'}}\includegraphics[width='.$width_param.' mm]{'.$file.'} '; |
$currentstring .= '\graphicspath{{'.$path.'}}\includegraphics[width='.$width_param.' mm]{'.$file.'} '; |
} |
} |
} else { |
} else { |
#care about eps dynamical generation |
#care about eps dynamical generation |
$currentstring.='\vskip 1 mm '.&eps_generation($src,$file,$width_param); |
$currentstring.=&eps_generation($src,$file,$width_param); |
} |
} |
} |
} |
} else { |
} else { |