[LON-CAPA-cvs] cvs: loncom /homework randomlabel.pm

sakharuk lon-capa-cvs@mail.lon-capa.org
Fri, 02 Aug 2002 18:20:49 -0000


sakharuk		Fri Aug  2 14:20:49 2002 EDT

  Modified files:              
    /loncom/homework	randomlabel.pm 
  Log:
  Fixed a bug in previous version. If you split the picture environment in latex (going to the next page) you destroy the coordinate system and all lables will
  be put in a wrong place. 
  
  
Index: loncom/homework/randomlabel.pm
diff -u loncom/homework/randomlabel.pm:1.32 loncom/homework/randomlabel.pm:1.33
--- loncom/homework/randomlabel.pm:1.32	Tue Jul 30 12:12:38 2002
+++ loncom/homework/randomlabel.pm	Fri Aug  2 14:20:48 2002
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # random labelling tool
 #
-# $Id: randomlabel.pm,v 1.32 2002/07/30 16:12:38 sakharuk Exp $
+# $Id: randomlabel.pm,v 1.33 2002/08/02 18:20:48 sakharuk Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -116,10 +116,10 @@
     }
     $bgimg=~s/\/$//;
     if ($texwidth==90) {
-	$result.='\vspace*{2mm}  \noindent \epsfxsize='.$texwidth.' mm \epsffile{'.
+	$result.='\vspace*{2mm} \parbox{\textwidth}{  \noindent \epsfxsize='.$texwidth.' mm \epsffile{'.
 	    $bgimg.'}\setlength{\unitlength}{1mm}  \begin{picture}('.$texwidth.','.$texwidth*$h/$w.')';
     } else {
-	$result.='\vspace*{2mm}  \noindent \epsfxsize='.$texwidth.' mm \epsffile{'.
+	$result.='\vspace*{2mm} \parbox{\textwidth}{  \noindent \epsfxsize='.$texwidth.' mm \epsffile{'.
 	    $bgimg.'}\setlength{\unitlength}{1mm}  \begin{picture}('.$texwidth.','.$texwidth*$h/$w.')('.(100-$texwidth).','.(100-$texwidth)*$h/$w.')';
     }
   } elsif ($target eq 'edit') {
@@ -155,7 +155,7 @@
     if( $count != 0) { $result.= "<param name=\"ICOUNT\" value=\"$count\">\n"; }
     $result .= "</applet>\n<BR />";
   } elsif ($target eq 'tex') {
-      $result='\end{picture}\\\\';
+      $result='\end{picture}\\\\}';
       if (@$parstack[-1]=~/\$texwidth\s*=\s*?"90/) { #"
 	  @$parstack[-1]=~/\$height\s*=\s*?"(.+)?"/;
 	  my $howtoskipback = $1/48;