Diff for /loncom/interface/lonprintout.pm between versions 1.417 and 1.418

version 1.417, 2006/01/27 00:06:52 version 1.418, 2006/01/27 22:07:10
Line 687  sub page_format_transformation { Line 687  sub page_format_transformation {
     my $topmargintoinsert = '';      my $topmargintoinsert = '';
     if ($topmargin ne '0') {$topmargintoinsert='\setlength{\topmargin}{'.$topmargin.'}';}      if ($topmargin ne '0') {$topmargintoinsert='\setlength{\topmargin}{'.$topmargin.'}';}
     my $fancypagestatement='';      my $fancypagestatement='';
     &Apache::lonnet::logthis("1: columns = $numberofcolumns");  
     if ($numberofcolumns eq '2') {      if ($numberofcolumns eq '2') {
  $fancypagestatement="\\fancyhead{}\\fancyhead[LO]{\\textbf{$name} $courseidinfo \\hfill \\thepage \\\\ \\textit{$assignment}}";   $fancypagestatement="\\fancyhead{}\\fancyhead[LO]{\\textbf{$name} $courseidinfo \\hfill \\thepage \\\\ \\textit{$assignment}}";
     } else {      } else {
Line 967  sub recently_generated { Line 966  sub recently_generated {
 #    A reference to a page break hash.  #    A reference to a page break hash.
 #  #
 #  #
 use Data::Dumper;  #use Data::Dumper;
 sub dump_helper_vars {  #sub dump_helper_vars {
     my ($helper) = @_;  #    my ($helper) = @_;
     my $helpervars = Dumper($helper->{'VARS'});  #    my $helpervars = Dumper($helper->{'VARS'});
     &Apache::lonnet::logthis("Dump of helper vars:\n $helpervars");  #    &Apache::lonnet::logthis("Dump of helper vars:\n $helpervars");
 }  #}
   
 sub get_page_breaks  {  sub get_page_breaks  {
     my ($helper) = @_;      my ($helper) = @_;
Line 1040  ENDPART Line 1039  ENDPART
     my %page_breaks  = &get_page_breaks($helper);      my %page_breaks  = &get_page_breaks($helper);
   
     my $format_from_helper = $helper->{'VARS'}->{'FORMAT'};      my $format_from_helper = $helper->{'VARS'}->{'FORMAT'};
     &dump_helper_vars($helper);  
     my ($result,$selectionmade) = ('','');      my ($result,$selectionmade) = ('','');
     my $number_of_columns = 1; #used only for pages to determine the width of the cell      my $number_of_columns = 1; #used only for pages to determine the width of the cell
     my @temporary_array=split /\|/,$format_from_helper;      my @temporary_array=split /\|/,$format_from_helper;
Line 1333  ENDPART Line 1331  ENDPART
     my $courseidinfo = &get_course();      my $courseidinfo = &get_course();
     if (defined($courseidinfo)) { $courseidinfo=' - '.$courseidinfo }      if (defined($courseidinfo)) { $courseidinfo=' - '.$courseidinfo }
     $prevassignment=$assignment;      $prevassignment=$assignment;
     &Apache::lonnet::logthis("2: Number of columns: $numberofcolumns");  
     if ($numberofcolumns eq '1') {      if ($numberofcolumns eq '1') {
  $result .='\newpage \noindent\parbox{\minipagewidth}{\noindent\\lhead{\\textit{\\textbf{'.$name.'}}'.$courseidinfo.' \\hfill \\thepage \\\\ \\textit{'.$assignment.'}}} \vskip 5 mm ';   $result .='\newpage \noindent\parbox{\minipagewidth}{\noindent\\lhead{\\textit{\\textbf{'.$name.'}}'.$courseidinfo.' \\hfill \\thepage \\\\ \\textit{'.$assignment.'}}} \vskip 5 mm ';
     } else {      } else {
Line 1830  sub print_resources { Line 1827  sub print_resources {
     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');
     if ($current_output=~/\\documentclass/) {      if ($current_output=~/\\documentclass/) {
  &Apache::lonnet::logthis("3: Number of columns = $columns_in_format");  
  if ($columns_in_format == 1) {   if ($columns_in_format == 1) {
     $current_output =~ s/\\begin{document}/\\setlength{\\topmargin}{1cm} \\begin{document}\\noindent\\parbox{\\minipagewidth}{\\noindent\\lhead{\\textit{\\textbf{$fullname}}$courseidinfo \\hfill \\thepage \\\\ \\textit{$currentassignment}$namepostfix}}\\vskip 5 mm /;      $current_output =~ s/\\begin{document}/\\setlength{\\topmargin}{1cm} \\begin{document}\\noindent\\parbox{\\minipagewidth}{\\noindent\\lhead{\\textit{\\textbf{$fullname}}$courseidinfo \\hfill \\thepage \\\\ \\textit{$currentassignment}$namepostfix}}\\vskip 5 mm /;
  } else {   } else {
Line 1840  sub print_resources { Line 1836  sub print_resources {
     } else {      } else {
  my $blankpages = '';   my $blankpages = '';
  for (my $j=0;$j<$helper->{'VARS'}->{'EMPTY_PAGES'};$j++) {$blankpages.='\clearpage\strut\clearpage';}   for (my $j=0;$j<$helper->{'VARS'}->{'EMPTY_PAGES'};$j++) {$blankpages.='\clearpage\strut\clearpage';}
  &Apache::lonnet::logthis("4: Number of columns = $columns_in_format");  
  if ($columns_in_format == 1) {   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{\\textit{\\textbf{'.$fullname.'}}'.$courseidinfo.' \\hfill \\thepage \\\\ \\textit{'.$currentassignment.'}'.$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.'\setcounter{page}{1}\noindent\parbox{\minipagewidth}{\noindent\\lhead{\\textit{\\textbf{'.$fullname.'}}'.$courseidinfo.' \\hfill \\thepage \\\\ \\textit{'.$currentassignment.'}'.$namepostfix.'}} \vskip 5 mm '.$current_output;
  } else {   } else {

Removed from v.1.417  
changed lines
  Added in v.1.418


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