version 1.261, 2005/03/14 23:48:57
|
version 1.265, 2005/03/31 15:54:33
|
Line 156 sub start_html {
|
Line 156 sub start_html {
|
if ($target eq 'web' || $target eq 'edit') { |
if ($target eq 'web' || $target eq 'edit') { |
$currentstring = &Apache::lonxml::xmlbegin(); |
$currentstring = &Apache::lonxml::xmlbegin(); |
} elsif ($target eq 'tex') { |
} elsif ($target eq 'tex') { |
@Apache::londefdef::table = (); |
|
$currentstring .= '\documentclass[letterpaper]{article}'; |
$currentstring .= '\documentclass[letterpaper]{article}'; |
if (($ENV{'form.latex_type'}=~'batchmode') || |
if (($ENV{'form.latex_type'}=~'batchmode') || |
(!$ENV{'request.role.adv'})) {$currentstring .='\batchmode';} |
(!$ENV{'request.role.adv'})) {$currentstring .='\batchmode';} |
Line 2505 sub start_img {
|
Line 2504 sub start_img {
|
&Apache::lonxml::debug("$src exists"); |
&Apache::lonxml::debug("$src exists"); |
my ($height_param,$width_param)= |
my ($height_param,$width_param)= |
&image_size($src,0.3,$parstack,$safeeval); |
&image_size($src,0.3,$parstack,$safeeval); |
$currentstring .= '\graphicspath{{'.$path.'}}' |
my $destpath = $path; |
.'\includegraphics[width='.$width_param.' mm,height='.$height_param.'mm]{'.$file.'} '; |
$destpath =~ s/ /\_/g; # Spaces in path cause LaTex to vomit. |
|
my $destfile = $file; |
|
$destfile =~ s/ /\_/g; |
|
$currentstring .= '\graphicspath{{'.$destpath.'}}' |
|
.'\includegraphics[width='.$width_param.' mm,height='.$height_param.'mm]{'.$destfile.'} '; |
|
|
# If there's an alignment specification we need to honor it here. |
# If there's an alignment specification we need to honor it here. |
# For the horizontal alignments, we will also honor the |
# For the horizontal alignments, we will also honor the |
Line 3753 sub image_replication {
|
Line 3756 sub image_replication {
|
$pssrc =~ s/\.(gif|jpg|jpeg|png)$/.ps/i; |
$pssrc =~ s/\.(gif|jpg|jpeg|png)$/.ps/i; |
if (not -e $epssrc && not -e $pssrc) { |
if (not -e $epssrc && not -e $pssrc) { |
my $result=&Apache::lonnet::repcopy($epssrc); |
my $result=&Apache::lonnet::repcopy($epssrc); |
if ($result ne 'OK') { &Apache::lonnet::repcopy($pssrc); } |
if ($result ne 'ok') { &Apache::lonnet::repcopy($pssrc); } |
} |
} |
return ''; |
return ''; |
} |
} |
Line 3830 sub get_eps_image {
|
Line 3833 sub get_eps_image {
|
&Apache::lonxml::debug("Filelocation gives; $src <BR />"); |
&Apache::lonxml::debug("Filelocation gives; $src <BR />"); |
if (! -e $src) { |
if (! -e $src) { |
&Apache::lonxml::debug("$src does not exist"); |
&Apache::lonxml::debug("$src does not exist"); |
if (&Apache::lonnet::repcopy($src) ne 'OK' ) { |
if (&Apache::lonnet::repcopy($src) ne 'ok' ) { |
&Apache::lonxml::debug("Repcopy of $src failed (1)"); |
&Apache::lonxml::debug("Repcopy of $src failed (1)"); |
#if replication failed try to find ps file |
#if replication failed try to find ps file |
$src=~s/\.eps$/\.ps/; |
$src=~s/\.eps$/\.ps/; |
&Apache::lonxml::debug("Now looking for $src"); |
&Apache::lonxml::debug("Now looking for $src"); |
#if no ps file try to replicate it |
#if no ps file try to replicate it |
if (not -e $src && |
if (not -e $src && |
&Apache::lonnet::repcopy($src) ne 'OK') { |
&Apache::lonnet::repcopy($src) ne 'ok') { |
&Apache::lonxml::debug("Failed to find or replicate $src"); |
&Apache::lonxml::debug("Failed to find or replicate $src"); |
|
|
#if replication failed try to produce eps file dynamically |
#if replication failed try to produce eps file dynamically |