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

sakharuk lon-capa-cvs@mail.lon-capa.org
Mon, 16 Aug 2004 17:11:11 -0000


sakharuk		Mon Aug 16 13:11:11 2004 EDT

  Modified files:              
    /loncom/xml	londefdef.pm 
    /loncom/interface	lonprintout.pm 
  Log:
  Bug 3297 (Column headers need less repetition) is fixed. I left all sided headers for 'selected students' printout to avoide situations in which last column of thye student's printout is not marked. 
  
  
Index: loncom/xml/londefdef.pm
diff -u loncom/xml/londefdef.pm:1.231 loncom/xml/londefdef.pm:1.232
--- loncom/xml/londefdef.pm:1.231	Tue Jul 20 11:05:32 2004
+++ loncom/xml/londefdef.pm	Mon Aug 16 13:11:10 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Tags Default Definition Module 
 #
-# $Id: londefdef.pm,v 1.231 2004/07/20 15:05:32 sakharuk Exp $
+# $Id: londefdef.pm,v 1.232 2004/08/16 17:11:10 sakharuk Exp $
 # 
 #
 # Copyright Michigan State University Board of Trustees
@@ -154,7 +154,7 @@
 	    &Apache::lonxml::fontsettings();     
     } elsif ($target eq 'tex') {
 	@Apache::londefdef::table = ();
-	$currentstring .= '\documentclass[letterpaper]{article}';
+	$currentstring .= '\documentclass[letterpaper]{book}';
 	if ($ENV{'form.latex_type'}=~'batchmode') {$currentstring .='\batchmode';} 
 	$currentstring .= '\newcommand{\keephidden}[1]{}'.
                           '\renewcommand{\deg}{$^{\circ}$}'.
@@ -176,10 +176,10 @@
 }
 
 sub end_html {
-    my ($target,$token) = @_;
+    my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
     my $currentstring = '';
     if ($target eq 'web') {
-	$currentstring = &Apache::lonxml::xmlend();
+	$currentstring = &Apache::lonxml::xmlend($target,$parser);
     }
     return $currentstring;
 }
Index: loncom/interface/lonprintout.pm
diff -u loncom/interface/lonprintout.pm:1.324 loncom/interface/lonprintout.pm:1.325
--- loncom/interface/lonprintout.pm:1.324	Fri Aug 13 14:06:14 2004
+++ loncom/interface/lonprintout.pm	Mon Aug 16 13:11:10 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Printout
 #
-# $Id: lonprintout.pm,v 1.324 2004/08/13 18:06:14 sakharuk Exp $
+# $Id: lonprintout.pm,v 1.325 2004/08/16 17:11:10 sakharuk Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -476,17 +476,17 @@
     } elsif($papersize eq '3') {
 	if ($layout eq 'book') {
 	    if ($numberofcolumns == 1) {
-		$textwidth = '7 in';      
+		$textwidth = '6.8 in';      
 		$textheight = '9 in';    
 		$oddoffset = '-0.57 in';
 		$evenoffset = '-0.57 in';
-		$topmargin = '-0.5 in';
+		$topmargin = '1.2 in';
 	    } elsif ($numberofcolumns == 2) {
-		$textwidth = '3.5 in';     
+		$textwidth = '3.1 in';     
 		$textheight = '9 in';    
 		$oddoffset = '-0.57 in';
 		$evenoffset = '-0.57 in';
-		$topmargin = '-0.5 in';
+		$topmargin = '1.2 in';
 	    }
 	} elsif ($layout eq 'album') {
 	    if ($numberofcolumns eq '1') {
@@ -530,8 +530,8 @@
 		$evenoffset = '-60 pt';
 	    }
 	}
-#    } elsif($papersize eq '5') {
 #    } elsif($papersize eq '4') {
+#    } elsif($papersize eq '5') {
 #    } elsif($papersize eq '7') {
 #    } elsif($papersize eq '8') {
     }
@@ -571,12 +571,17 @@
     if (defined($courseidinfo)) { $courseidinfo=' - '.$courseidinfo }
     my $topmargintoinsert = '';
     if ($topmargin ne '0') {$topmargintoinsert='\setlength{\topmargin}{'.$topmargin.'}';}
+    my $fancypagestatement='';
+    if ($numberofcolumns eq '2') {
+	$fancypagestatement="\\fancyhead{}\\fancyhead[LO]{\\textbf{$name} $courseidinfo \\hfill \\thepage \\\\ \\textit{$assignment}}";
+    } else {
+	$fancypagestatement="\\rhead{}\\chead{}\\lhead{\\textbf{$name} $courseidinfo \\hfill \\thepage \\\\ \\textit{$assignment}}";
+    }
     if ($layout eq 'album') {
-	    $text =~ s/\\begin{document}/\\setlength{\\oddsidemargin}{$oddoffset}\\setlength{\\evensidemargin}{$evenoffset}$topmargintoinsert\\setlength{\\textwidth}{$textwidth}\\setlength{\\textheight}{$textheight}\\setlength{\\textfloatsep}{8pt plus 2\.0pt minus 4\.0pt}\\newlength{\\minipagewidth}\\setlength{\\minipagewidth}{\\textwidth\/\$number_of_columns-0\.2cm}\\usepackage{fancyhdr}\\pagestyle{fancy}\\rhead{}\\chead{}\\lhead{\\textbf{$name} $courseidinfo \\hfill \\thepage \\\\ \\textit{$assignment}} \\begin{document}\\voffset=-0\.8 cm\\setcounter{page}{1} /;
+	    $text =~ s/\\begin{document}/\\setlength{\\oddsidemargin}{$oddoffset}\\setlength{\\evensidemargin}{$evenoffset}$topmargintoinsert\\setlength{\\textwidth}{$textwidth}\\setlength{\\textheight}{$textheight}\\setlength{\\textfloatsep}{8pt plus 2\.0pt minus 4\.0pt}\\newlength{\\minipagewidth}\\setlength{\\minipagewidth}{\\textwidth\/\$number_of_columns-0\.2cm}\\usepackage{fancyhdr}\\pagestyle{fancy}$fancypagestatement\\begin{document}\\voffset=-0\.8 cm\\setcounter{page}{1} /;
     } elsif ($layout eq 'book') {
-
 	if ($choice ne 'All class print') { 
-	    $text =~ s/\\begin{document}/\\textheight $textheight\\oddsidemargin = $evenoffset\\evensidemargin = $evenoffset $topmargintoinsert\\textwidth= $textwidth\\newlength{\\minipagewidth}\\setlength{\\minipagewidth}{\\textwidth\/\$number_of_columns-0\.2cm}\\renewcommand{\\ref}{\\keephidden\}\\usepackage{fancyhdr}\\pagestyle{fancy}\\rhead{}\\chead{}\\lhead{\\textbf{$name} $courseidinfo \\hfill \\thepage \\\\ \\textit{$assignment}}\\begin{document}\\voffset=-0\.8 cm\\setcounter{page}{1}/;
+	    $text =~ s/\\begin{document}/\\textheight $textheight\\oddsidemargin = $evenoffset\\evensidemargin = $evenoffset $topmargintoinsert\\textwidth= $textwidth\\newlength{\\minipagewidth}\\setlength{\\minipagewidth}{\\textwidth\/\$number_of_columns-0\.2cm}\\renewcommand{\\ref}{\\keephidden\}\\usepackage{fancyhdr}\\pagestyle{fancy}$fancypagestatement\\begin{document}\\voffset=-0\.8 cm\\setcounter{page}{1}/;
 	} else {
 	    $text =~ s/\\pagestyle{fancy}\\rhead{}\\chead{}\s*\\begin{document}/\\textheight = $textheight\\oddsidemargin = $evenoffset\\evensidemargin = $evenoffset $topmargintoinsert\\textwidth= $textwidth\\newlength{\\minipagewidth}\\setlength{\\minipagewidth}{\\textwidth\/\$number_of_columns-0\.2cm}\\renewcommand{\\ref}{\\keephidden\}\\pagestyle{fancy}\\rhead{}\\chead{}\\begin{document}\\voffset=-0\.8cm\\setcounter{page}{1}  \\vskip 5 mm /;
 	}