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

sakharuk lon-capa-cvs@mail.lon-capa.org
Tue, 04 Feb 2003 20:59:26 -0000


sakharuk		Tue Feb  4 15:59:26 2003 EDT

  Modified files:              
    /loncom/interface	lonprintout.pm 
  Log:
   Bug 967 is fixed (Tittle line on printing does not Wrap and is longer than the column width
  when printing in 2 columns.). I've added standard LaTeX package fancyhdr which allows to print headers and footers on multiple lines. Need some time to figure out what limitations I still have (1. Do I have to make any special cleanup of text in headers; 2. How to put students names in the header in the case of printing assignments for group of students.)
  
  
Index: loncom/interface/lonprintout.pm
diff -u loncom/interface/lonprintout.pm:1.109 loncom/interface/lonprintout.pm:1.110
--- loncom/interface/lonprintout.pm:1.109	Thu Jan 30 11:57:01 2003
+++ loncom/interface/lonprintout.pm	Tue Feb  4 15:59:26 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Printout
 #
-# $Id: lonprintout.pm,v 1.109 2003/01/30 16:57:01 sakharuk Exp $
+# $Id: lonprintout.pm,v 1.110 2003/02/04 20:59:26 sakharuk Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -617,7 +617,7 @@
 	    }
 	    if ($current_output=~/\\documentclass/) {
 		my $courseidinfo = $ENV{'course.'.$ENV{'request.course.id'}.'.description'};
-		$current_output =~ s/\\begin{document}/\\setlength{\\topmargin}{1cm}\\setlength{\\headheight}{1cm}\\setlength{\\headsep}{0.5cm}\\pagestyle{myheadings}\\markboth{}{{$courseidinfo  - $assignment}}\\begin{document}\\noindent\\textit{\\textbf{$fullname}}\\vskip 3 mm /;
+		$current_output =~ s/\\begin{document}/\\setlength{\\topmargin}{1cm}\\usepackage{fancyhdr}\\pagestyle{fancy}\\rhead{}\\chead{}\\lhead{$courseidinfo \\hfill \\thepage \\\\ \\textit{$assignment}}  \\begin{document}\\noindent\\textit{\\textbf{$fullname}}\\vskip 3 mm /;
 	    } else {
 		my $blanspages = '';
 		for (my $j=0;$j<$ENV{'form.addedpages'};$j++) {$blanspages.='\clearpage\strut\clearpage';}
@@ -1294,7 +1294,7 @@
 	    $text =~ s/\\begin{document}/\\setlength{\\oddsidemargin}{$oddoffset}\\setlength{\\evensidemargin}{$evenoffset}\\setlength{\\topmargin}{200pt}\\setlength{\\textwidth}{$textwidth}\\setlength{\\textheight}{$textheight}\\setlength{\\parindent}{20pt}\\setlength{\\marginparwidth}{90pt}\\setlength{\\textfloatsep}{8pt plus 2\.0pt minus 4\.0pt}\\newlength{\\minipagewidth}\\setlength{\\minipagewidth}{\\textwidth\/\$number_of_columns-0\.2cm} \\begin{document}\\setcounter{page}{1}\\noindent\\parbox{\\minipagewidth}{\\noindent\\fbox{\\textbf{$firstname $lastname}} \\hfill  $courseidinfo} \\vskip 5 mm /;
     } elsif ($layout eq 'CAPA') {
 	if ($choice ne 'All class print') { 
-		$text =~ s/\\begin{document}/\\textheight $textheight\\oddsidemargin = $evenoffset\\evensidemargin = $evenoffset\\textwidth= $textwidth\\newlength{\\minipagewidth}\\setlength{\\minipagewidth}{\\textwidth\/\$number_of_columns-0\.2cm}\\renewcommand{\\ref}{\\keephidden\}\\setlength{\\topmargin}{1cm}\\setlength{\\headheight}{1cm}\\setlength{\\headsep}{0.5cm}\\markboth{}{\\textbf{$firstname $lastname} $courseidinfo - $assignment}\\pagestyle{myheadings}\\begin{document}\\voffset=-1\.8cm\\setcounter{page}{1}/;
+		$text =~ s/\\begin{document}/\\textheight $textheight\\oddsidemargin = $evenoffset\\evensidemargin = $evenoffset\\textwidth= $textwidth\\newlength{\\minipagewidth}\\setlength{\\minipagewidth}{\\textwidth\/\$number_of_columns-0\.2cm}\\renewcommand{\\ref}{\\keephidden\}\\usepackage{fancyhdr}\\pagestyle{fancy}\\rhead{}\\chead{}\\lhead{\\textbf{$firstname $lastname} - $courseidinfo \\hfill \\thepage \\\\ \\textit{$assignment}}\\begin{document}\\voffset=-0\.8 cm\\setcounter{page}{1}/;
 	} else {
 		$text =~ s/\\begin{document}/\\textheight $textheight\\oddsidemargin = $evenoffset\\evensidemargin = $evenoffset\\textwidth= $textwidth\\newlength{\\minipagewidth}\\setlength{\\minipagewidth}{\\textwidth\/\$number_of_columns-0\.2cm}\\renewcommand{\\ref}{\\keephidden\}\\begin{document}\\voffset=-1\.8cm\\setcounter{page}{1}  \\vskip 5 mm /;
 	}