--- loncom/interface/lonprintout.pm 2003/10/15 18:01:10 1.255 +++ loncom/interface/lonprintout.pm 2003/10/24 13:33:08 1.258 @@ -1,7 +1,7 @@ # The LearningOnline Network # Printout # -# $Id: lonprintout.pm,v 1.255 2003/10/15 18:01:10 www Exp $ +# $Id: lonprintout.pm,v 1.258 2003/10/24 13:33:08 sakharuk Exp $ # # Copyright Michigan State University Board of Trustees # @@ -815,6 +815,13 @@ ENDPART } if ($helper->{VARS}->{'construction'} eq '1') {$result=~s/(\\begin{document})/$1 \\fbox\{RANDOM SEED IS $rndseed\} /;} $result .= '\end{document}'; + } elsif ($currentURL=~/\/smppg$/) { + my %form; + $form{'grade_target'}='tex'; + $form{'textwidth'}=$LaTeXwidth; + $form{'latex_type'}=$helper->{'VARS'}->{'LATEX_TYPE'}; + my $texversion=&Apache::lonnet::ssi($currentURL,%form); + $result .= $texversion; } else { $result.='\documentclass[letterpaper]{article}\usepackage{calc}\begin{document}Printout of this type of document is currently not supported: '; if ($currentURL=~/\/(aboutme|syllabus|bulletinboard|smppg)$/) { @@ -1063,22 +1070,27 @@ ENDPART $result =~ s/\\evensidemargin = -0\.57in/\\evensidemargin= $helper->{'VARS'}->{'pagesize.lmargin'} $helper->{'VARS'}->{'pagesize.lmarginunit'} /; $result =~ s/\\oddsidemargin = -0\.57in/\\oddsidemargin= $helper->{'VARS'}->{'pagesize.lmargin'} $helper->{'VARS'}->{'pagesize.lmarginunit'} /; } - if ($helper->{'VARS'}->{'TABLE_CONTENTS'} eq 'yes') {$selectionmade*=10;} - if ($helper->{'VARS'}->{'TABLE_INDEX'} eq 'yes') { - if ($selectionmade<10) {$selectionmade*=100;} else {$selectionmade*=10;} - } - if ($ENV{'request.role.adv'}) {$selectionmade*=10000;} #-- writing .tex file in prtspool my $temp_file; my $filename = "/home/httpd/prtspool/$ENV{'user.name'}_$ENV{'user.domain'}_printout_".time."_".rand(10000000).".tex"; unless ($temp_file = Apache::File->new('>'.$filename)) { $r->log_error("Couldn't open $filename for output $!"); return SERVER_ERROR; - } + } + + my $identifier = time.'_'.int(rand(1000)); + &Apache::lonnet::appenv('cgi.'.$identifier.'.file' => $filename, + 'cgi.'.$identifier.'.layout' => $laystyle, + 'cgi.'.$identifier.'.numcol' => $numberofcolumns, + 'cgi.'.$identifier.'.selection' => $selectionmade, + 'cgi.'.$identifier.'tableofcontents' => $helper->{'VARS'}->{'TABLE_CONTENTS'}, + 'cgi.'.$identifier.'tableofindex' => $helper->{'VARS'}->{'TABLE_INDEX'}, + 'cgi.'.$identifier.'role' => $ENV{'request.role.adv'}); + print $temp_file $result; $r->print(< + FINALEND