Diff for /loncom/interface/entities.pm between versions 1.9 and 1.10

version 1.9, 2008/04/28 10:33:35 version 1.10, 2008/04/29 10:15:58
Line 711  my %entities = ( Line 711  my %entities = (
     8733     => '\ensuremath{\propto}',      8733     => '\ensuremath{\propto}',
     'infin'  => '\ensuremath{\infty}',      'infin'  => '\ensuremath{\infty}',
     8734     => '\ensuremath{\infty}',      8734     => '\ensuremath{\infty}',
   #
   #   The items below require the isoent latex package which I can't find at least for FC5.
   #   Temporarily commented out.
   #
 #    'ang90'  => '\ensuremath{\sqangle}',  #    'ang90'  => '\ensuremath{\sqangle}',
 #    8735     => '\ensuremath{\sqangle}',  #    8735     => '\ensuremath{\sqangle}',
     'ang'    => '\ensuremath{\angle}',      'ang'    => '\ensuremath{\angle}',
Line 921  my %entities = ( Line 925  my %entities = (
           
 );  );
   
   #  There are some named entities that don't have a good
   #  latex equivalent, these are converted to utf-8 via this table
   #  of entity name -> unicode number.
   
   my  %utf_table = (
       'THORN'  => 222,
       'thorn'  => 254,
       'eth'    => 240
   );
   
 #   # 
 #  Convert a numerical entity (that does not exist in our hash)  #  Convert a numerical entity (that does not exist in our hash)
 #  to its UTF-8 equivalent representation.  #  to its UTF-8 equivalent representation.
Line 935  my %entities = ( Line 949  my %entities = (
 #  #
 sub entity_to_utf8 {  sub entity_to_utf8 {
     my ($unicode) = @_;      my ($unicode) = @_;
       my $result =  pack("U", $unicode);
     return pack("U", $unicode);      return $result;
 }  }
   
   
Line 969  sub entity_to_latex { Line 983  sub entity_to_latex {
  return $latex;   return $latex;
     }      }
     # If the text is purely numeric we can do the UTF-8 conversion:      # If the text is purely numeric we can do the UTF-8 conversion:
       # Otherwise there are a few textual entities that don't have good latex
     if ($entity =~ /^\d$/) {      # which can be converted to unicode:
       #
       if ($entity =~ /^\d+$/) {
  return &entity_to_utf8($entity);   return &entity_to_utf8($entity);
       } else {
    my $result = $utf_table{"$entity"};
    if (defined $result) {
       return &entity_to_utf8($result);
    }
     }      }
     #  Can't do the conversion`< ...      #  Can't do the conversion`< ...
   

Removed from v.1.9  
changed lines
  Added in v.1.10


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