--- loncom/interface/lonprintout.pm 2004/07/28 19:07:16 1.318 +++ loncom/interface/lonprintout.pm 2004/08/04 18:18:40 1.319 @@ -1,7 +1,7 @@ # The LearningOnline Network # Printout # -# $Id: lonprintout.pm,v 1.318 2004/07/28 19:07:16 albertel Exp $ +# $Id: lonprintout.pm,v 1.319 2004/08/04 18:18:40 sakharuk Exp $ # # Copyright Michigan State University Board of Trustees # @@ -422,14 +422,16 @@ sub page_format { if ($layout eq 'book') { if ($numberofcolumns == 1) { $textwidth = '176 mm'; - $textheight = '254 mm'; + $textheight = '272 mm'; $oddoffset = '-0.57 in'; $evenoffset = '-0.57 in'; + $topmargin = '-0.5 in'; } elsif ($numberofcolumns == 2) { $textwidth = '91 mm'; - $textheight = '254 mm'; + $textheight = '272 mm'; $oddoffset = '-0.57 in'; $evenoffset = '-0.57 in'; + $topmargin = '-0.5 in'; } } elsif ($layout eq 'album') { if ($numberofcolumns eq '1') { @@ -483,15 +485,19 @@ sub page_format_transformation { my $name = &get_name(); my $courseidinfo = &get_course(); if (defined($courseidinfo)) { $courseidinfo=' - '.$courseidinfo } + my $topmargintoinsert = ''; + if ($topmargin ne '0') {$topmargintoinsert='\setlength{\topmargin}{'.$topmargin.'}';} if ($layout eq 'album') { - my $topmargintoinsert = ''; - if ($topmargin ne '0') {$topmargintoinsert='\setlength{\topmargin}{'.$topmargin.'}';} $text =~ s/\\begin{document}/\\setlength{\\oddsidemargin}{$oddoffset}\\setlength{\\evensidemargin}{$evenoffset}$topmargintoinsert\\setlength{\\textwidth}{$textwidth}\\setlength{\\textheight}{$textheight}\\setlength{\\textfloatsep}{8pt plus 2\.0pt minus 4\.0pt}\\newlength{\\minipagewidth}\\setlength{\\minipagewidth}{\\textwidth\/\$number_of_columns-0\.2cm}\\usepackage{fancyhdr}\\pagestyle{fancy}\\rhead{}\\chead{}\\lhead{\\textbf{$name} $courseidinfo \\hfill \\thepage \\\\ \\textit{$assignment}} \\begin{document}\\voffset=-0\.8 cm\\setcounter{page}{1} /; } elsif ($layout eq 'book') { + if ($choice ne 'All class print') { - $text =~ s/\\begin{document}/\\textheight $textheight\\oddsidemargin = $evenoffset\\evensidemargin = $evenoffset\\textwidth= $textwidth\\newlength{\\minipagewidth}\\setlength{\\minipagewidth}{\\textwidth\/\$number_of_columns-0\.2cm}\\renewcommand{\\ref}{\\keephidden\}\\usepackage{fancyhdr}\\pagestyle{fancy}\\rhead{}\\chead{}\\lhead{\\textbf{$name} $courseidinfo \\hfill \\thepage \\\\ \\textit{$assignment}}\\begin{document}\\voffset=-0\.8 cm\\setcounter{page}{1}/; + $text =~ s/\\begin{document}/\\textheight $textheight\\oddsidemargin = $evenoffset\\evensidemargin = $evenoffset $topmargintoinsert\\textwidth= $textwidth\\newlength{\\minipagewidth}\\setlength{\\minipagewidth}{\\textwidth\/\$number_of_columns-0\.2cm}\\renewcommand{\\ref}{\\keephidden\}\\usepackage{fancyhdr}\\pagestyle{fancy}\\rhead{}\\chead{}\\lhead{\\textbf{$name} $courseidinfo \\hfill \\thepage \\\\ \\textit{$assignment}}\\begin{document}\\voffset=-0\.8 cm\\setcounter{page}{1}/; } else { - $text =~ s/\\pagestyle{fancy}\\rhead{}\\chead{}\s*\\begin{document}/\\textheight = $textheight\\oddsidemargin = $evenoffset\\evensidemargin = $evenoffset\\textwidth= $textwidth\\newlength{\\minipagewidth}\\setlength{\\minipagewidth}{\\textwidth\/\$number_of_columns-0\.2cm}\\renewcommand{\\ref}{\\keephidden\}\\pagestyle{fancy}\\rhead{}\\chead{}\\begin{document}\\voffset=-0\.8cm\\setcounter{page}{1} \\vskip 5 mm /; + $text =~ s/\\pagestyle{fancy}\\rhead{}\\chead{}\s*\\begin{document}/\\textheight = $textheight\\oddsidemargin = $evenoffset\\evensidemargin = $evenoffset $topmargintoinsert\\textwidth= $textwidth\\newlength{\\minipagewidth}\\setlength{\\minipagewidth}{\\textwidth\/\$number_of_columns-0\.2cm}\\renewcommand{\\ref}{\\keephidden\}\\pagestyle{fancy}\\rhead{}\\chead{}\\begin{document}\\voffset=-0\.8cm\\setcounter{page}{1} \\vskip 5 mm /; + } + if ($papersize eq '6') { + $text =~ s/(\\begin{document})/$1\\special{papersize=210mm,297mm}/; } } if ($tableofcontents eq 'yes') {$text=~s/(\\setcounter\{page\}\{1\})/$1 \\tableofcontents\\newpage /;}