--- loncom/interface/printout.pl 2006/06/19 21:40:29 1.102 +++ loncom/interface/printout.pl 2006/06/20 09:39:47 1.104 @@ -234,7 +234,8 @@ print "Return $eps_f"; # Debugging @@ -728,6 +729,9 @@ sub repaginate { my @pages_in_student; # For each student his/her initial page count. my $max_pages = 0; # Pages in 'longest' student. my $page_number = 0; + &Apache::lonhtmlcommon::Update_PrgWin('',\%prog_state, + "Counting pages for student: ".$student_number+1); + while ($line = ) { # Check for total pages (%%Pages:) @@ -756,7 +760,9 @@ sub repaginate { if ($line =~ /ENDOFSTUDENTSTAMP/) { $pages_in_student[$student_number] = $page_number; $student_number++; - + &Apache::lonhtmlcommon::Update_PrgWin('',\%prog_state, + "Counting pages for student: ".$student_number+1); + if ($page_number > $max_pages) { $max_pages = $page_number; } @@ -769,12 +775,15 @@ sub repaginate { close(PSFILE); # If 2 columns, max_pages must go to an even number of columns: + + &Apache::lonnet::logthis("Before 2 col adjust max-pages = $max_pages"); if ($num_columns == 2) { if ($max_pages % 2) { $max_pages++; } } + &Apache::lonnet::logthis("after adjust: $max_pages"); # Now rewrite the LaTex file, substituting our \special # with an appropriate number of \newpage directives. @@ -786,6 +795,8 @@ sub repaginate { $student_number = 0; # first student... + &Apache::lonhtmlcommon::Update_PrgWin('',\%prog_state, + "Repaginating student ".$student_number+1); while (my $line = ) { if ($line eq "\\special{ps:ENDOFSTUDENTSTAMP}\n") { @@ -795,12 +806,15 @@ sub repaginate { # End of student replace with 0 or more newpages. my $addlines = $max_pages - $pages_in_student[$student_number]; + &Apache::lonnet::logthis("student: $pages_in_student[$student_number] add: $addlines"); while($addlines) { - print LATEXOUT '\newpage'; + print LATEXOUT '\pagebreak'; $addlines--; } $student_number++; + &Apache::lonhtmlcommon::Update_PrgWin('',\%prog_state, + "Repaginating student ".$student_number+1); } else { print LATEXOUT $line;