version 1.379, 2007/10/15 19:40:53
|
version 1.384, 2008/03/17 10:21:30
|
Line 200 sub start_html {
|
Line 200 sub start_html {
|
'\usepackage[dvips]{graphicx}'. |
'\usepackage[dvips]{graphicx}'. |
'\usepackage{wrapfig}'. |
'\usepackage{wrapfig}'. |
'\usepackage{picins}'. |
'\usepackage{picins}'. |
|
'\usepackage[utf8]{inputenc}'."\n". |
'\usepackage{epsfig}'. |
'\usepackage{epsfig}'. |
'\usepackage{calc}'. |
'\usepackage{calc}'. |
'\usepackage{amsmath}'. |
'\usepackage{amsmath}'. |
Line 1585 sub start_div {
|
Line 1586 sub start_div {
|
} |
} |
if ($target eq 'tex') { |
if ($target eq 'tex') { |
# 4 possible alignments: left, right, center, and -missing-. |
# 4 possible alignments: left, right, center, and -missing-. |
|
# If inside a table row, we must let the table logic |
|
# do the alignment, however. |
|
# |
|
|
my $endstring = ''; |
my $endstring = ''; |
|
|
Line 1595 sub start_div {
|
Line 1599 sub start_div {
|
$endstring = '\end{center}'; |
$endstring = '\end{center}'; |
if (&is_inside_of($tagstack, "table")) { |
if (&is_inside_of($tagstack, "table")) { |
$currentstring = ¢er_correction().$currentstring; |
$currentstring = ¢er_correction().$currentstring; |
|
$endstring .= ¢er_end_correction(); |
} |
} |
} |
} |
elsif ($align eq 'right') { |
elsif ($align eq 'right') { |
Line 1650 sub end_a {
|
Line 1655 sub end_a {
|
&Apache::lonxml::get_param('href',$parstack,$safeeval,undef,1); |
&Apache::lonxml::get_param('href',$parstack,$safeeval,undef,1); |
my $name = |
my $name = |
&Apache::lonxml::get_param('name',$parstack,$safeeval,undef,1); |
&Apache::lonxml::get_param('name',$parstack,$safeeval,undef,1); |
if ($href =~ /\S/) { |
my $uriprint = |
|
&Apache::lonxml::get_param('uriprint',$parstack,$safeeval,undef,1); |
|
my $anchorprint = |
|
&Apache::lonxml::get_param('anchorprint',$parstack,$safeeval,undef,1); |
|
if (($href =~ /\S/) && ($uriprint=~/^on|uriprint|yes|1$/i)) { |
$href =~ s/([^\\])%/$1\\\%/g; |
$href =~ s/([^\\])%/$1\\\%/g; |
# Substitute special symbols... and allow line breaks at each / |
# Substitute special symbols... and allow line breaks at each / |
# |
# |
$href = &Apache::lonxml::latex_special_symbols($href); |
$href = &Apache::lonxml::latex_special_symbols($href); |
$href =~ s/\//\/\\-/g; # Map / to /\- to allow hyphenation. |
$href =~ s/\//\/\\-/g; # Map / to /\- to allow hyphenation. |
$currentstring .= ' ({\tt URI:'.$href.'})'; |
$currentstring .= ' ({\tt URI:'.$href.'})'; |
} elsif ($name =~ /\S/) { |
} elsif (($name =~ /\S/) && ($anchorprint=~/^on|anchorprint|yes|1$/i)) { |
$currentstring .= ' ({\tt Anchor:'.&Apache::lonxml::latex_special_symbols($name).'})'; |
$currentstring .= ' ({\tt Anchor:'.&Apache::lonxml::latex_special_symbols($name).'})'; |
} else { |
} else { |
$currentstring.=''; |
$currentstring.=''; |
Line 2092 sub end_table {
|
Line 2101 sub end_table {
|
my $WARNING=''; |
my $WARNING=''; |
#width of columns from TeXwidth attributes |
#width of columns from TeXwidth attributes |
|
|
|
# Protect against unbalanced </table> tag. |
|
|
|
if (scalar(@Apache::londefdef::table) > 0) { |
|
|
for (my $in=0;$in<=$Apache::londefdef::table[-1]{'row_number'};$in++) { |
for (my $in=0;$in<=$Apache::londefdef::table[-1]{'row_number'};$in++) { |
for (my $jn=0;$jn<=$Apache::londefdef::table[-1]{'counter_columns'};$jn++) { |
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]) { |
if ($Apache::londefdef::table[-1]{'TeXlen'}[0][$jn]<$Apache::londefdef::table[-1]{'TeXlen'}[$in][$jn]) { |
Line 2495 sub end_table {
|
Line 2508 sub end_table {
|
undef @Apache::londefdef::table; |
undef @Apache::londefdef::table; |
} |
} |
} |
} |
|
} |
return $currentstring; |
return $currentstring; |
} |
} |
|
|
Line 3059 sub start_img {
|
Line 3073 sub start_img {
|
my $width= &Apache::lonxml::get_param('width',$parstack,$safeeval); |
my $width= &Apache::lonxml::get_param('width',$parstack,$safeeval); |
my $height= &Apache::lonxml::get_param('height',$parstack,$safeeval); |
my $height= &Apache::lonxml::get_param('height',$parstack,$safeeval); |
|
|
|
if ($token->[2]{'src'}=~/\$/) { |
$currentstring .= '<img src="'.$src.'" alt="'.$alt.'" '; |
$currentstring.='Variable image source'; |
if ($width) { $currentstring.=' width="'.$width.'" '; } |
} else { |
if ($height) { $currentstring.=' height="'.$height.'" '; } |
$currentstring .= '<img src="'.$src.'" alt="'.$alt.'" '; |
$currentstring .= ' />'; |
if ($width) { $currentstring.=' width="'.$width.'" '; } |
|
if ($height) { $currentstring.=' height="'.$height.'" '; } |
|
$currentstring .= ' />'; |
|
} |
} elsif ($target eq 'modified') { |
} elsif ($target eq 'modified') { |
my ($osrc,$owidth,$oheight)= |
my ($osrc,$owidth,$oheight)= |
($token->[2]{'src'},$token->[2]{'width'},$token->[2]{'height'}); |
($token->[2]{'src'},$token->[2]{'width'},$token->[2]{'height'}); |