--- loncom/interface/lonprintout.pm 2002/10/17 14:49:37 1.80 +++ loncom/interface/lonprintout.pm 2002/10/23 17:38:03 1.82 @@ -1,7 +1,7 @@ # The LearningOnline Network # Printout # -# $Id: lonprintout.pm,v 1.80 2002/10/17 14:49:37 sakharuk Exp $ +# $Id: lonprintout.pm,v 1.82 2002/10/23 17:38:03 sakharuk Exp $ # # Copyright Michigan State University Board of Trustees # @@ -203,7 +203,7 @@ sub problem_choice_menu {

ENDMENUOUT1 - my $i; + my $i=0; foreach my $file (@list_of_files) { $r->print('
'. $file); @@ -347,6 +347,16 @@ ENDPART my $numberofcolumns = $ENV{'form.numberofcolumns'}; my $papersize = $ENV{'form.papersize'}; my $laystyle = 'book'; + if ($choice eq 'Subdirectory print') { + $layout = 'CAPA'; + $papersize = 'Letter [8 1/2x11 in]'; + $numberofcolumns = 2; + } + if (($choice eq 'Standard LaTeX output for current document') && ($ENV{'request.role'}=~m/^au\./ or $ENV{'request.role'}=~m/^ca\./)) { + $layout = 'CAPA'; + $papersize = 'Letter [8 1/2x11 in]'; + $numberofcolumns = 1; + } my $result = ''; my $number_of_columns = 1; #used only for pages to determine the width of the cell my $selectionmade = ''; @@ -1014,7 +1024,7 @@ sub character_chart { $oddoffset = '-0.57 in'; $evenoffset = '-0.57 in'; } elsif ($numberofcolumns == 2) { - $textwidth = '9 cm'; + $textwidth = '93 mm'; $textheight = '25.9 cm'; $oddoffset = '-0.57 in'; $evenoffset = '-0.57 in'; @@ -1043,7 +1053,7 @@ sub character_chart { $oddoffset = '-0.57 in'; $evenoffset = '-0.57 in'; } elsif ($numberofcolumns == 2) { - $textwidth = '9 cm'; + $textwidth = '96 mm'; $textheight = '2 cm'; $oddoffset = '-0.57 in'; $evenoffset = '-0.57 in'; @@ -1078,7 +1088,7 @@ sub page_format_transformation { $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{$ENV{'environment.firstname'} $ENV{'environment.lastname'}}} \\hfill $courseidinfo} \\vskip 5 mm /; } elsif ($layout eq 'CAPA') { if ($choice ne 'All class print') { - $text =~ s/\\begin{document}/\\textheight 25\.9cm\\oddsidemargin = -0\.57in\\evensidemargin = -0\.57in\\textwidth= 9cm\\newlength{\\minipagewidth}\\setlength{\\minipagewidth}{\\textwidth\/\$number_of_columns-0\.2cm}\\renewcommand{\\ref}{\\keephidden\}\\begin{document}\\voffset=-1\.8cm\\setcounter{page}{1}\\noindent\\parbox{\\minipagewidth}{\\noindent\\fbox{\\textbf{$ENV{'environment.firstname'} $ENV{'environment.lastname'}}} \\hfill $courseidinfo} \\vskip 5 mm /; + $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}\\noindent\\parbox{\\minipagewidth}{\\noindent\\fbox{\\textbf{$ENV{'environment.firstname'} $ENV{'environment.lastname'}}} \\hfill $courseidinfo} \\vskip 5 mm /; } else { $text =~ s/\\begin{document}/\\setlength{\\textheight}{$textheight}\\setlength{\\oddsidemargin}{$oddoffset}\\setlength{\\evensidemargin}{$evenoffset}\\setlength{\\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 /; } @@ -1127,7 +1137,7 @@ sub latex_corrections { $result =~ s/\\includegraphics{/\\includegraphics\[width=\\minipagewidth\]{/g; $result =~ s/\$number_of_columns/$number_of_columns/g; - $result =~ s/(\\end{document})/\\newline\\noindent\\makebox\[\\textwidth\/$number_of_columns\]\[b\]{\\hrulefill}\\newline\\noindent\\tiny \\makebox\[1.5cm\]\[b\]{\\hfill}LON-CAPA\\copyright MSU $1/; + $result =~ s/(\\end{document})/\\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 $1/; $result =~ s/(\\end{longtable}\s*)(\\newline\\noindent\\makebox\[\\textwidth\/$number_of_columns\]\[b\]{\\hrulefill})/$2$1/g; $result =~ s/(\\end{longtable}\s*)\\newline/$1/g; #-- LaTeX corrections