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

onken lon-capa-cvs-allow@mail.lon-capa.org
Fri, 05 Sep 2008 09:09:38 -0000


onken		Fri Sep  5 05:09:38 2008 EDT

  Modified files:              
    /loncom/interface	lonprintout.pm 
  Log:
  Bugfix for LaTex-Error while printing a resource as author from construction space.
  
  
Index: loncom/interface/lonprintout.pm
diff -u loncom/interface/lonprintout.pm:1.537 loncom/interface/lonprintout.pm:1.538
--- loncom/interface/lonprintout.pm:1.537	Mon Aug 25 06:16:27 2008
+++ loncom/interface/lonprintout.pm	Fri Sep  5 05:09:38 2008
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Printout
 #
-# $Id: lonprintout.pm,v 1.537 2008/08/25 10:16:27 foxr Exp $
+# $Id: lonprintout.pm,v 1.538 2008/09/05 09:09:38 onken Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -280,6 +280,13 @@
     # to \% else LaTeX will think they are comments and terminate
     # the line.. which is bad!!!
     
+    # If the user has role author, $course and $assignment are empty so
+    # there is '\\ \\ ' in the page header. That's cause a error in LaTeX
+    if($format =~ /\\\\\s\\\\\s/) {
+        #TODO find sensible caption for page header
+        my $testPrintout = '\\\\'.&mt('Construction Space').' \\\\'.&mt('Test-Printout ');
+        $format =~ s/\\\\\s\\\\\s/$testPrintout/;
+    }
     
 
     return $format;