[LON-CAPA-cvs] cvs: loncom /interface lonprintout.pm

foxr foxr@source.lon-capa.org
Mon, 20 Apr 2009 09:57:17 -0000


foxr		Mon Apr 20 09:57:17 2009 EDT

  Modified files:              
    /loncom/interface	lonprintout.pm 
  Log:
  Straighten out some issues that resulted from factoring latex header.
  
  
  
Index: loncom/interface/lonprintout.pm
diff -u loncom/interface/lonprintout.pm:1.550 loncom/interface/lonprintout.pm:1.551
--- loncom/interface/lonprintout.pm:1.550	Fri Apr 17 10:08:42 2009
+++ loncom/interface/lonprintout.pm	Mon Apr 20 09:57:17 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Printout
 #
-# $Id: lonprintout.pm,v 1.550 2009/04/17 10:08:42 foxr Exp $
+# $Id: lonprintout.pm,v 1.551 2009/04/20 09:57:17 foxr Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -163,7 +163,7 @@
     $base =~ s/ /\_/g;
 
 
-    my $output = &print_latex_header()."\\begin{document}\n";
+    my $output = &print_latex_header();
     $output    .= '\special{ps: _begin_job_ ('
 	.$base.'.pdf.eps'.
 	')run _end_job_}';
@@ -1474,7 +1474,11 @@
 	    }
 	}
 	elsif ($urlp =~ /\.pdf$/i) {
-	    $result .= &include_pdf($urlp);
+	    &Apache::lonnet::logthis("include_pdf 3");
+	    
+	    my $texversion = &include_pdf($urlp);
+	    $texversion = &latex_header_footer_remove($texversion);
+	    $result .= $texversion;
 	}
     }
     if ($helper->{VARS}->{'construction'} eq '1') {$result=~s/(\\begin{document})/$1 \\fbox\{RANDOM SEED IS $rndseed\} /;}
@@ -1692,7 +1696,7 @@
 		 && $currentURL=~/\.sequence$/ && $helper->{'VARS'}->{'construction'} eq '1') {
             #printing content of sequence from the construction space	
 	    $currentURL=~s|\/~([^\/]+)\/|\/home\/$1\/public_html\/|;
-	    $result .= &print_latex_header($helper->{'VARS'}->{'LATEX_TYPE'});
+#	    $result .= &print_latex_header($helper->{'VARS'}->{'LATEX_TYPE'});
 	    $result .= &print_construction_sequence($currentURL, $helper, %form,
 						    $LaTeXwidth);
 	    $result .= '\end{document}';  
@@ -1724,7 +1728,9 @@
 	    $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 {
 	    $result.=&unsupported($currentURL,$helper->{'VARS'}->{'LATEX_TYPE'},
 				  $helper->{'VARS'}->{'symb'});
@@ -1882,6 +1888,8 @@
 		if ($i > 0) {
 		    $result .= '\cleardoublepage';
 		}
+		&Apache::lonnet::logthis("include_pdf 2");
+
 		$result .= &include_pdf($urlp);
 		if ($i != $#master_seq) {
 		    if ($numberofcolumns eq '1') {