[LON-CAPA-cvs] cvs: loncom /interface lonprintout.pm
foxr
foxr@source.lon-capa.org
Sat, 02 May 2009 22:16:09 -0000
foxr Sat May 2 22:16:09 2009 EDT
Modified files:
/loncom/interface lonprintout.pm
Log:
Get sequences in cstr space with pdf's to print correctly.
Index: loncom/interface/lonprintout.pm
diff -u loncom/interface/lonprintout.pm:1.551 loncom/interface/lonprintout.pm:1.552
--- loncom/interface/lonprintout.pm:1.551 Mon Apr 20 09:57:17 2009
+++ loncom/interface/lonprintout.pm Sat May 2 22:16:09 2009
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Printout
#
-# $Id: lonprintout.pm,v 1.551 2009/04/20 09:57:17 foxr Exp $
+# $Id: lonprintout.pm,v 1.552 2009/05/02 22:16:09 foxr Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1474,10 +1474,17 @@
}
}
elsif ($urlp =~ /\.pdf$/i) {
- &Apache::lonnet::logthis("include_pdf 3");
-
- my $texversion = &include_pdf($urlp);
+ my $texversion;
+ if ($member != 0) {
+ $texversion .= '\cleardoublepage';
+ }
+
+ $texversion .= &include_pdf($urlp);
$texversion = &latex_header_footer_remove($texversion);
+ if ($member != $#order) {
+ $texversion .= '\\ \cleardoublepage';
+ }
+
$result .= $texversion;
}
}
@@ -1728,7 +1735,6 @@
$do_postprocessing = 0; # Don't massage the result.
} elsif ($cleanURL =~ /\.pdf$/i) {
- &Apache::lonnet::logthis("include_pdf 1");
$result .= &include_pdf($cleanURL);
$result .= '\end{document}';
} else {
@@ -1824,6 +1830,7 @@
} else {
if ($urlp=~/\.(problem|exam|quiz|assess|survey|form|library)$/) {
$texversion=&print_latex_header($helper->{'VARS'}->{'LATEX_TYPE'});
+ $texversion =~ s/\\begin{document}//;
my $title = &Apache::lonnet::gettitle($master_seq[$i]);
$title = &Apache::lonxml::latex_special_symbols($title);
my $body ='\vskip 0 mm \noindent\textbf{'.$title.'}\vskip 0 mm ';
@@ -1859,6 +1866,7 @@
$assignment,
$courseidinfo,
$name);
+
if ($numberofcolumns eq '1') {
$result .='\newpage \noindent\parbox{\minipagewidth}{\noindent\\lhead{'.$header_text.'}} \vskip 5 mm ';
} else {
@@ -1888,8 +1896,6 @@
if ($i > 0) {
$result .= '\cleardoublepage';
}
- &Apache::lonnet::logthis("include_pdf 2");
-
$result .= &include_pdf($urlp);
if ($i != $#master_seq) {
if ($numberofcolumns eq '1') {
@@ -1970,7 +1976,7 @@
my @master_seq=split /\|\|\|/, $helper->{'VARS'}->{'RESOURCES'};
#loop over students
- my $flag_latex_header_remove = 'NO';
+ my $flag_latex_header_remove = 'NO';
my %moreenv;
$moreenv{'instructor_comments'}='hide';
$moreenv{'textwidth'}=&get_textwidth($helper,$LaTeXwidth);
@@ -2407,6 +2413,7 @@
my $header =&print_latex_header($helper->{'VARS'}->{'LATEX_TYPE'});
+ $header =~ s/\\begin{document}//; #<<<<<
my $title = &Apache::lonnet::gettitle($curresline);
$title = &Apache::lonxml::latex_special_symbols($title);
my $body ='\vskip 0 mm \noindent\textbf{'.$title.'}\vskip 0 mm ';
@@ -2442,7 +2449,13 @@
$rendered =~ s/\\end{document}//;
}
$current_output .= $rendered.'\vskip 0.5mm\noindent\makebox[\textwidth/$number_of_columns][b]{\hrulefill}\strut \vskip 0 mm \strut ';
-
+ } elsif($res_url = ~/\.pdf$/) {
+ my $url = &Apache::lonnet::clutter($res_url);
+ my $rendered = &include_pdf($url);
+ if ($remove_latex_header ne 'NO') {
+ $rendered = &latex_header_footer_remove($rendered);
+ }
+ $current_output .= $rendered;
} else {
my $rendered = &unsupported($res_url,$helper->{'VARS'}->{'LATEX_TYPE'},$curresline);
if ($remove_latex_header ne 'NO') {
@@ -2457,6 +2470,8 @@
}
if (&Apache::loncommon::connection_aborted($r)) { last; }
}
+
+
my $courseidinfo = &get_course();
my $currentassignment=&Apache::lonxml::latex_special_symbols($helper->{VARS}->{'assignment'},'header');
my $header_line =
@@ -2465,7 +2480,6 @@
my $header_start = ($columns_in_format == 1) ? '\lhead'
: '\fancyhead[LO]';
$header_line = $header_start.'{'.$header_line.'}';
-
if ($current_output=~/\\documentclass/) {
$current_output =~ s/\\begin{document}/\\setlength{\\topmargin}{1cm} \\begin{document}\\noindent\\parbox{\\minipagewidth}{\\noindent$header_line$namepostfix}\\vskip 5 mm /;
} else {