[LON-CAPA-cvs] cvs: loncom /xml londefdef.pm

foxr foxr@source.lon-capa.org
Mon, 20 Apr 2009 10:40:04 -0000


foxr		Mon Apr 20 10:40:04 2009 EDT

  Modified files:              
    /loncom/xml	londefdef.pm 
  Log:
  Always insert the \begin{document}...take out some header dupls
  
  
  
Index: loncom/xml/londefdef.pm
diff -u loncom/xml/londefdef.pm:1.401 loncom/xml/londefdef.pm:1.402
--- loncom/xml/londefdef.pm:1.401	Mon Apr 13 20:42:32 2009
+++ loncom/xml/londefdef.pm	Mon Apr 20 10:40:04 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Tags Default Definition Module 
 #
-# $Id: londefdef.pm,v 1.401 2009/04/13 20:42:32 raeburn Exp $
+# $Id: londefdef.pm,v 1.402 2009/04/20 10:40:04 foxr Exp $
 # 
 #
 # Copyright Michigan State University Board of Trustees
@@ -4787,12 +4787,15 @@
 #
 sub latex_header
 {
+    my ($mode) = @_;
     my $currentstring = '';
 
     $currentstring .= 
+	"\n% &Apache::lonxml::londefdef \n" .
 	'\documentclass[letterpaper,twoside]{article}\raggedbottom';
     if (($env{'form.latex_type'}=~'batchmode') ||
-	(!$env{'request.role.adv'})) {$currentstring .='\batchmode';} 
+	(!$env{'request.role.adv'}) || 
+	($mode eq 'batchmode')) {$currentstring .='\batchmode';} 
     $currentstring .= '\newcommand{\keephidden}[1]{}'.
 	'\renewcommand{\deg}{$^{\circ}$}'.
 	'\usepackage{multirow}'.
@@ -4820,8 +4823,14 @@
 	'\usepackage{amssymb}'.
 	'\usepackage{amsfonts}'.
 	'\usepackage{amsthm}'.
-	'\usepackage{amscd}';
-    
+	'\usepackage{amscd}'
+        .'\usepackage{picins}\usepackage{calc}'."\n". # From lonprintout.pm
+	'\usepackage[T1]{fontenc}'."\n".
+	'\usepackage{lmodern}'."\n".
+	'\usepackage[postscript]{ucs}'."\n".
+	'\usepackage[utf8x]{inputenc}'."\n".
+	'\usepackage{pifont}'  . "\n";
+	
     if($env{'form.pdfFormFields'} eq 'yes') {
 	$currentstring .= '\usepackage{hyperref}'.
 	    '\usepackage{eforms}'.
@@ -4830,6 +4839,7 @@
     
         $currentstring .= '\newenvironment{choicelist}{\begin{list}{}{\setlength{\rightmargin}{0in}\setlength{\leftmargin}{0.13in}\setlength{\topsep}{0.05in}\setlength{\itemsep}{0.022in}\setlength{\parsep}{0in}\setlength{\belowdisplayskip}{0.04in}\setlength{\abovedisplayskip}{0.05in}\setlength{\abovedisplayshortskip}{-0.04in}\setlength{\belowdisplayshortskip}{0.04in}}}{\end{list}}'.
                           '\renewenvironment{theindex}{\begin{list}{}{{\vskip 1mm \noindent \large\textbf{Index}} \newline \setlength{\rightmargin}{0in}\setlength{\leftmargin}{0.13in}\setlength{\topsep}{0.01in}\setlength{\itemsep}{0.1in}\setlength{\parsep}{-0.02in}\setlength{\belowdisplayskip}{0.01in}\setlength{\abovedisplayskip}{0.01in}\setlength{\abovedisplayshortskip}{-0.04in}\setlength{\belowdisplayshortskip}{0.01in}}}{\end{list}}';
+    $currentstring .= '\begin{document}';
     
     return $currentstring;