--- loncom/interface/lonprintout.pm 2002/07/01 15:02:54 1.35 +++ loncom/interface/lonprintout.pm 2002/07/01 20:56:20 1.36 @@ -1,7 +1,7 @@ # The LearningOnline Network # Printout # -# $Id: lonprintout.pm,v 1.35 2002/07/01 15:02:54 sakharuk Exp $ +# $Id: lonprintout.pm,v 1.36 2002/07/01 20:56:20 sakharuk Exp $ # # Copyright Michigan State University Board of Trustees # @@ -85,8 +85,19 @@ ENDMENUOUT2 $r->print(<

And what page format do you prefer?

- Two columns landscape
- Two columns portrait
+ + + + + + +
+ Landscape
+ Portrait
+
  + Number of columns: +
+
@@ -110,11 +121,13 @@ ENDPART my $choice = $ENV{'form.choice'}; my $layout = $ENV{'form.layout'}; + my $numberofcolumns = $ENV{'form.numberofcolumns'}; my $laystyle = 'book'; my $result = ''; my $number_of_columns = 1; - + if ($choice eq 'Standard LaTeX output for current document') { + #-- single document - problem, page, html, xml my %moreenv; $moreenv{'form.grade_target'}='tex'; $moreenv{'request.filename'}=$ENV{'form.url'}; @@ -125,24 +138,24 @@ ENDPART $result = &additional_cleanup($result); if ($ENV{'form.url'}=~m/\.page\s*$/) {($result,$number_of_columns) = &page_cleanup($result);} } elsif ($choice eq 'Standard LaTeX output for the primary sequence' or $choice eq 'Standard LaTeX output for whole primary sequence') { -#-- where is the primary sequence containing file? - my %moreenv; + #-- minimal sequence to which the current document belongs + #-- where is the primary sequence containing file? my $symbolic = &Apache::lonnet::symbread($ENV{'form.url'}); $_ = $symbolic; m/([^_]+)_/; my $primary_sequence = '/res/'.$1; -#-- open and analyses the primary sequence + #-- open and analyses the primary sequence my $sequence_file=&Apache::lonnet::filelocation("",$primary_sequence); my $sequencefilecontents=&Apache::lonnet::getfile($sequence_file); my @master_seq = &content_map($sequencefilecontents); -#-- produce an output string + #-- produce an output string for (my $i=0;$i<=$#master_seq;$i++) { $_ = $master_seq[$i]; m/\"(.*)\"/; $_ = $1; - my $urlp = $1; + my $urlp = $1; if ($choice eq 'Standard LaTeX output for the primary sequence') { - if (/\.(problem|exam|quiz|assess|survey|form|library)/) { + if ($urlp =~ m/\.(problem|exam|quiz|assess|survey|form|library)/) { my %moreenv; $moreenv{'form.grade_target'}='tex'; &Apache::lonnet::appenv(%moreenv); @@ -151,6 +164,7 @@ ENDPART $result .= $texversion; } } else { + my %moreenv; $moreenv{'form.grade_target'}='tex'; &Apache::lonnet::appenv(%moreenv); my $texversion=&Apache::lonnet::ssi($urlp); @@ -232,7 +246,8 @@ ENDPART } #-- corrections for the different page formats - if ($layout eq 'CBI') { + if ($layout eq 'CBI' and $numberofcolumns eq '1') { + } elsif ($layout eq 'CBI' and $numberofcolumns eq '2') { $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}/; $laystyle = 'album'; } elsif ($layout eq 'CAPA') {