--- loncom/interface/lonprintout.pm 2007/04/20 20:13:58 1.498 +++ loncom/interface/lonprintout.pm 2007/04/20 20:33:35 1.499 @@ -2,7 +2,7 @@ # The LearningOnline Network # Printout # -# $Id: lonprintout.pm,v 1.498 2007/04/20 20:13:58 foxr Exp $ +# $Id: lonprintout.pm,v 1.499 2007/04/20 20:33:35 foxr Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1293,6 +1293,7 @@ sub output_data { my ($r,$helper,$rparmhash) = @_; my %parmhash = %$rparmhash; $resources_printed = ''; + my $do_postprocessing = 1; my $js = < var editbrowser; @@ -1489,6 +1490,7 @@ ENDPART # $result = &fetch_raw_resource($currentURL); + $do_postprocessing = 0; # Don't massage the result. } else { $result.=&unsupported($currentURL,$helper->{'VARS'}->{'LATEX_TYPE'}, @@ -1894,15 +1896,20 @@ ENDPART $result .= '\end{document}'; } #-------------------------------------------------------- corrections for the different page formats - $result = &page_format_transformation($papersize,$laystyle,$numberofcolumns,$helper->{'VARS'}->{'PRINT_TYPE'},$result,$helper->{VARS}->{'assignment'},$helper->{'VARS'}->{'TABLE_CONTENTS'},$helper->{'VARS'}->{'TABLE_INDEX'},$selectionmade); - $result = &latex_corrections($number_of_columns,$result,$selectionmade, - $helper->{'VARS'}->{'ANSWER_TYPE'}); - #if ($numberofcolumns == 1) { + + # Only post process if that has not been turned off e.g. by a raw latex resource. + + if ($do_postprocessing) { + $result = &page_format_transformation($papersize,$laystyle,$numberofcolumns,$helper->{'VARS'}->{'PRINT_TYPE'},$result,$helper->{VARS}->{'assignment'},$helper->{'VARS'}->{'TABLE_CONTENTS'},$helper->{'VARS'}->{'TABLE_INDEX'},$selectionmade); + $result = &latex_corrections($number_of_columns,$result,$selectionmade, + $helper->{'VARS'}->{'ANSWER_TYPE'}); + #if ($numberofcolumns == 1) { $result =~ s/\\textwidth\s*=\s*-?\d*\.?\d*\s*(cm|mm|in)/\\textwidth= $helper->{'VARS'}->{'pagesize.width'} $helper->{'VARS'}->{'pagesize.widthunit'} /; $result =~ s/\\textheight\s*=?\s*-?\d*\.?\d*\s*(cm|mm|in)/\\textheight $helper->{'VARS'}->{'pagesize.height'} $helper->{'VARS'}->{'pagesize.heightunit'} /; $result =~ s/\\evensidemargin\s*=\s*-?\d*\.?\d*\s*(cm|mm|in)/\\evensidemargin= $helper->{'VARS'}->{'pagesize.lmargin'} $helper->{'VARS'}->{'pagesize.lmarginunit'} /; $result =~ s/\\oddsidemargin\s*=\s*-?\d*\.?\d*\s*(cm|mm|in)/\\oddsidemargin= $helper->{'VARS'}->{'pagesize.lmargin'} $helper->{'VARS'}->{'pagesize.lmarginunit'} /; - #} + #} + } #-- writing .tex file in prtspool my $temp_file;