--- loncom/interface/lonprintout.pm 2002/09/23 21:09:58 1.74 +++ loncom/interface/lonprintout.pm 2002/09/24 13:52:24 1.75 @@ -1,7 +1,7 @@ # The LearningOnline Network # Printout # -# $Id: lonprintout.pm,v 1.74 2002/09/23 21:09:58 sakharuk Exp $ +# $Id: lonprintout.pm,v 1.75 2002/09/24 13:52:24 sakharuk Exp $ # # Copyright Michigan State University Board of Trustees # @@ -460,7 +460,7 @@ ENDPART my $symbolic = &Apache::lonnet::symbread($ENV{'form.url'}); my @sequence = split('___',$symbolic); my $primary_sequence = '/res/'.$sequence[0]; - my @master_seq = &coming_from_hash($primary_sequence,$sequence[0); + my @master_seq = &coming_from_hash($primary_sequence,$sequence[0]); #loop over students my $flag_latex_header_remove = 'NO'; foreach my $person (@students) { @@ -527,11 +527,33 @@ ENDPART $result .= '\end{document}'; } #-------------------------------------------------------- corrections for the different page formats -# my ($textwidth,$textheight,$offset) = (0,0,0); -# if ($papersize=~/Letter/) { -# $textwidth = ; -# $textheight = ; -# $offset = ; + my ($textwidth,$textheight,$oddoffset,$evenoffset) = (0,0,0,0); + if ($papersize=~/Letter/) { + if ($layout eq 'CAPA') { + if ($numberofcolumns == 1) { + $textwidth = '18 cm'; + $textheight = '25.9 cm'; + $oddoffset = '-0.57 in'; + $evenoffset = '-0.57 in'; + } elsif ($numberofcolumns == 2) { + $textwidth = '9 cm'; + $textheight = '25.9 cm'; + $oddoffset = '-0.57 in'; + $evenoffset = '-0.57 in'; + } + } elsif ($layout eq 'CBI') { + if ($numberofcolumns == 1) { + $textwidth = '8.8 in'; + $textheight = '6.8 in'; + $oddoffset = '-40 pt'; + $evenoffset = '-60 pt'; + } elsif ($numberofcolumns == 2) { + $textwidth = '4.4 in'; + $textheight = '6.8 in'; + $oddoffset = '-40 pt'; + $evenoffset = '-60 pt'; + } + } # } elsif($papersize=~/Legal/) { # $textwidth = ; # $textheight = ; @@ -574,7 +596,7 @@ ENDPART # # # -# } + } if ($layout eq 'CBI' and $numberofcolumns eq '1') { $result =~ s/\\begin{document}/\\setlength{\\oddsidemargin}{-40pt}\\setlength{\\evensidemargin}{-60pt}\\setlength{\\topmargin}{200pt}\\setlength{\\textwidth}{4\.4in}\\setlength{\\textheight}{6\.8in}\\setlength{\\parindent}{20pt}\\setlength{\\marginparwidth}{90pt}\\setlength{\\textfloatsep}{8pt plus 2\.0pt minus 4\.0pt} \\begin{document}/; @@ -624,7 +646,6 @@ ENDPART $result =~ s/\\\\\s*\\noindent\s*(\\\\)+/\\\\\\noindent /g; $result =~ s/{\\par }\s*\\\\/\\\\/gm; $result =~ s/\\\\\s+\[/ \[/g; - $result =~ s/θ/\$\\theta\$/g; #converts theta from html into tex $result =~ s/\b__+\b/\\makebox\[1 cm\]\[b\]{\\hrulefill}/g; #conversion of html characters to LaTeX equivalents if ($result =~ m/&(\w+|#\d+);/) { @@ -1071,7 +1092,8 @@ sub character_chart { # $result =~ s/þ//g; # $result =~ s/þ//g; $result =~ s/ÿ/\\"{y}/g; - $result =~ s/ÿ/\\"{y}/g; + $result =~ s/ÿ/\\"{y}/g; + $result =~ s/θ/\$\\theta\$/g; #converts theta from html into tex return $result; }