--- loncom/interface/lonprintout.pm 2002/10/07 17:58:47 1.76
+++ loncom/interface/lonprintout.pm 2002/10/17 14:49:37 1.80
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Printout
#
-# $Id: lonprintout.pm,v 1.76 2002/10/07 17:58:47 sakharuk Exp $
+# $Id: lonprintout.pm,v 1.80 2002/10/17 14:49:37 sakharuk Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -225,7 +225,7 @@ sub additional_class_menu {
-
Mark students which assignments you want to print
+Select student(s) whose assignment you want to print
ENDMENUOUT1
my %courselist=&Apache::lonnet::dump(
'classlist',
@@ -370,7 +370,7 @@ ENDPART
$moreenv{'form.textwidth'}=$LaTeXwidth;
&Apache::lonnet::appenv(%moreenv);
my $texversion=&Apache::lonnet::ssi($ENV{'form.url'});
- &Apache::lonnet::delenv('form.grade_target','form.textwidth');
+ &Apache::lonnet::delenv('form.grade_target','form.textwidth','form.counter');
$result .= $texversion;
if ($ENV{'form.url'}=~m/\.page\s*$/) {
($result,$number_of_columns) = &page_cleanup($result);
@@ -429,7 +429,8 @@ ENDPART
$result .= $texversion;
$flag_latex_header_remove = 'YES';
}
- }
+ }
+ &Apache::lonnet::delenv('form.counter');
if ($flag_page_in_sequence eq 'YES') {$result =~ s/\\usepackage{calc}/\\usepackage{calc}\\usepackage{longtable}/;}
$result .= '\end{document}';
} elsif ($choice eq 'Standard LaTeX output for the top level sequence') {
@@ -474,7 +475,10 @@ ENDPART
my $primary_sequence = '/res/'.$sequence[0];
my @master_seq = &coming_from_hash($primary_sequence,$sequence[0]);
#loop over students
- my $flag_latex_header_remove = 'NO';
+ my $flag_latex_header_remove = 'NO';
+ my %moreenv;
+ $moreenv{'form.textwidth'}=$LaTeXwidth;
+ &Apache::lonnet::appenv(%moreenv);
foreach my $person (@students) {
my $current_output = '';
my ($usersection,$username,$userdomain) = split /:/,$person;
@@ -503,8 +507,10 @@ ENDPART
$current_output = '\\vskip 3mm\noindent\parbox{\minipagewidth}{\noindent\fbox{\textbf{'.$fullname.'}}\hskip 1.4in } \vskip 5 mm '.$current_output;
}
$result .= $current_output;
+ &Apache::lonnet::delenv('form.counter');
}
- $result .= '\end{document}';
+ $result .= '\end{document}';
+ &Apache::lonnet::delenv('form.textwidth');
} elsif ($choice eq 'Subdirectory print') {
#prints selected problems from the subdirectory
$selectionmade = 6;
@@ -1074,7 +1080,7 @@ sub page_format_transformation {
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 /;
} else {
- $text =~ s/\\begin{document}/\\setlength{\\textheight}{$textheight}\\setlength{\\oddsidemargin}{$oddoffset}\\setlength{\\evensidemargin}{$evenoffset}\\setlength{\\textheight}{$textheight}\\newlength{\\minipagewidth}\\setlength{\\minipagewidth}{\\textwidth\/\$number_of_columns-0\.2cm}\\renewcommand{\\ref}{\\keephidden\}\\begin{document}\\voffset=-1\.8cm\\setcounter{page}{1} \\vskip 5 mm /;
+ $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 /;
}
}
return $text;
@@ -1119,9 +1125,9 @@ sub latex_corrections {
my ($number_of_columns,$result) = @_;
- $result =~ s/\\includegraphics{/\\includegraphics\[\\minipagewidth\]{/g;
+ $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 Michigan State University Board of Trustees $1/;
+ $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{longtable}\s*)(\\newline\\noindent\\makebox\[\\textwidth\/$number_of_columns\]\[b\]{\\hrulefill})/$2$1/g;
$result =~ s/(\\end{longtable}\s*)\\newline/$1/g;
#-- LaTeX corrections