--- loncom/interface/lonprintout.pm 2005/02/02 11:13:34 1.355 +++ loncom/interface/lonprintout.pm 2005/02/09 15:56:45 1.359 @@ -1,7 +1,7 @@ # The LearningOnline Network # Printout # -# $Id: lonprintout.pm,v 1.355 2005/02/02 11:13:34 foxr Exp $ +# $Id: lonprintout.pm,v 1.359 2005/02/09 15:56:45 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -698,7 +698,7 @@ sub IndexCreation { sub print_latex_header { my $mode=shift; my $output='\documentclass[letterpaper]{article}'; - if ($mode eq 'batchmode') { + if (($mode eq 'batchmode') || (!$ENV{'request.role.adv'})) { $output.='\batchmode'; } $output.='\newcommand{\keephidden}[1]{}\renewcommand{\deg}{$^{\circ}$}'."\n". @@ -825,8 +825,13 @@ Please stand by while processing your pr ENDPART # Common settings for the %form has: - + # In some cases these settings get overriddent by specific cases, but the + # settings are common enough to make it worthwhile factoring them out + # here. + # my %form; + $form{'grade_target'} = 'tex'; + $form{'textwidth'} = &get_textwidth($helper, $LaTeXwidth); my $format_from_helper = $helper->{'VARS'}->{'FORMAT'}; my ($result,$selectionmade) = ('',''); @@ -871,8 +876,6 @@ ENDPART my $put_result = &Apache::lonnet::put('environment',{'construct.style'=>$helper->{'VARS'}->{'style_file'}},$dom,$user); } if ($helper->{'VARS'}->{'probstatus'} eq 'exam') {$form{'problemtype'}='exam';} - $form{'grade_target'}='tex'; - $form{'textwidth'}=&get_textwidth($helper,$LaTeXwidth); $form{'problem_split'}=$parmhash{'problem_stream_switch'}; $form{'suppress_tries'}=$parmhash{'suppress_tries'}; $form{'latex_type'}=$helper->{'VARS'}->{'LATEX_TYPE'}; @@ -938,8 +941,6 @@ ENDPART if ($urlp=~/\.(problem|exam|quiz|assess|survey|form|library|xml|html|htm|xhtml|xhtm)$/) { my $texversion=''; if ($helper->{'VARS'}->{'ANSWER_TYPE'} ne 'only') { - $form{'grade_target'}='tex'; - $form{'textwidth'}=&get_textwidth($helper,$LaTeXwidth); $form{'problem_split'}=$parmhash{'problem_stream_switch'}; $form{'suppress_tries'}=$parmhash{'suppress_tries'}; $form{'latex_type'}=$helper->{'VARS'}->{'LATEX_TYPE'}; @@ -984,8 +985,6 @@ ENDPART if ($helper->{VARS}->{'construction'} eq '1') {$result=~s/(\\begin{document})/$1 \\fbox\{RANDOM SEED IS $rndseed\} /;} $result .= '\end{document}'; } elsif ($cleanURL=~/\/(smppg|syllabus|aboutme|bulletinboard)$/) { - $form{'grade_target'}='tex'; - $form{'textwidth'}=&get_textwidth($helper,$LaTeXwidth); $form{'latex_type'}=$helper->{'VARS'}->{'LATEX_TYPE'}; if ($currentURL=~/\/syllabus$/) {$currentURL=~s/\/res//;} my $texversion=&Apache::lonnet::ssi($currentURL,%form); @@ -1010,8 +1009,6 @@ ENDPART } elsif ($helper->{'VARS'}->{'PRINT_TYPE'} eq 'select_sequences') { $selectionmade = 7; } - $form{'grade_target'}='tex'; - $form{'textwidth'}=&get_textwidth($helper,$LaTeXwidth); $form{'problem_split'}=$parmhash{'problem_stream_switch'}; $form{'suppress_tries'}=$parmhash{'suppress_tries'}; $form{'latex_type'}=$helper->{'VARS'}->{'LATEX_TYPE'}; @@ -1096,8 +1093,6 @@ ENDPART $result .= $texversion; $flag_latex_header_remove = 'YES'; } elsif ($urlp=~/\/(smppg|syllabus|aboutme|bulletinboard)$/) { - $form{'grade_target'}='tex'; - $form{'textwidth'}=&get_textwidth($helper,$LaTeXwidth); $form{'latex_type'}=$helper->{'VARS'}->{'LATEX_TYPE'}; if ($urlp=~/\/syllabus$/) {$urlp=~s/\/res//;} my $texversion=&Apache::lonnet::ssi($urlp,%form); @@ -1253,8 +1248,6 @@ ENDPART $urlp=~s|//|/|; if ($urlp=~/\//) { $form{'problem_split'}=$parmhash{'problem_stream_switch'}; - $form{'grade_target'}='tex'; - $form{'textwidth'}=&get_textwidth($helper,$LaTeXwidth); $form{'rndseed'}=$rndseed; if ($urlp =~ m|/home/([^/]+)/public_html|) { $urlp =~ s|/home/([^/]*)/public_html|/~$1|;