--- loncom/interface/lonprintout.pm 2006/06/06 11:02:38 1.440 +++ loncom/interface/lonprintout.pm 2006/06/26 22:18:48 1.447 @@ -1,7 +1,7 @@ # The LearningOnline Network # Printout # -# $Id: lonprintout.pm,v 1.440 2006/06/06 11:02:38 foxr Exp $ +# $Id: lonprintout.pm,v 1.447 2006/06/26 22:18:48 foxr Exp $ # # Copyright Michigan State University Board of Trustees # @@ -702,7 +702,8 @@ sub get_name { if (!defined($udom)) { $udom=$env{'user.domain'}; } my $plainname=&Apache::loncommon::plainname($uname,$udom); if ($plainname=~/^\s*$/) { $plainname=$uname.'@'.$udom; } - $plainname=&Apache::lonxml::latex_special_symbols($plainname,'header'); + # $plainname=&Apache::lonxml::latex_special_symbols($plainname,'header'); + $plainname = &escape_LaTeX($plainname); return $plainname; } @@ -1672,14 +1673,12 @@ ENDPART $selectionmade, $helper->{'VARS'}->{'ANSWER_TYPE'}); } - &Apache::lonnet::logthis("Resetting page e.g. height -> $helper->{'VARS'}->{'pagesize.height'}"); - &Apache::lonnet::logthis("Before: $result \n--------------------------\n"); + $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'} /; - &Apache::lonnet::logthis("After: $result \n----------------------------------\n"); #-- writing .tex file in prtspool my $temp_file; @@ -1804,6 +1803,9 @@ sub print_resources { $namepostfix="\\\\Name: "; $fullname = "CODE - ".$moreenv->{'CODE'}; } + # Fullname may have special latex characters that need \ prefixing: + # + my $i = 0; #goes through all resources, checks if they are available for #current student, and produces output @@ -1813,17 +1815,15 @@ sub print_resources { my @format_array = split(/\|/,$helper->{'VARS'}->{'FORMAT'}); my $columns_in_format = $format_array[1]; # - # Bracket each student with a + # end each student with a # Special that allows the post processor to even out the page # counts later. Nasty problem this... it would be really # nice to put the special in as a postscript comment - # e.g. \special{ps:\%STARTOFSTUDENTSTAMP} unfortunately, + # e.g. \special{ps:\ENDOFSTUDENTSTAMP} unfortunately, # The special gets passed the \ and dvips puts it in the output file - # so we'll just put STARTOFSTUDENTSTAMP in the postscript and rely - # on printout.pl to strip it...simlarly with ENDOFSTUDENTSTAMP. - # These will go on a line by themselves. + # so we will just rely on prntout.pl to strip ENDOFSTUDENTSTAMP from the + # postscript. Each ENDOFSTUDENTSTAMP will go on a line by itself. # - $current_output .= "\\special{ps:\nSTARTOFSTUDENTSTAMP\n}"; foreach my $curresline (@{$master_seq}) { if (defined $page_breaks{$curresline}) { @@ -1922,7 +1922,7 @@ sub print_resources { # # Close the student bracketing. # - $current_output .= "\\special{ps:\nENDOFSTUDENTSTAMP\n}"; + $current_output .= "\n\\special{ps:ENDOFSTUDENTSTAMP}\n"; return ($current_output,$fullname, $printed); }