--- loncom/xml/londefdef.pm 2008/03/06 20:31:52 1.382
+++ loncom/xml/londefdef.pm 2008/08/18 10:19:59 1.390
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Tags Default Definition Module
#
-# $Id: londefdef.pm,v 1.382 2008/03/06 20:31:52 www Exp $
+# $Id: londefdef.pm,v 1.390 2008/08/18 10:19:59 foxr Exp $
#
#
# Copyright Michigan State University Board of Trustees
@@ -46,6 +46,7 @@ use Apache::File();
use Image::Magick;
use Apache::lonmenu();
use Apache::lonmeta();
+use Apache::lonlocal;
use Apache::Constants qw(:common);
use File::Basename;
use LONCAPA();
@@ -200,6 +201,11 @@ sub start_html {
'\usepackage[dvips]{graphicx}'.
'\usepackage{wrapfig}'.
'\usepackage{picins}'.
+ '\usepackage[T1]{fontenc}'."\n".
+ '\usepackage[postscript]{ucs}'."\n".
+ '\usepackage[utf8x]{inputenc}'."\n".
+ '\usepackage{pifont}' ."\n".
+ '\usepackage{latexsym}'."\n".
'\usepackage{epsfig}'.
'\usepackage{calc}'.
'\usepackage{amsmath}'.
@@ -589,12 +595,16 @@ sub start_body {
}
sub edit_controls {
- my $result .= (<
+
+
-
-EDITBUTTON
+
';
return $result;
}
@@ -2100,6 +2110,10 @@ sub end_table {
my $WARNING='';
#width of columns from TeXwidth attributes
+ # Protect against unbalanced tag.
+
+ if (scalar(@Apache::londefdef::table) > 0) {
+
for (my $in=0;$in<=$Apache::londefdef::table[-1]{'row_number'};$in++) {
for (my $jn=0;$jn<=$Apache::londefdef::table[-1]{'counter_columns'};$jn++) {
if ($Apache::londefdef::table[-1]{'TeXlen'}[0][$jn]<$Apache::londefdef::table[-1]{'TeXlen'}[$in][$jn]) {
@@ -2503,6 +2517,7 @@ sub end_table {
undef @Apache::londefdef::table;
}
}
+ }
return $currentstring;
}
@@ -3001,7 +3016,7 @@ sub start_img {
# &Apache::lonxml::debug("LaTeX rendering = $latex_rendering image file: $src");
- #if original gif/jpg/png file exist do following:
+ #if original bmp/gif/jpg/png file exist do following:
my $origsrc=$src;
my ($path,$file) = &get_eps_image($src);
# &Apache::lonnet::logthis("Image source: $src result: $path $file");
@@ -4402,8 +4417,8 @@ sub get_eps_image {
&Apache::lonnet::repcopy($orig_src); # Failure is not completely fatal.
}
&Apache::lonxml::debug("get_eps_image: Original image: $orig_src");
- my ($spath, $sname, $sext) = &fileparse($src, qr/\.(gif|png|jpg|jpeg)/i);
- $src=~s/\.(gif|png|jpg|jpeg)$/\.eps/i;
+ my ($spath, $sname, $sext) = &fileparse($src, qr/\.(bmp|gif|png|jpg|jpeg)/i);
+ $src=~s/\.(bmp|gif|png|jpg|jpeg)$/\.eps/i;
$src=&Apache::lonnet::filelocation($Apache::lonxml::pwd[-1],$src);
&Apache::lonxml::debug("Filelocation gives: $src");
if (! -e $src) {
@@ -4464,7 +4479,7 @@ sub eps_generation {
my $temp_file = Apache::File->new('>>'.$filename);
print $temp_file "$src\n";
my $newsrc = $src;
- $newsrc =~ s/(\.gif|\.jpg|\.jpeg)$/\.eps/i;
+ $newsrc =~ s/(\.bmp|\.gif|\.jpg|\.jpeg)$/\.eps/i;
$newsrc=~s{/home/httpd/html/res}{};
$newsrc=~s{/home/($LONCAPA::username_re)/public_html/}{/$1/};
$newsrc=~s{/\./}{/};