Return to londefdef.pm CVS log | Up to [LON-CAPA] / loncom / xml |
version 1.61, 2002/05/16 00:56:46 | version 1.66, 2002/06/20 18:25:01 |
---|---|
Line 52 use Apache::File(); | Line 52 use Apache::File(); |
BEGIN { | BEGIN { |
&Apache::lonxml::register('Apache::londefdef',('m','html','head','map','select','option','input','textarea','form','meta','title','body','center','b','strong','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','allow','frameset','pre','insert','externallink','table','tr','th','td')); | &Apache::lonxml::register('Apache::londefdef',('m','html','head','map','select','option','input','textarea','form','meta','title','body','center','b','strong','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','allow','frameset','pre','insert','externallink','table','tr','th','td','blankspace','bubble','bubbles','bubbleline')); |
} | } |
Line 122 sub end_m { | Line 122 sub end_m { |
$currentstring .= '\documentclass[letterpaper]{article} | $currentstring .= '\documentclass[letterpaper]{article} |
\newcommand{\keephidden}[1]{} | \newcommand{\keephidden}[1]{} |
\usepackage[dvips]{graphicx} | \usepackage[dvips]{graphicx} |
\usepackage{epsfig}'; | \usepackage{epsfig}\usepackage{calc}'; |
} | } |
return $currentstring; | return $currentstring; |
} | } |
Line 840 EDITBUTTON | Line 840 EDITBUTTON |
if ($target eq 'web') { | if ($target eq 'web') { |
$currentstring .= $token->[4]; | $currentstring .= $token->[4]; |
} elsif ($target eq 'tex') { | } elsif ($target eq 'tex') { |
$currentstring .= '\\\\'; | $currentstring .= '\vskip 0 mm'; |
} elsif ($target eq 'latexsource') { | } elsif ($target eq 'latexsource') { |
$currentstring .= '\\'; | $currentstring .= '\\'; |
} | } |
Line 1444 EDITBUTTON | Line 1444 EDITBUTTON |
} | } |
my $src = &Apache::lonxml::get_param('src',$parstack,$safeeval); | my $src = &Apache::lonxml::get_param('src',$parstack,$safeeval); |
$src=&Apache::lonnet::filelocation($Apache::lonxml::pwd[-1],$src); | $src=&Apache::lonnet::filelocation($Apache::lonxml::pwd[-1],$src); |
my $epssrc = $src; | |
$epssrc =~ s/(\.gif|\.jpg|\.GIF|\.JPG)$/\.eps/; | |
if (not -e $epssrc) { | |
my $localfile = $epssrc; | |
$localfile =~ s/.*(\/res)/$1/; | |
my $file; | |
my $path; | |
if ($localfile =~ m!(.*)/([^/]*)$!) { | |
$file = $2; | |
$path = $1.'/'; | |
} | |
my $signal_eps = 0; | |
my @content_directory = &Apache::lonnet::dirlist($path); | |
for (my $iy=0;$iy<=$#content_directory;$iy++) { | |
my @tempo_array = split(/&/,$content_directory[$iy]); | |
$content_directory[$iy] = $tempo_array[0]; | |
if ($file eq $tempo_array[0]) { | |
$signal_eps = 1; | |
last; | |
} | |
} | |
if ($signal_eps) { | |
my $eps_file = &Apache::lonnet::getfile($localfile); | |
} else { | |
$localfile = $src; | |
$localfile =~ s/.*(\/res)/$1/; | |
my $as = &Apache::lonnet::getfile($src); | |
} | |
} | |
my $file; | my $file; |
my $path; | my $path; |
if ($src =~ m!(.*)/([^/]*)$!) { | if ($src =~ m!(.*)/([^/]*)$!) { |
Line 1451 EDITBUTTON | Line 1481 EDITBUTTON |
$path = $1.'/'; | $path = $1.'/'; |
} | } |
my $newsrc = $src; | my $newsrc = $src; |
$newsrc =~ s/(\.gif|\.jpg)$/\.eps/; | $newsrc =~ s/(\.gif|\.jpg)$/\.eps/i; |
$file=~s/(\.gif|\.jpg)$/\.eps/; | $file=~s/(\.gif|\.jpg)$/\.eps/i; |
if (-e $newsrc) { | if (-e $newsrc) { |
if ($path) { | if ($path) { |
$currentstring .= '\graphicspath{{'.$path.'}}\fbox{\includegraphics'.$width_param.'{'.$file.'}}'; | $currentstring .= '\graphicspath{{'.$path.'}}\fbox{\includegraphics'.$width_param.'{'.$file.'}}'; |
} | } |
} else { | } else { |
my $temp_file; | my $temp_file; |
my $filename = "/home/httpd/prtspool/$ENV{'user.name'}$ENV{'user.domain'}temp$ENV{'user.login.time'}.dat"; | my $filename = "/home/httpd/prtspool/$ENV{'user.name'}_$ENV{'user.domain'}_printout.dat"; |
$temp_file = Apache::File->new('>>'.$filename); | $temp_file = Apache::File->new('>>'.$filename); |
print $temp_file "$src\n"; | print $temp_file "$src\n"; |
$currentstring .= '\graphicspath{{/home/httpd/prtspool/}}\fbox{\includegraphics'.$width_param.'{'.$file.'}}'; | $currentstring .= '\graphicspath{{/home/httpd/prtspool/}}\fbox{\includegraphics'.$width_param.'{'.$file.'}}'; |
Line 1649 sub start_embed { | Line 1679 sub start_embed { |
} | } |
return $currentstring; | return $currentstring; |
} | } |
#-- <blankspace heigth=""> | |
sub start_blankspace { | |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_; | |
my $currentstring = ''; | |
if ($target eq 'tex') { | |
my $howmuch = &Apache::lonxml::get_param('heigth',$parstack,$safeeval); | |
$currentstring .= '\vskip '.$howmuch.' '; | |
} | |
return $currentstring; | |
} | |
sub end_blankspace { | |
my ($target,$token) = @_; | |
my $currentstring = ''; | |
if ($target eq 'tex') { | |
$currentstring .= ''; | |
} | |
return $currentstring; | |
} | |
1; | 1; |
__END__ | __END__ |