Diff for /loncom/xml/londefdef.pm between versions 1.352 and 1.353

version 1.352, 2007/01/18 20:48:02 version 1.353, 2007/01/22 11:28:08
Line 2879  sub start_img { Line 2879  sub start_img {
     $size=~s/,$/]/;       $size=~s/,$/]/; 
     $currentstring .= '\graphicspath{{'.$path.'}}'      $currentstring .= '\graphicspath{{'.$path.'}}'
  .'\includegraphics'.$size.'{'.$file.'} ';   .'\includegraphics'.$size.'{'.$file.'} ';
       $currentstring = &align_latex_image($align, $latex_rendering, 
     #    If there's an alignment specification we need to honor it here.   $currentstring, 
     #    For the horizontal alignments, we will also honor the   $width_param, $height_param);
     #    value of the latex specfication.  The default is parbox,  
     #    and that's used for illegal values too.    
     #      
     #    Even though we set a default alignment value, the user  
     #    could have given us an illegal value.  In that case we  
     #    just use the default alignment of bottom..  
     if      ($align eq "top")    {  
  $currentstring = '\raisebox{-'.$height_param.'mm}{'.$currentstring.'}';  
     } elsif (($align eq "center") || ($align eq "middle")) { # Being kind  
  my $offset = $height_param/2;  
  $currentstring = '\raisebox{-'.$offset.'mm}{'.$currentstring.'}';  
     } elsif ($align eq "left")   {   
  if ($latex_rendering eq "parpic") {   
     $currentstring = '\parpic[l]{'.$currentstring.'}';  
  } elsif ($latex_rendering eq "parbox") {  
     $currentstring = '\begin{minipage}[l]{'.$width_param.'mm}'  
  .$currentstring.'\end{minipage}';  
  } elsif ($latex_rendering eq "wrapfigure"  
  || $latex_rendering ne 'none') {  # wrapfig render  
     $currentstring =   
  '\begin{wrapfigure}{l}{'.$width_param.'mm}'  
  .'\scalebox{1.0}{'.$currentstring.'}\end{wrapfigure}';  
  }  
     } elsif ($align eq "right")  {     
  if ($latex_rendering eq "parpic") {  
     $currentstring = '\parpic[r]{'.$currentstring.'}';  
  } elsif ($latex_rendering eq "parbox") {  
     $currentstring =  '\begin{minipage}[r]{'.$width_param.'mm}'  
  .$currentstring.'\end{minipage}';  
  } elsif ($latex_rendering eq "wrapfigure"  
  || $latex_rendering ne 'none') {  # wrapfig render  
     $currentstring =   
  '\begin{wrapfigure}{r}{'.$width_param.'mm}'  
  .'\scalebox{1.0}{'.$currentstring.'}\end{wrapfigure}';  
  }  
     } else { # Bottom is also default.  
  # $currentstring = '\raisebox{'.$height_param.'mm}{'.$currentstring.'}';  
     }  
  } else {   } else {
     &Apache::lonxml::debug("$src does not exist");      &Apache::lonxml::debug("$src does not exist");
     #original image file doesn't exist so check the alt attribute      #original image file doesn't exist so check the alt attribute
Line 4389  sub LATEX_length { Line 4352  sub LATEX_length {
     return $value;      return $value;
 }  }
   
   #   Wrap image 'stuff' inside of the LaTeX required to implement 
   #   alignment:
   #     align_tex_image(align, latex_rendering, image)
   #   Where:
   #     align   - The HTML alignment specification.
   #     latex_rendering - rendering hint for latex.
   #     image   - The LaTeX needed to insert the image itsef.
   #     width,height - dimensions of the image.
   #
   sub align_latex_image {
       my ($align, $latex_rendering, $image, $width, $height) = @_;
       my $currentstring;        # The result.
       
       #    If there's an alignment specification we need to honor it here.
       #    For the horizontal alignments, we will also honor the
       #    value of the latex specfication.  The default is parbox,
       #    and that's used for illegal values too.  
       #    
       #    Even though we set a default alignment value, the user
       #    could have given us an illegal value.  In that case we
       #    just use the default alignment of bottom..
       if      ($align eq "top")    {
    $currentstring = '\raisebox{-'.$height.'mm}{'.$image.'}';
       } elsif (($align eq "center") || ($align eq "middle")) { # Being kind
    my $offset = $height/2;
    $currentstring = '\raisebox{-'.$offset.'mm}{'.$image.'}';
       } elsif ($align eq "left")   { 
    if ($latex_rendering eq "parpic") { 
       $currentstring = '\parpic[l]{'.$image.'}';
    } elsif ($latex_rendering eq "parbox") {
       $currentstring = '\begin{minipage}[l]{'.$width.'mm}'
    .$image.'\end{minipage}';
    } elsif ($latex_rendering eq "wrapfigure"
    || $latex_rendering ne 'none') {  # wrapfig render
       $currentstring = 
    '\begin{wrapfigure}{l}{'.$width.'mm}'
    .'\scalebox{1.0}{'.$image.'}\end{wrapfigure}';
    }
       } elsif ($align eq "right")  {   
    if ($latex_rendering eq "parpic") {
       $currentstring = '\parpic[r]{'.$image.'}';
    } elsif ($latex_rendering eq "parbox") {
       $currentstring =  '\begin{minipage}[r]{'.$width.'mm}'
    .$image.'\end{minipage}';
    } elsif ($latex_rendering eq "wrapfigure"
    || $latex_rendering ne 'none') {  # wrapfig render
       $currentstring = 
    '\begin{wrapfigure}{r}{'.$width.'mm}'
    .'\scalebox{1.0}{'.$image.'}\end{wrapfigure}';
    }
       } else { # Bottom is also default.
    # $currentstring = '\raisebox{'.$height.'mm}{'.$image.'}';
    $currentstring = $image;
       }
       return $currentstring;
   }
   
 # is_inside_of $tagstack $tag  # is_inside_of $tagstack $tag
 #    This sub returns true if the current state of Xml processing  #    This sub returns true if the current state of Xml processing

Removed from v.1.352  
changed lines
  Added in v.1.353


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