Diff for /loncom/interface/lonprintout.pm between versions 1.475 and 1.476

version 1.475, 2006/08/03 00:26:39 version 1.476, 2006/08/03 02:36:56
Line 827  sub details_for_menu { Line 827  sub details_for_menu {
     return ($name_of_resource,$name_of_sequence,$name_of_map);      return ($name_of_resource,$name_of_sequence,$name_of_map);
 }  }
   
   sub copyright_line {
       return '\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 } ';
   }
   my $end_of_student = "\n".'\special{ps:ENDOFSTUDENTSTAMP}'."\n";
   
 sub latex_corrections {  sub latex_corrections {
     my ($number_of_columns,$result,$selectionmade,$answer_mode) = @_;      my ($number_of_columns,$result,$selectionmade,$answer_mode) = @_;
 #    $result =~ s/\\includegraphics{/\\includegraphics\[width=\\minipagewidth\]{/g;  #    $result =~ s/\\includegraphics{/\\includegraphics\[width=\\minipagewidth\]{/g;
     $result =~ s/\$number_of_columns/$number_of_columns/g;      my $copyright = &copyright_line();
     if ($selectionmade eq '1' || $answer_mode eq 'only') {      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 \newpage \n\\special{ps:ENDOFSTUDENTSTAMP}\n $1/;   $result =~ s/(\\end{document})/\\strut\\vskip 0 mm $copyright $end_of_student $1/;
     } else {      } 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 \newpage \n\\special{ps:ENDOFSTUDENTSTAMP}\n $1/;   $result =~ s/(\\end{document})/\\strut\\vspace\*{-4 mm}\\newline $copyright $end_of_student $1/;
     }      }
       $result =~ s/\$number_of_columns/$number_of_columns/g;
     $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\\noindent\\makebox\[\\textwidth\/$number_of_columns\]\[b\]{\\hrulefill})/$2$1/g;
     $result =~ s/(\\end{longtable}\s*)\\strut\\newline/$1/g;      $result =~ s/(\\end{longtable}\s*)\\strut\\newline/$1/g;
 #-- LaTeX corrections       #-- LaTeX corrections     
Line 1899  sub print_resources { Line 1904  sub print_resources {
   
     &Apache::lonxml::clear_problem_counter();      &Apache::lonxml::clear_problem_counter();
     my %page_breaks  = &get_page_breaks($helper);      my %page_breaks  = &get_page_breaks($helper);
     my @format_array = split(/\|/,$helper->{'VARS'}->{'FORMAT'});      my $columns_in_format = (split(/\|/,$helper->{'VARS'}->{'FORMAT'}))[1];
     my $columns_in_format = $format_array[1];  
     #      #
     #   end each student with a       #   end each student with a 
     #   Special that allows the post processor to even out the page      #   Special that allows the post processor to even out the page
Line 1990  sub print_resources { Line 1994  sub print_resources {
     if (defined($courseidinfo)) { $courseidinfo=' - '.$courseidinfo }      if (defined($courseidinfo)) { $courseidinfo=' - '.$courseidinfo }
     if ($usersection ne '') {$courseidinfo.=' - Sec. '.$usersection}      if ($usersection ne '') {$courseidinfo.=' - Sec. '.$usersection}
     my $currentassignment=&Apache::lonxml::latex_special_symbols($helper->{VARS}->{'assignment'},'header');      my $currentassignment=&Apache::lonxml::latex_special_symbols($helper->{VARS}->{'assignment'},'header');
     my $HeaderLine = $parmhash{'print_header_format'};      my $header_line =
     $HeaderLine = format_page_header($HeaderLine, $currentassignment, $courseidinfo, $fullname);   &format_page_header($parmhash{'print_header_format'},
     if ($current_output=~/\\documentclass/) {      $currentassignment, $courseidinfo, $fullname);
  if ($columns_in_format == 1) {      my $header_start = ($columns_in_format == 1) ? '\lhead'
     $current_output =~ s/\\begin{document}/\\setlength{\\topmargin}{1cm} \\begin{document}\\noindent\\parbox{\\minipagewidth}{\\noindent\\lhead{$HeaderLine$namepostfix}}\\vskip 5 mm /;                                           : '\fancyhead[LO]';
  } else {      $header_line = $header_start.'{'.$header_line.'}';
         $current_output =~ s/\\begin{document}/\\setlength{\\topmargin}{1cm} \\begin{document}\\noindent\\parbox{\\minipagewidth}{\\noindent\\fancyhead[LO]{$HeaderLine$namepostfix}}\\vskip 5 mm /;  
   
  }      if ($current_output=~/\\documentclass/) {
    $current_output =~ s/\\begin{document}/\\setlength{\\topmargin}{1cm} \\begin{document}\\noindent\\parbox{\\minipagewidth}{\\noindent$header_line$namepostfix}\\vskip 5 mm /;
     } else {      } else {
  my $blankpages = '';   my $blankpages = 
  for (my $j=0;$j<$helper->{'VARS'}->{'EMPTY_PAGES'};$j++) {$blankpages.='\clearpage\strut\clearpage';}      '\clearpage\strut\clearpage'x$helper->{'VARS'}->{'EMPTY_PAGES'};
  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."\n\\special{ps:ENDOFSTUDENTSTAMP}\n".'\setcounter{page}{1}\noindent\parbox{\minipagewidth}{\noindent\\lhead{'.$HeaderLine.'}'.$namepostfix.'} \vskip 5 mm '.$current_output;   $current_output = '\strut\vspace*{-6 mm}\\newline'.
  } else {      &copyright_line().' \newpage '.$blankpages.$end_of_student.
    $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;      '\setcounter{page}{1}\noindent\parbox{\minipagewidth}{\noindent'.
  }      $header_line.$namepostfix.'} \vskip 5 mm '.$current_output;
     }      }
     #      #
     #  Close the student bracketing.      #  Close the student bracketing.

Removed from v.1.475  
changed lines
  Added in v.1.476


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>