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

sakharuk lon-capa-cvs@mail.lon-capa.org
Fri, 13 Aug 2004 17:14:48 -0000


sakharuk		Fri Aug 13 13:14:48 2004 EDT

  Modified files:              
    /loncom/interface	lonprintout.pm printout.pl 
  Log:
  "lender/tabloid" is supported for two column output in 'book' layout.
  
  
Index: loncom/interface/lonprintout.pm
diff -u loncom/interface/lonprintout.pm:1.321 loncom/interface/lonprintout.pm:1.322
--- loncom/interface/lonprintout.pm:1.321	Thu Aug 12 13:27:13 2004
+++ loncom/interface/lonprintout.pm	Fri Aug 13 13:14:48 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Printout
 #
-# $Id: lonprintout.pm,v 1.321 2004/08/12 17:27:13 sakharuk Exp $
+# $Id: lonprintout.pm,v 1.322 2004/08/13 17:14:48 sakharuk Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -444,7 +444,35 @@
 #		$topmargin = '3.5 in';
 	    }
 	}
-#    } elsif($papersize eq '2') {
+    } elsif($papersize eq '2') {
+	if ($layout eq 'book') {
+	    if ($numberofcolumns == 1) {
+		$textwidth = '7.1 in';      
+		$textheight = '15 in';    
+		$oddoffset = '-0.57 in';
+		$evenoffset = '-0.57 in';
+		$topmargin = '-0.5 in';
+	    } elsif ($numberofcolumns == 2) {
+		$textwidth = '4.9 in';     
+		$textheight = '16 in';    
+		$oddoffset = '-0.57 in';
+		$evenoffset = '-0.57 in';
+		$topmargin = '-0.5 in';
+	    }
+	} elsif ($layout eq 'album') {
+	    if ($numberofcolumns eq '1') {
+#		$textwidth = '8.8 in';
+#		$textheight = '6.8 in';
+#		$oddoffset = '-40 pt';
+#		$evenoffset = '-60 pt';
+	    } elsif ($numberofcolumns == 2) {
+#		$textwidth = '4.4 in';
+#		$textheight = '6.8 in';
+#		$oddoffset = '-0.5 in';
+#		$evenoffset = '-1.5 in';
+#		$topmargin = '3.5 in';
+	    }
+	}
 #    } elsif($papersize eq '3'/) {
     } elsif($papersize eq '6') {
 	if ($layout eq 'book') {
@@ -1332,9 +1360,7 @@
     my $current_output = ''; 
     my ($username,$userdomain,$usersection) = split /:/,$person;
     my $fullname = &get_name($username,$userdomain);
-    my $namepostfix;
     if ($person =~ 'anon') {
-	$namepostfix="\\\\Name: ";
 	$fullname = "CODE - ".$moreenv->{'CODE'};
     }
     #goes through all resources, checks if they are available for 
@@ -1408,11 +1434,11 @@
     if ($usersection ne '') {$courseidinfo.=' - Sec. '.$usersection}
     my $currentassignment=&Apache::lonxml::latex_special_symbols($helper->{VARS}->{'assignment'},'header');
     if ($current_output=~/\\documentclass/) {
-	$current_output =~ s/\\begin{document}/\\setlength{\\topmargin}{1cm} \\begin{document}\\noindent\\lhead{\\textit{\\textbf{$fullname}}$courseidinfo \\hfill \\thepage \\\\ \\textit{$currentassignment}$namepostfix}\\vskip 3 mm /;
+	$current_output =~ s/\\begin{document}/\\setlength{\\topmargin}{1cm} \\begin{document}\\noindent\\lhead{\\textit{\\textbf{$fullname}}$courseidinfo \\hfill \\thepage \\\\ \\textit{$currentassignment}}\\vskip 3 mm /;
     } else {
 	my $blankpages = '';
 	for (my $j=0;$j<$helper->{'VARS'}->{'EMPTY_PAGES'};$j++) {$blankpages.='\clearpage\strut\clearpage';}
-	$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.'}}} \vskip -5 mm '.$current_output;
     }
     return ($current_output,$fullname);
 
Index: loncom/interface/printout.pl
diff -u loncom/interface/printout.pl:1.65 loncom/interface/printout.pl:1.66
--- loncom/interface/printout.pl:1.65	Fri Aug 13 13:06:00 2004
+++ loncom/interface/printout.pl	Fri Aug 13 13:14:48 2004
@@ -1,7 +1,7 @@
 #!/usr/bin/perl
 # CGI-script to run LaTeX, dvips, ps2ps, ps2pdf etc.
 #
-# $Id: printout.pl,v 1.65 2004/08/13 17:06:00 sakharuk Exp $
+# $Id: printout.pl,v 1.66 2004/08/13 17:14:48 sakharuk Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -384,7 +384,7 @@
 		      if ($i==0) {
 			  if ($paper eq '6') {print FFHS '<< /PageSize [595.2 842] >> setpagedevice'."\n";}
 			  if ($paper eq '1') {print FFHS '<< /PageSize [612 1008] >> setpagedevice'."\n";}
-			  if ($paper eq '2') {print FFHS '<< /PageSize [794.97 1228.59] >> setpagedevice'."\n";}
+			  if ($paper eq '2') {print FFHS '<< /PageSize [792 1224] >> setpagedevice'."\n";}
 			  if ($paper eq '3') {print FFHS '<< /PageSize [542 722.7] >> setpagedevice'."\n";}
 			  if ($paper eq '4') {print FFHS '<< /PageSize [1195.02 1690.09] >> setpagedevice'."\n";}
 			  if ($paper eq '5') {print FFHS '<< /PageSize [842 1195.02] >> setpagedevice'."\n";}