[LON-CAPA-cvs] cvs: loncom /xml londefdef.pm
sakharuk
lon-capa-cvs@mail.lon-capa.org
Thu, 20 Jun 2002 17:49:37 -0000
sakharuk Thu Jun 20 13:49:37 2002 EDT
Modified files:
/loncom/xml londefdef.pm
Log:
changes for printing pages. Additional changes for exam printing are temporary
and can be ignored for now.
Index: loncom/xml/londefdef.pm
diff -u loncom/xml/londefdef.pm:1.64 loncom/xml/londefdef.pm:1.65
--- loncom/xml/londefdef.pm:1.64 Thu May 23 16:19:04 2002
+++ loncom/xml/londefdef.pm Thu Jun 20 13:49:37 2002
@@ -2,7 +2,7 @@
# The LearningOnline Network with CAPA
# Tags Default Definition Module
#
-# $Id: londefdef.pm,v 1.64 2002/05/23 20:19:04 sakharuk Exp $
+# $Id: londefdef.pm,v 1.65 2002/06/20 17:49:37 sakharuk Exp $
#
#
# Copyright Michigan State University Board of Trustees
@@ -52,7 +52,7 @@
BEGIN {
- &Apache::lonxml::register('Apache::londefdef',('m','html','head','map','select','option','input','textarea','form','meta','title','body','center','b','strong','dt','h1','h2','h3','h4','h5','h6','cite','i','address','dd','dl','dir','ol','ul','menu','dfn','kbd','tt','code','em','q','p','br','big','small','basefont','font','s','sub','strike','sup','hr','a','li','u','output','param','applet','img','embed','allow','frameset','pre','insert','externallink','table','tr','th','td'));
+ &Apache::lonxml::register('Apache::londefdef',('m','html','head','map','select','option','input','textarea','form','meta','title','body','center','b','strong','dt','h1','h2','h3','h4','h5','h6','cite','i','address','dd','dl','dir','ol','ul','menu','dfn','kbd','tt','code','em','q','p','br','big','small','basefont','font','s','sub','strike','sup','hr','a','li','u','output','param','applet','img','embed','allow','frameset','pre','insert','externallink','table','tr','th','td','blankspace','bubble','bubbles','bubbleline'));
}
@@ -122,7 +122,7 @@
$currentstring .= '\documentclass[letterpaper]{article}
\newcommand{\keephidden}[1]{}
\usepackage[dvips]{graphicx}
- \usepackage{epsfig}';
+ \usepackage{epsfig}\usepackage{calc}';
}
return $currentstring;
}
@@ -840,7 +840,7 @@
if ($target eq 'web') {
$currentstring .= $token->[4];
} elsif ($target eq 'tex') {
- $currentstring .= '\\\\';
+ $currentstring .= '\vskip 0 mm';
} elsif ($target eq 'latexsource') {
$currentstring .= '\\';
}
@@ -1676,6 +1676,93 @@
my $currentstring = '';
if ($target eq 'web') {
$currentstring .= '';
+ }
+ return $currentstring;
+ }
+#-- <blankspace heigth="">
+ sub start_blankspace {
+ my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
+ my $currentstring = '';
+ if ($target eq 'tex') {
+ my $howmuch = &Apache::lonxml::get_param('heigth',$parstack,$safeeval);
+ $currentstring .= '\vskip '.$howmuch.' ';
+ }
+ return $currentstring;
+ }
+ sub end_blankspace {
+ my ($target,$token) = @_;
+ my $currentstring = '';
+ if ($target eq 'tex') {
+ $currentstring .= '';
+ }
+ return $currentstring;
+ }
+#-- <bubble symbol="">
+ sub start_bubble {
+ my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
+ my $currentstring = '';
+ my $sign = &Apache::lonxml::get_param('symbol',$parstack,$safeeval);
+ if ($target eq 'web') {
+ $currentstring .= '<td><b>'.$sign.')</b>';
+ } elsif ($target eq 'tex') {
+ $currentstring .= '{\small\mbox{'.$sign.')\hskip 1mm ';
+ }
+ return $currentstring;
+ }
+ sub end_bubble {
+ my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
+ my $currentstring = '';
+ if ($target eq 'web') {
+ $currentstring .= '</td>';
+ } elsif ($target eq 'tex') {
+ $currentstring .= '}} &';
+ }
+ return $currentstring;
+ }
+#-- <bubbles>
+ sub start_bubbles {
+ my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
+ my $currentstring = '';
+ if ($target eq 'web') {
+ $currentstring .= '<table border=1>';
+ } elsif ($target eq 'tex') {
+ my $howmuch = &Apache::lonxml::get_param('num',$parstack,$safeeval);
+ $currentstring .= '\noindent\fbox{\begin{tabular}{' ;
+ for (my $id=0;$id<$howmuch;$id++) {$currentstring .= 'l ';}
+ $currentstring .= '}';
+ }
+ return $currentstring;
+ }
+ sub end_bubbles {
+ my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
+ my $currentstring = '';
+ if ($target eq 'web') {
+ $currentstring .= '</table>';
+ } elsif ($target eq 'tex') {
+ $currentstring .= '\end{tabular}}\vskip 5mm';
+ }
+ return $currentstring;
+ }
+#-- <bubbleline>
+ sub start_bubbleline {
+ my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
+ my $currentstring = '';
+ if ($target eq 'web') {
+ $currentstring .= '<tr>';
+ } elsif ($target eq 'tex') {
+ &Apache::lonxml::startredirection();
+ }
+ return $currentstring;
+ }
+ sub end_bubbleline {
+ my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
+ my $currentstring = '';
+ if ($target eq 'web') {
+ $currentstring .= '</tr>';
+ } elsif ($target eq 'tex') {
+ my $data = &Apache::lonxml::endredirection();
+ $data =~ s/&\s*$//;
+ $currentstring .= $data.'\\\\ ';
}
return $currentstring;
}