--- loncom/interface/lonprintout.pm 2006/08/01 18:46:07 1.472
+++ loncom/interface/lonprintout.pm 2006/08/03 00:26:39 1.475
@@ -2,7 +2,7 @@
# The LearningOnline Network
# Printout
#
-# $Id: lonprintout.pm,v 1.472 2006/08/01 18:46:07 albertel Exp $
+# $Id: lonprintout.pm,v 1.475 2006/08/03 00:26:39 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -833,9 +833,9 @@ sub latex_corrections {
# $result =~ s/\\includegraphics{/\\includegraphics\[width=\\minipagewidth\]{/g;
$result =~ s/\$number_of_columns/$number_of_columns/g;
if ($selectionmade eq '1' || $answer_mode eq 'only') {
- $result =~ s/(\\end{document})/\\strut\\vskip 0 mm\\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{document})/\\strut\\vskip 0 mm\\noindent\\makebox\[\\textwidth\/$number_of_columns\]\[b\]{\\hrulefill}\\newline\\noindent\\tiny Printed from LON-CAPA\\copyright MSU{\\hfill} Licensed under GNU General Public License \newpage \n\\special{ps:ENDOFSTUDENTSTAMP}\n $1/;
} else {
- $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/;
+ $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 \newpage \n\\special{ps:ENDOFSTUDENTSTAMP}\n $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;
@@ -893,7 +893,7 @@ sub IndexCreation {
sub print_latex_header {
my $mode=shift;
- my $output='\documentclass[letterpaper,twoside]{article}';
+ my $output='\documentclass[letterpaper,twoside]{article}\raggedbottom';
if (($mode eq 'batchmode') || (!$perm{'pav'})) {
$output.='\batchmode';
}
@@ -1754,12 +1754,6 @@ ENDPART
$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,$selectionmade,
$helper->{'VARS'}->{'ANSWER_TYPE'});
- for (my $i=1;$i<=$#print_array;$i++) {
- $print_array[$i] =
- &latex_corrections($number_of_columns,$print_array[$i],
- $selectionmade,
- $helper->{'VARS'}->{'ANSWER_TYPE'});
- }
#if ($numberofcolumns == 1) {
$result =~ s/\\textwidth\s*=\s*-?\d*\.?\d*\s*(cm|mm|in)/\\textwidth= $helper->{'VARS'}->{'pagesize.width'} $helper->{'VARS'}->{'pagesize.widthunit'} /;
$result =~ s/\\textheight\s*=?\s*-?\d*\.?\d*\s*(cm|mm|in)/\\textheight $helper->{'VARS'}->{'pagesize.height'} $helper->{'VARS'}->{'pagesize.heightunit'} /;
@@ -1786,9 +1780,15 @@ ENDPART
if ($i==0) {
$print_array[$i]=$result;
} else {
+ $print_array[$i].='\end{document}';
+ $print_array[$i] =
+ &latex_corrections($number_of_columns,$print_array[$i],
+ $selectionmade,
+ $helper->{'VARS'}->{'ANSWER_TYPE'});
+
my $anobegin=index($print_array[$i],'\setcounter{page}',0);
substr($print_array[$i],0,$anobegin)='';
- $print_array[$i]=$inc.$print_array[$i].'\end{document}';
+ $print_array[$i]=$inc.$print_array[$i];
}
my $temp_file;
my $newfilename=$filename;
@@ -2003,15 +2003,14 @@ sub print_resources {
my $blankpages = '';
for (my $j=0;$j<$helper->{'VARS'}->{'EMPTY_PAGES'};$j++) {$blankpages.='\clearpage\strut\clearpage';}
if ($columns_in_format == 1) {
- $current_output = '\strut\vspace*{-6 mm}\\newline\\noindent\\makebox[\\textwidth/$number_of_columns][b]{\\hrulefill}\vspace*{-2 mm}\\newline\\noindent{\\tiny Printed from LON-CAPA\\copyright MSU{\\hfill} Licensed under GNU General Public License }\\newpage '.$blankpages.'\setcounter{page}{1}\noindent\parbox{\minipagewidth}{\noindent\\lhead{'.$HeaderLine.'}'.$namepostfix.'} \vskip 5 mm '.$current_output;
+ $current_output = '\strut\vspace*{-6 mm}\\newline\\noindent\\makebox[\\textwidth/$number_of_columns][b]{\\hrulefill}\vspace*{-2 mm}\\newline\\noindent{\\tiny Printed from LON-CAPA\\copyright MSU{\\hfill} Licensed under GNU General Public License }\\newpage '.$blankpages."\n\\special{ps:ENDOFSTUDENTSTAMP}\n".'\setcounter{page}{1}\noindent\parbox{\minipagewidth}{\noindent\\lhead{'.$HeaderLine.'}'.$namepostfix.'} \vskip 5 mm '.$current_output;
} else {
- $current_output = '\strut\vspace*{-6 mm}\\newline\\noindent\\makebox[\\textwidth/$number_of_columns][b]{\\hrulefill}\vspace*{-2 mm}\\newline\\noindent{\\tiny Printed from LON-CAPA\\copyright MSU{\\hfill} Licensed under GNU General Public License }\\newpage '.$blankpages.'\setcounter{page}{1}\noindent\parbox{\minipagewidth}{\noindent\\fancyhead[LO]{'.$HeaderLine.'}'.$namepostfix.'} \vskip 5 mm '.$current_output;
+ $current_output = '\strut\vspace*{-6 mm}\\newline\\noindent\\makebox[\\textwidth/$number_of_columns][b]{\\hrulefill}\vspace*{-2 mm}\\newline\\noindent{\\tiny Printed from LON-CAPA\\copyright MSU{\\hfill} Licensed under GNU General Public License }\\newpage '.$blankpages."\n\\special{ps:ENDOFSTUDENTSTAMP}\n".'\setcounter{page}{1}\noindent\parbox{\minipagewidth}{\noindent\\fancyhead[LO]{'.$HeaderLine.'}'.$namepostfix.'} \vskip 5 mm '.$current_output;
}
}
#
# Close the student bracketing.
#
- $current_output .= "\n\\special{ps:ENDOFSTUDENTSTAMP}\n";
return ($current_output,$fullname, $printed);
}
@@ -2318,7 +2317,7 @@ ALL_PROBLEMS
if ($helper->{VARS}->{'assignment'}) {
push @{$printChoices}, [&mt("Selected Problems from folder [_1] for selected students",$sequenceTitle), 'problems_for_students', 'CHOOSE_STUDENTS'];
- push @{$printChoices}, [&mt("Selected Problems from folder [_1] for CODEd assinments",$sequenceTitle), 'problems_for_anon', 'CHOOSE_ANON1'];
+ push @{$printChoices}, [&mt("Selected Problems from folder [_1] for CODEd assignments",$sequenceTitle), 'problems_for_anon', 'CHOOSE_ANON1'];
}
# resource_selector will hold a few states that: