--- loncom/xml/lontable.pm 2010/08/11 10:57:36 1.11 +++ loncom/xml/lontable.pm 2010/08/27 09:42:49 1.12 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Generating TeX tables. # -# $Id: lontable.pm,v 1.11 2010/08/11 10:57:36 foxr Exp $ +# $Id: lontable.pm,v 1.12 2010/08/27 09:42:49 foxr Exp $ # # # Copyright Michigan State University Board of Trustees @@ -38,7 +38,7 @@ # # This module is a support packkage that helps londefdef generate -# LaTeX tables using the LaTeX::Table package. A prerequisite is that +# LaTeX tables using the Apache::lonlatextable package. A prerequisite is that # the print generator must have added the following to the LaTeX # # \usepackage{xtab} @@ -55,17 +55,17 @@ package Apache::lontable; use strict; -use LaTeX::Table; +use Apache::lonlatextable; use Apache::lonnet; # for trace logging. -my $tracing = 0; # Set to 1 to enable log tracing. 2 for local sub tracing. +my $tracing = 1; # Set to 1 to enable log tracing. 2 for local sub tracing. =pod =head1 lontable Table generation assistant for the LaTeX target This module contains support software for generating tables in LaTeX output mode -In this implementation, we use the LaTeX::Table package to do the actual final formatting. +In this implementation, we use the Apache::lonlatextable package to do the actual final formatting. Each table creates a new object. Table objects can have global properties configured. The main operations on a table object are: @@ -131,8 +131,8 @@ The table caption text. The theme of the table to use. Defaults to Zurich. Themes we know about are: NYC, NYC2, Zurich, Berlin, Dresden, Houston, Miami, plain, Paris. Other themes can be added -to the LaTeX::Table package, and they will become supported automatically, as theme names are -not error checked. Any use of a non-existent theme is reported by the LaTeX::Table package +to the Apache::lonlatextable package, and they will become supported automatically, as theme names are +not error checked. Any use of a non-existent theme is reported by the Apache::lonlatextable package when the table text is generated. =item width @@ -730,10 +730,8 @@ sub generate { my $colunits; if($tracing) {&Apache::lonnet::logthis("generate"); } - my $table = LaTeX::Table->new(); - $table->set_center(0); # loncapa tables don't float. - $table->set_environment(0); - $table->set_theme($this->{'theme'}); + my $table = Apache::lonlatextable->new(); + # Add the caption if supplied. @@ -847,7 +845,6 @@ sub generate { } } if ($inner_border && ($cells->[$cell]->{'rowspan'} == 1)) { - &Apache::lonnet::logthis("Pushing underlines $inner_border"); my $lastcol = $nextcol -1; push(@underlines, "\\cline{$startcol-$lastcol}"); } @@ -859,7 +856,6 @@ sub generate { } push(@data, \@row); if ($inner_border) { - &Apache::lonnet::logthis("Pushing underlines with inner_border"); for (my $i =0; $i < scalar(@underlines); $i++) { push(@data, [$underlines[$i]]); } @@ -878,7 +874,6 @@ sub generate { my $coldef = ""; if ($outer_border || $inner_border) { - &Apache::lonnet::logthis("adding | $outer_border : $inner_border"); $coldef .= '|'; } for (my $i =0; $i < $column_count; $i++) { @@ -898,6 +893,7 @@ sub generate { if ($tracing) { &Apache::lonnet::logthis("Leaving generate"); } + return $table; }