--- loncom/interface/lonprintout.pm 2004/11/13 09:30:26 1.337 +++ loncom/interface/lonprintout.pm 2004/11/19 21:48:41 1.339 @@ -1,7 +1,7 @@ # The LearningOnline Network # Printout # -# $Id: lonprintout.pm,v 1.337 2004/11/13 09:30:26 albertel Exp $ +# $Id: lonprintout.pm,v 1.339 2004/11/19 21:48:41 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -374,11 +374,11 @@ sub character_chart { my %page_formats= ('letter' => { 'book' => { - '1' => [ '7.1 in','10.2 in', '-0.57 in','-0.57 in','0 in'], - '2' => ['3.66 in','10.2 in', '-0.57 in','-0.57 in','0 in'] + '1' => [ '7.1 in','10.2 in', '-0.57 in','-0.57 in','1 cm'], + '2' => ['3.66 in','10.2 in', '-0.57 in','-0.57 in','1 cm'] }, 'album' => { - '1' => [ '8.8 in', '6.8 in','-40 pt in', '-60 pt','0 in'], + '1' => [ '8.8 in', '6.8 in','-40 pt in', '-60 pt','1 cm'], '2' => [ '4.4 in', '6.8 in','-0.5 in', '-1.5 in','3.5 in'] }, }, @@ -688,11 +688,11 @@ sub path_to_problem { sub recalcto_mm { my $textwidth=shift; my $LaTeXwidth; - if ($textwidth=~/(\d+\.?\d*)\s*cm/) { + if ($textwidth=~/(-?\d+\.?\d*)\s*cm/) { $LaTeXwidth = $1*10; - } elsif ($textwidth=~/(\d+\.?\d*)\s*mm/) { + } elsif ($textwidth=~/(-?\d+\.?\d*)\s*mm/) { $LaTeXwidth = $1; - } elsif ($textwidth=~/(\d+\.?\d*)\s*in/) { + } elsif ($textwidth=~/(-?\d+\.?\d*)\s*in/) { $LaTeXwidth = $1*25.4; } $LaTeXwidth.=' mm'; @@ -1218,10 +1218,10 @@ ENDPART for (my $i=1;$i<=$#print_array;$i++) {$print_array[$i] = &latex_corrections($number_of_columns,$print_array[$i],$selectionmade);} #changes page's parameters for the one column output 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'} /; + $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;