Diff for /loncom/xml/londefdef.pm between versions 1.396 and 1.397

version 1.396, 2008/11/10 11:17:50 version 1.397, 2008/11/24 18:55:01
Line 4304  sub image_replication { Line 4304  sub image_replication {
     }      }
     return '';      return '';
 }  }
 #  
 #   Get correct sizing parameter for an image given  
 #   it's initial ht. and wid.  This allows sizing of  
 #   images that are generated on-the-fly (e.g. gnuplot)  
 #   as well as serving as a utility for image_size.  
 #   
 #  Parameter:  
 #        height_param  
 #        width_param    - Initial picture dimensions.  
 #        scaling        - A scale factor.  
 #        parstack,      - the current stack of tag attributes   
 #                         from the xml parser  
 #        safeeval,      - pointer to the safespace  
 #        depth,         - from what level in the stack to look for attributes  
 #                         (assumes -1 if unspecified)  
 #        cis            - look for attrubutes case insensitively  
 #                         (assumes false)  
 #  
 # Returns:  
 #   height, width   - new dimensions.  
 #  
 sub resize_image {  sub resize_image {
     my ($height_param, $width_param, $scaling,      my ($height_param, $width_param, $scaling,
  $parstack, $safeeval, $depth, $cis) = @_;   $parstack, $safeeval, $depth, $cis) = @_;
Line 4514  sub file_path { Line 4496  sub file_path {
     }       } 
     return $file,$path;      return $file,$path;
 }  }
 #  Converts a measurement in to mm from any of   
 #  the other valid LaTeX units of measure.  
 #  If the units of measure are missing from the   
 #  parameter, it is assumed to be in and returned  
 #  with mm units of measure  
 sub recalc {  sub recalc {
     my $argument = shift;      my $argument = shift;
     if (not $argument=~/(mm|cm|in|pc|pt)/) {return $argument.' mm';}      if (not $argument=~/(mm|cm|in|pc|pt)/) {return $argument.' mm';}
Line 4562  sub LATEX_length { Line 4541  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.  
 # Returns:  
 #    The 1/2 wrapped image and the stuff required to close the  
 #    wrappage.  This allows e.g. randomlabel to insert more stuff  
 #    into the closure.  
 #  
 sub align_latex_image {  sub align_latex_image {
     my ($align, $latex_rendering, $image, $width, $height) = @_;      my ($align, $latex_rendering, $image, $width, $height) = @_;
     my $currentstring;        # The 1/2 wrapped image.      my $currentstring;        # The 1/2 wrapped image.
Line 4641  sub align_latex_image { Line 4608  sub align_latex_image {
     return ($currentstring, $closure);      return ($currentstring, $closure);
 }  }
   
 # is_inside_of $tagstack $tag  
 #    This sub returns true if the current state of Xml processing  
 #    is inside of the tag.     
 # Parameters:  
 #     tagstack   - The tagstack from the parser.  
 #     tag        - The tag (without the <>'s.).  
 # Sample usage:  
 #     if (is_inside_of($tagstack "table")) {  
 #          # I'm in a table....  
 #      }  
 sub is_inside_of {  sub is_inside_of {
     my ($tagstack, $tag) = @_;      my ($tagstack, $tag) = @_;
     my @stack = @$tagstack;      my @stack = @$tagstack;
Line 4663  sub is_inside_of { Line 4621  sub is_inside_of {
 }  }
   
   
   =pod
   
   =head1 NAME
   
   Apache::londefdef.pm
   
   =head1 SYNOPSIS
   
   Tags Default Definition Module
   
   This is part of the LearningOnline Network with CAPA project
   described at http://www.lon-capa.org.
   
   
   =head1 NOTABLE SUBROUTINES
   
   =over
   
   =item start_hideweboutput()
   
   =item end_hideweboutput()
   
   =item image_replication()
   
   =item resize_image()
   
    Get correct sizing parameter for an image given
    it's initial ht. and wid.  This allows sizing of
    images that are generated on-the-fly (e.g. gnuplot)
    as well as serving as a utility for image_size.
    
    Parameter:
           height_param
           width_param    - Initial picture dimensions.
           scaling        - A scale factor.
           parstack,      - the current stack of tag attributes 
                            from the xml parser
           safeeval,      - pointer to the safespace
           depth,         - from what level in the stack to look for attributes
                            (assumes -1 if unspecified)
           cis            - look for attrubutes case insensitively
                            (assumes false)
   
    Returns:
    height, width   - new dimensions.
   
   =item image_size()
   
   =item image_width()
   
   =item image_height()
   
   =item get_eps_image()
   
   =item eps_generation()
   
   =item file_path()
   
   =item recalc()
   
    Converts a measurement in to mm from any of 
    the other valid LaTeX units of measure.
    If the units of measure are missing from the 
    parameter, it is assumed to be in and returned
    with mm units of measure
   
   =item LATEX_length()
   
   =item align_latex_image()
   
     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.
     Returns:
       The 1/2 wrapped image and the stuff required to close the
       wrappage.  This allows e.g. randomlabel to insert more stuff
       into the closure.
   
   
   =item is_inside_of($tagstack, $tag)
       This sub returns true if the current state of Xml processing is inside of the tag.   
    Parameters:
       tagstack   - The tagstack from the parser.
       tag        - The tag (without the <>'s.).
    Sample usage:
       if (is_inside_of($tagstack "table")) {
           I'm in a table....
         }
   
   
   
   =back
   
   =cut
   
   
 1;  1;
 __END__  __END__

Removed from v.1.396  
changed lines
  Added in v.1.397


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