Diff for /loncom/xml/londefdef.pm between versions 1.221 and 1.222

version 1.221, 2004/06/08 14:13:21 version 1.222, 2004/06/17 17:03:00
Line 1534  sub start_ul { Line 1534  sub start_ul {
     } elsif ($target eq 'tex') {      } elsif ($target eq 'tex') {
  my $TeXtype=&Apache::lonxml::get_param('type',$parstack,$safeeval,undef,0);   my $TeXtype=&Apache::lonxml::get_param('type',$parstack,$safeeval,undef,0);
  if ($TeXtype eq 'disc') {   if ($TeXtype eq 'disc') {
     $currentstring .= ' \renewcommand{\labelitemi}{$\bullet$}      $currentstring .= '\renewcommand{\labelitemi}{$\bullet$}'.
                                 \renewcommand{\labelitemii}{$\bullet$}                                 '\renewcommand{\labelitemii}{$\bullet$}'. 
                                 \renewcommand{\labelitemiii}{$\bullet$}                                '\renewcommand{\labelitemiii}{$\bullet$}'.
                                 \renewcommand{\labelitemiv}{$\bullet$}\strut ';                                '\renewcommand{\labelitemiv}{$\bullet$}';
  } elsif ($TeXtype eq 'circle') {   } elsif ($TeXtype eq 'circle') {
     $currentstring .= ' \renewcommand{\labelitemi}{$\circ$}      $currentstring .= '\renewcommand{\labelitemi}{$\circ$}'.
                                 \renewcommand{\labelitemii}{$\circ$}                                 '\renewcommand{\labelitemii}{$\circ$}'. 
                                 \renewcommand{\labelitemiii}{$\circ$}                                '\renewcommand{\labelitemiii}{$\circ$}'.
                                 \renewcommand{\labelitemiv}{$\circ$}\strut ';                                '\renewcommand{\labelitemiv}{$\circ$}';
  } elsif ($TeXtype eq 'square') {   } elsif ($TeXtype eq 'square') {
     $currentstring .= ' \renewcommand{\labelitemi}{$\diamond$}      $currentstring .= '\renewcommand{\labelitemi}{$\diamond$}'.
                                 \renewcommand{\labelitemii}{$\diamond$}                                 '\renewcommand{\labelitemii}{$\diamond$}'. 
                                 \renewcommand{\labelitemiii}{$\diamond$}                                '\renewcommand{\labelitemiii}{$\diamond$}'.
                                 \renewcommand{\labelitemiv}{$\diamond$}\strut ';                                '\renewcommand{\labelitemiv}{$\diamond$}';
  }   }
  $currentstring .= '\begin{itemize}';     $currentstring .= '\strut \begin{itemize}';  
     }       } 
     return $currentstring;      return $currentstring;
 }  }
Line 1560  sub end_ul { Line 1560  sub end_ul {
     if ($target eq 'web') {      if ($target eq 'web') {
  $currentstring = $token->[2];        $currentstring = $token->[2];     
     } elsif ($target eq 'tex') {      } elsif ($target eq 'tex') {
  $currentstring = '\end{itemize} \renewcommand{\labelitemi}{$\bullet$}   $currentstring = '\end{itemize} \renewcommand{\labelitemi}{$\bullet$}'.
                                 \renewcommand{\labelitemii}{$\bullet$}                                  '\renewcommand{\labelitemii}{$\bullet$}'. 
                                 \renewcommand{\labelitemiii}{$\bullet$}                                 '\renewcommand{\labelitemiii}{$\bullet$}'.
                                 \renewcommand{\labelitemiv}{$\bullet$}\strut ';                                   '\renewcommand{\labelitemiv}{$\bullet$}\strut ';  
     }       } 
     return $currentstring;      return $currentstring;
 }  }
Line 1623  sub start_ol { Line 1623  sub start_ol {
     } elsif ($target eq 'tex') {      } elsif ($target eq 'tex') {
  my $type=&Apache::lonxml::get_param('type',$parstack,$safeeval,undef,0);   my $type=&Apache::lonxml::get_param('type',$parstack,$safeeval,undef,0);
  if ($type eq '1') {   if ($type eq '1') {
     $currentstring .= ' \renewcommand{\labelenumi}{\arabic{enumi}.}      $currentstring .= '\renewcommand{\labelenumi}{\arabic{enumi}.}'.
                                 \renewcommand{\labelenumii}{\arabic{enumii}.}                                 '\renewcommand{\labelenumii}{\arabic{enumii}.}'. 
                                 \renewcommand{\labelenumiii}{\arabic{enumiii}.}                                '\renewcommand{\labelenumiii}{\arabic{enumiii}.}'.
                                 \renewcommand{\labelenumiv}{\arabic{enumiv}.}\strut ';                                '\renewcommand{\labelenumiv}{\arabic{enumiv}.}';
  } elsif ($type eq 'A') {   } elsif ($type eq 'A') {
     $currentstring .= ' \renewcommand{\labelenumi}{\Alph{enumi}.}      $currentstring .= '\renewcommand{\labelenumi}{\Alph{enumi}.}'.
                                 \renewcommand{\labelenumii}{\Alph{enumii}.}                                 '\renewcommand{\labelenumii}{\Alph{enumii}.}'. 
                                 \renewcommand{\labelenumiii}{\Alph{enumiii}.}                                '\renewcommand{\labelenumiii}{\Alph{enumiii}.}'.
                                 \renewcommand{\labelenumiv}{\Alph{enumiv}.}\strut ';                                '\renewcommand{\labelenumiv}{\Alph{enumiv}.}';
  } elsif ($type eq 'a') {   } elsif ($type eq 'a') {
     $currentstring .= ' \renewcommand{\labelenumi}{\alph{enumi}.}      $currentstring .= '\renewcommand{\labelenumi}{\alph{enumi}.}'.
                                 \renewcommand{\labelenumii}{\alph{enumii}.}                                '\renewcommand{\labelenumii}{\alph{enumii}.}'.
                                 \renewcommand{\labelenumiii}{\alph{enumiii}.}                                '\renewcommand{\labelenumiii}{\alph{enumiii}.}'.
                                 \renewcommand{\labelenumiv}{\alph{enumiv}.} \strut ';                                '\renewcommand{\labelenumiv}{\alph{enumiv}.}';
  } elsif ($type eq 'i') {   } elsif ($type eq 'i') {
     $currentstring .= ' \renewcommand{\labelenumi}{\roman{enumi}.}      $currentstring .= '\renewcommand{\labelenumi}{\roman{enumi}.}'.
                                 \renewcommand{\labelenumii}{\roman{enumii}.}                                '\renewcommand{\labelenumii}{\roman{enumii}.}'.
                                 \renewcommand{\labelenumiii}{\roman{enumiii}.}                                '\renewcommand{\labelenumiii}{\roman{enumiii}.}'.
                                 \renewcommand{\labelenumiv}{\roman{enumiv}.}\strut  ';                                '\renewcommand{\labelenumiv}{\roman{enumiv}.}';
  } elsif ($type eq 'I') {   } elsif ($type eq 'I') {
     $currentstring .= ' \renewcommand{\labelenumi}{\Roman{enumi}.}      $currentstring .= '\renewcommand{\labelenumi}{\Roman{enumi}.}'.
                                 \renewcommand{\labelenumii}{\Roman{enumii}.}                                '\renewcommand{\labelenumii}{\Roman{enumii}.}'.
                                 \renewcommand{\labelenumiii}{\Roman{enumiii}.}                                '\renewcommand{\labelenumiii}{\Roman{enumiii}.}'.
                                 \renewcommand{\labelenumiv}{\Roman{enumiv}.} \strut ';                                '\renewcommand{\labelenumiv}{\Roman{enumiv}.}';
  }   }
  $currentstring .= '\begin{enumerate}';     $currentstring .= '\strut \begin{enumerate}';  
     }       } 
     return $currentstring;      return $currentstring;
 }  }
Line 1659  sub end_ol { Line 1659  sub end_ol {
     if ($target eq 'web') {      if ($target eq 'web') {
  $currentstring = $token->[2];        $currentstring = $token->[2];     
     } elsif ($target eq 'tex') {      } elsif ($target eq 'tex') {
  $currentstring = '\end{enumerate} \renewcommand{\labelenumi}{\arabic{enumi}.}   $currentstring = '\end{enumerate}\renewcommand{\labelenumi}{\arabic{enumi}.}'.
                                           \renewcommand{\labelenumii}{\arabic{enumii}.}                                          '\renewcommand{\labelenumii}{\arabic{enumii}.}'.
                                           \renewcommand{\labelenumiii}{\arabic{enumiii}.}                                          '\renewcommand{\labelenumiii}{\arabic{enumiii}.}'.
                                           \renewcommand{\labelenumiv}{\arabic{enumiv}.}\strut ';                                            '\renewcommand{\labelenumiv}{\arabic{enumiv}.}\strut ';  
     }       } 
     return $currentstring;      return $currentstring;
 }  }
Line 1786  sub start_table { Line 1786  sub start_table {
  my $aa = {};   my $aa = {};
  push @Apache::londefdef::table, $aa;    push @Apache::londefdef::table, $aa; 
  $Apache::londefdef::table[-1]{'row_number'} = -1;   $Apache::londefdef::table[-1]{'row_number'} = -1;
         #table's width           #maximum table's width (default coincides with text line length)
         #default coincides with text line length  
  if ($#Apache::londefdef::table==0) {   if ($#Apache::londefdef::table==0) {
     $textwidth=&recalc($ENV{'form.textwidth'}); #result is always in mm      $textwidth=&recalc($ENV{'form.textwidth'}); #result is always in mm
     $textwidth=~/(\d+\.?\d*)/;      $textwidth=~/(\d+\.?\d*)/;
Line 1819  sub start_table { Line 1818  sub start_table {
     $TeXwidth=~/(\d+)/;      $TeXwidth=~/(\d+)/;
             $Apache::londefdef::table[-1]{'width'}=$1*$textwidth/100;              $Apache::londefdef::table[-1]{'width'}=$1*$textwidth/100;
  } else {   } else {
       $Apache::londefdef::table[-1]{'forcetablewidth'}=1;
     $Apache::londefdef::table[-1]{'width'}=$TeXwidth;      $Apache::londefdef::table[-1]{'width'}=$TeXwidth;
  }           }        
         #table's border          #table's border
Line 1963  sub end_table { Line 1963  sub end_table {
  }   }
     }      }
  }   }
         #recalculation for the use of all available width if width is defined in %          #use all available width if it is defined in % or as TeXwidth
         if ($Apache::londefdef::table[-1]{'percent'}==1) {          if (($Apache::londefdef::table[-1]{'percent'}==1) || ($Apache::londefdef::table[-1]{'forcetablewidth'}==1)) {
     my $current=0;       my $current=0; 
     for (my $i=0;$i<=$#fwidth;$i++) {        for (my $i=0;$i<=$#fwidth;$i++) {  
  $current+=$fwidth[$i];   $current+=$fwidth[$i];

Removed from v.1.221  
changed lines
  Added in v.1.222


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>