--- loncom/interface/lonprintout.pm 2002/06/21 19:52:13 1.33 +++ loncom/interface/lonprintout.pm 2002/06/27 18:47:59 1.34 @@ -1,7 +1,7 @@ # The LearningOnline Network # Printout # -# $Id: lonprintout.pm,v 1.33 2002/06/21 19:52:13 sakharuk Exp $ +# $Id: lonprintout.pm,v 1.34 2002/06/27 18:47:59 sakharuk Exp $ # # Copyright Michigan State University Board of Trustees # @@ -46,7 +46,7 @@ use Apache::lonnet; use Apache::inputtags; use Apache::edit; use Apache::File(); - +use POSIX qw(strftime); sub headerform { @@ -112,6 +112,7 @@ ENDPART my $layout = $ENV{'form.layout'}; my $laystyle = 'book'; my $result = ''; + my $number_of_columns = 1; if ($choice eq 'Standard LaTeX output for current document') { my %moreenv; @@ -122,7 +123,7 @@ ENDPART &Apache::lonnet::delenv('form.grade_target'); $result .= $texversion; $result = &additional_cleanup($result); - if ($ENV{'form.url'}=~m/\.page\s*$/) {$result = &page_cleanup($result);} + if ($ENV{'form.url'}=~m/\.page\s*$/) {($result,$number_of_columns) = &page_cleanup($result);} } elsif ($choice eq 'Standard LaTeX output for the primary sequence' or $choice eq 'Standard LaTeX output for whole primary sequence') { #-- where is the primary sequence containing file? my %moreenv; @@ -239,10 +240,13 @@ ENDPART $_ = $courseidinfo; m/.*\/(.*)/; $courseidinfo = $ENV{'course.physnet_'.$1.'.description'}; - $result =~ s/\\documentclass\[letterpaper\]{article}/\\documentclass\[twocolumn\]{article}/; - $result =~ s/\\begin{document}/\\textheight 25\.9cm\\oddsidemargin = -0\.57in\\evensidemargin = -0\.57in\\textwidth= 7\.7in\\newlength{\\minipagewidth}\\setlength{\\minipagewidth}{\\textwidth\/2-0\.2in}\\renewcommand{\\ref}{\\keephidden\}\\begin{document}\\voffset=-1\.8cm\\setcounter{page}{1}\\noindent\\fbox{\\textbf{$ENV{'environment.firstname'} $ENV{'environment.lastname'}}}\\hskip 1\.4in $courseidinfo \\vskip 5 mm /; +# $result =~ s/\\documentclass\[letterpaper\]{article}/\\documentclass\[twocolumn\]{article}/; + $result =~ s/\\documentclass\[letterpaper\]{article}/\\documentclass{article}/; + $result =~ 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}\\parbox{\\minipagewidth}{\\noindent\\fbox{\\textbf{$ENV{'environment.firstname'} $ENV{'environment.lastname'}}}\\hskip 1\.4in $courseidinfo} \\vskip 5 mm /; $result =~ s/\\includegraphics{/\\includegraphics\[width=9\.0 cm\]{/g; $result =~ s/(\\end{document})/\\newline\\noindent\\makebox\[9.0cm\]\[b\]{\\hrulefill}\\newline\\noindent\\tiny Dept\. of Physics and Astronomy, MSU\\makebox\[1.5cm\]\[b\]{\\hfill}LON-CAPA\\copyright MSU GNU\/GPL $1/; + $result =~ s/(\\end{longtable}\s*)(\\newline\\noindent\\makebox\[9\.0cm\]\[b\]{\\hrulefill})/$2$1/g; + $result =~ s/(\\end{longtable}\s*)\\newline/$1/g; } #-- LaTeX corrections my $first_comment = index($result,'