[LON-CAPA-cvs] cvs: loncom /interface lonprintout.pm

sakharuk lon-capa-cvs@mail.lon-capa.org
Thu, 15 Jul 2004 16:00:17 -0000


sakharuk		Thu Jul 15 12:00:17 2004 EDT

  Modified files:              
    /loncom/interface	lonprintout.pm 
  Log:
  Corrected two lines for single resource printing.
  
  
Index: loncom/interface/lonprintout.pm
diff -u loncom/interface/lonprintout.pm:1.315 loncom/interface/lonprintout.pm:1.316
--- loncom/interface/lonprintout.pm:1.315	Thu Jul 15 11:53:30 2004
+++ loncom/interface/lonprintout.pm	Thu Jul 15 12:00:16 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Printout
 #
-# $Id: lonprintout.pm,v 1.315 2004/07/15 15:53:30 sakharuk Exp $
+# $Id: lonprintout.pm,v 1.316 2004/07/15 16:00:16 sakharuk Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -540,11 +540,15 @@
 
 sub latex_corrections {
 
-    my ($number_of_columns,$result) = @_;
+    my ($number_of_columns,$result,$selectionmade) = @_;
 
 #    $result =~ s/\\includegraphics{/\\includegraphics\[width=\\minipagewidth\]{/g;
     $result =~ s/\$number_of_columns/$number_of_columns/g;
-    $result =~ s/(\\end{document})/\\strut\\vspace\*{-4 mm}\\newline\\noindent\\makebox\[\\textwidth\/$number_of_columns\]\[b\]{\\hrulefill}\\newline\\noindent\\tiny Printed from LON-CAPA\\copyright MSU{\\hfill} Licensed under GNU General Public License  $1/;
+    if ($selectionmade ne '1') {
+	$result =~ s/(\\end{document})/\\strut\\vspace\*{-4 mm}\\newline\\noindent\\makebox\[\\textwidth\/$number_of_columns\]\[b\]{\\hrulefill}\\newline\\noindent\\tiny Printed from LON-CAPA\\copyright MSU{\\hfill} Licensed under GNU General Public License  $1/;
+    } else {
+	$result =~ s/(\\end{document})/\\strut\\newline\\noindent\\makebox\[\\textwidth\/$number_of_columns\]\[b\]{\\hrulefill}\\newline\\noindent\\tiny Printed from LON-CAPA\\copyright MSU{\\hfill} Licensed under GNU General Public License  $1/;
+    }
     $result =~ s/(\\end{longtable}\s*)(\\strut\\newline\\noindent\\makebox\[\\textwidth\/$number_of_columns\]\[b\]{\\hrulefill})/$2$1/g;
     $result =~ s/(\\end{longtable}\s*)\\strut\\newline/$1/g;
 #-- LaTeX corrections     
@@ -1174,8 +1178,8 @@
     }
 #-------------------------------------------------------- corrections for the different page formats
     $result = &page_format_transformation($papersize,$laystyle,$numberofcolumns,$helper->{'VARS'}->{'PRINT_TYPE'},$result,$helper->{VARS}->{'assignment'},$helper->{'VARS'}->{'TABLE_CONTENTS'},$helper->{'VARS'}->{'TABLE_INDEX'},$selectionmade);
-    $result = &latex_corrections($number_of_columns,$result);
-    for (my $i=1;$i<=$#print_array;$i++) {$print_array[$i] = &latex_corrections($number_of_columns,$print_array[$i]);}
+    $result = &latex_corrections($number_of_columns,$result,$selectionmade);
+    for (my $i=1;$i<=$#print_array;$i++) {$print_array[$i] = &latex_corrections($number_of_columns,$print_array[$i],$selectionmade);}
     #changes page's parameters for the one column output 
     if ($numberofcolumns == 1) {
 	$result =~ s/\\textwidth\s*=\s*\d*\.?\d*\s*(cm|mm|in)/\\textwidth= $helper->{'VARS'}->{'pagesize.width'} $helper->{'VARS'}->{'pagesize.widthunit'} /;