version 1.134, 2003/05/21 14:57:31
|
version 1.141, 2003/06/19 18:45:57
|
Line 54 use Apache::lonmeta();
|
Line 54 use Apache::lonmeta();
|
|
|
BEGIN { |
BEGIN { |
|
|
&Apache::lonxml::register('Apache::londefdef',('a','abbr','acronym','accessrule','address','allow','applet','area','b','base','basefont','bgo','bgsound','big','blink','blockquote','blankspace','body','br','button','caption','center','cite','code','col','colgroup','dd','del','dfn','dir','div','dl','dt','em','embed','externallink','fieldset','font','form','frame','frameset','h1','h2','h3','h4','h5','h6','head','hr','html','i','iframe','img','input','ins','insert','isindex','kbd','keygen','label','layer','legend','li','link','m','map','marquee','menu','meta','multicol','nobr','noembed','noframes','nolayer','noscript','object','ol','optgroup','option','output','p','param','pre','q','s','samp','select','server','small','spacer','span','strike','strong','sub','sup','table','tbody','td','textarea','tfoot','th','thead','title','tr','tt','tthoption','u','ul','var','wbr')); |
&Apache::lonxml::register('Apache::londefdef',('a','abbr','acronym','accessrule','address','allow','applet','area','b','base','basefont','bgo','bgsound','big','blink','blockquote','blankspace','body','br','button','caption','center','cite','code','col','colgroup','dd','del','dfn','dir','div','dl','dt','em','embed','externallink','fieldset','font','form','frame','frameset','h1','h2','h3','h4','h5','h6','head','hr','html','i','iframe','img','input','ins','insert','isindex','kbd','keygen','label','layer','legend','li','link','m','map','marquee','menu','meta','multicol','nobr','noembed','noframes','nolayer','noscript','object','ol','optgroup','option','output','p','param','pre','q','s','samp','select','server','small','spacer','span','strike','strong','sub','sup','table','tbody','td','textarea','tfoot','th','thead','title','tr','tt','tthoption','u','ul','var','wbr','hideweboutput')); |
|
|
} |
} |
|
|
Line 158 sub start_html {
|
Line 158 sub start_html {
|
} elsif ($target eq 'tex') { |
} elsif ($target eq 'tex') { |
@Apache::londefdef::table = (); |
@Apache::londefdef::table = (); |
$currentstring .= '\documentclass[letterpaper]{article} |
$currentstring .= '\documentclass[letterpaper]{article} |
|
\batchmode |
\newcommand{\keephidden}[1]{} |
\newcommand{\keephidden}[1]{} |
\renewcommand{\deg}{$^{\circ}$} |
\renewcommand{\deg}{$^{\circ}$} |
\usepackage{textcomp} |
\usepackage{textcomp} |
Line 354 sub start_meta {
|
Line 355 sub start_meta {
|
} else { |
} else { |
$currentstring = $token->[4]; |
$currentstring = $token->[4]; |
} |
} |
} |
} elsif ($target eq 'meta') { |
if ($target eq 'meta') { |
|
unless (&Apache::lonxml::get_param |
unless (&Apache::lonxml::get_param |
('http-equiv',$parstack,$safeeval,undef,1)) { |
('http-equiv',$parstack,$safeeval,undef,1)) { |
my $name=$token->[2]->{'name'}; |
my $name=$token->[2]->{'name'}; |
Line 366 sub start_meta {
|
Line 366 sub start_meta {
|
$currentstring='<'.$name.'>'. |
$currentstring='<'.$name.'>'. |
&Apache::lonxml::get_param |
&Apache::lonxml::get_param |
('content',$parstack,$safeeval,undef,1). |
('content',$parstack,$safeeval,undef,1). |
'</'.$name.'>'; |
'</'.$name.'>'; |
} |
} |
} |
} |
|
} elsif ($target eq 'tex') { |
|
&Apache::lonxml::startredirection(); |
} |
} |
return $currentstring; |
return $currentstring; |
} |
} |
Line 382 sub end_meta {
|
Line 384 sub end_meta {
|
if ($args ne '') { |
if ($args ne '') { |
$currentstring = $token->[4]; |
$currentstring = $token->[4]; |
} |
} |
} |
} elsif ($target eq 'tex') { |
|
$currentstring=&Apache::lonxml::endredirection(); |
|
$currentstring=''; |
|
} |
return $currentstring; |
return $currentstring; |
} |
} |
|
|
Line 1133 sub start_big {
|
Line 1138 sub start_big {
|
if ($target eq 'web') { |
if ($target eq 'web') { |
$currentstring .= $token->[4]; |
$currentstring .= $token->[4]; |
} elsif ($target eq 'tex') { |
} elsif ($target eq 'tex') { |
$currentstring .= '\large{'; |
$currentstring .= '{\large '; |
} elsif ($target eq 'latexsource') { |
} elsif ($target eq 'latexsource') { |
$currentstring .= '{\Large '; |
$currentstring .= '{\Large '; |
} |
} |
Line 1696 sub end_dd {
|
Line 1701 sub end_dd {
|
#-- <table> tag |
#-- <table> tag |
sub start_table { |
sub start_table { |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_; |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_; |
my $textwidth; |
my $textwidth=''; |
if (not defined @Apache::londefdef::table) { |
if (not defined @Apache::londefdef::table) { |
$textwidth=&recalc($ENV{'form.textwidth'}); |
$textwidth=&recalc($ENV{'form.textwidth'}); |
$textwidth=~/(\d+)/; |
$textwidth=~/(\d+\.?\d*)/; |
$textwidth=$1; |
$textwidth=0.95*$1; |
} else { |
} else { |
$textwidth=&Apache::lonxml::get_param('TeXwidth',$parstack,$safeeval,undef,0); |
$textwidth=&Apache::lonxml::get_param('TeXwidth',$parstack,$safeeval,undef,0); |
} |
} |
Line 1742 sub start_table {
|
Line 1747 sub start_table {
|
$Apache::londefdef::table[-1]{'vvinc'} = ''; |
$Apache::londefdef::table[-1]{'vvinc'} = ''; |
} |
} |
$Apache::londefdef::table[-1]{'output'} = ' \noindent \begin{tabular} '; |
$Apache::londefdef::table[-1]{'output'} = ' \noindent \begin{tabular} '; |
$currentstring = '\keephidden{NEW TABLE ENTRY '.$textwidth.'}'; |
$currentstring = '\keephidden{NEW TABLE ENTRY '.$textwidth.' }'; |
} |
} |
return $currentstring; |
return $currentstring; |
} |
} |
Line 1820 sub end_table {
|
Line 1825 sub end_table {
|
} else { |
} else { |
$currentstring .= $Apache::londefdef::table[-1]{'output'}; |
$currentstring .= $Apache::londefdef::table[-1]{'output'}; |
pop @Apache::londefdef::table; |
pop @Apache::londefdef::table; |
|
undef @Apache::londefdef::table; |
} |
} |
} |
} |
return $currentstring; |
return $currentstring; |
Line 2194 sub start_allow {
|
Line 2200 sub start_allow {
|
my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_; |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_; |
my $src = &Apache::lonxml::get_param('src',$parstack,$safeeval,undef,1); |
my $src = &Apache::lonxml::get_param('src',$parstack,$safeeval,undef,1); |
$src=&Apache::lonnet::filelocation($Apache::lonxml::pwd[-1],$src); |
$src=&Apache::lonnet::filelocation($Apache::lonxml::pwd[-1],$src); |
$Apache::lonxml::extlinks[$#Apache::lonxml::extlinks+1]=$src; |
$Apache::lonxml::extlinks[$#Apache::lonxml::extlinks+1]= |
|
&Apache::lonnet::clutter($src); |
&image_replication($src); |
&image_replication($src); |
my $result; |
my $result; |
if ($target eq 'edit') { |
if ($target eq 'edit') { |
Line 2267 sub start_pre {
|
Line 2274 sub start_pre {
|
if ($target eq 'web') { |
if ($target eq 'web') { |
$currentstring .= $token->[4]; |
$currentstring .= $token->[4]; |
} elsif ($target eq 'tex') { |
} elsif ($target eq 'tex') { |
my $width = &Apache::lonxml::get_param('TeXwidth',$parstack,$safeeval,undef,0); |
$currentstring .= '\begin{verbatim}'; |
if (not defined $width) {$width ='\textwidth';} |
|
$currentstring .= '\parbox['.$width.']{\begin{verbatim}'; |
|
} |
} |
return $currentstring; |
return $currentstring; |
} |
} |
Line 2280 sub end_pre {
|
Line 2285 sub end_pre {
|
if ($target eq 'web') { |
if ($target eq 'web') { |
$currentstring .= $token->[2]; |
$currentstring .= $token->[2]; |
} elsif ($target eq 'tex') { |
} elsif ($target eq 'tex') { |
$currentstring .= '\end{verbatim}}'; |
$currentstring .= '\end{verbatim}'; |
} |
} |
return $currentstring; |
return $currentstring; |
} |
} |