version 1.67, 2005/04/22 14:03:56
|
version 1.72, 2005/06/22 12:03:23
|
Line 347 sub start_foil {
|
Line 347 sub start_foil {
|
if ($target eq 'web' || $target eq 'grade' || $target eq 'tex' || |
if ($target eq 'web' || $target eq 'grade' || $target eq 'tex' || |
$target eq 'analyze') { |
$target eq 'analyze') { |
my $name = &Apache::lonxml::get_param('name',$parstack,$safeeval); |
my $name = &Apache::lonxml::get_param('name',$parstack,$safeeval); |
if (!$name) { |
if ($name eq "") { |
&Apache::lonxml::error("Foils without names exist. This can cause problems to malfunction."); |
&Apache::lonxml::warning("Foils without names exist. This can cause problems to malfunction."); |
$name=$Apache::lonxml::curdepth; |
$name=$Apache::lonxml::curdepth; |
} |
} |
if (defined($Apache::response::foilnames{$name})) { |
if (defined($Apache::response::foilnames{$name})) { |
Line 467 sub end_image {
|
Line 467 sub end_image {
|
$result=&Apache::edit::end_table(); |
$result=&Apache::edit::end_table(); |
} elsif ($target eq 'tex') { |
} elsif ($target eq 'tex') { |
my $src = &Apache::lonxml::endredirection(); |
my $src = &Apache::lonxml::endredirection(); |
my ($path,$file) = &Apache::londefdef::get_eps_image($src); |
|
my ($height_param,$width_param)= |
# There may be all sorts of whitespace on fore and aft: |
&Apache::londefdef::image_size($src,0.3,$parstack,$safeeval); |
|
$Apache::response::foilgroup{"$name.image"} ='\vskip 0 mm \noindent\graphicspath{{'.$path.'}}\includegraphics[width='.$width_param.' mm]{'.$file.'} '; |
$src =~ s/\s+$//s; |
|
$src =~ s/^\s+//s; |
|
|
|
# |
|
# Gnuplot e.g. just generates the latex to put inplace. |
|
# |
|
my $graphinclude; |
|
if ($src =~ /^%DYNAMICIMAGE/) { |
|
# This is needed because the newline is not always passed -> tex. |
|
# At present we don't care about the sizing info. |
|
|
|
my ($commentline, $restofstuff) = split(/\n/, $src); |
|
$graphinclude = $src; |
|
$graphinclude =~ s/^$commentline//; |
|
} else { |
|
my ($path,$file) = &Apache::londefdef::get_eps_image($src); |
|
my ($height_param,$width_param)= |
|
&Apache::londefdef::image_size($src,0.3,$parstack,$safeeval); |
|
$graphinclude = '\graphicspath{{'.$path.'}}\includegraphics[width='.$width_param.' mm]{'.$file.'}'; |
|
} |
|
$Apache::response::foilgroup{"$name.image"} ='\vskip 0 mm \noindent '.$graphinclude; |
} |
} |
return $result; |
return $result; |
} |
} |