Annotation of loncom/interface/entities.pm, revision 1.2

1.1       foxr        1: # The LearningOnline Network
                      2: # entity -> tex.
                      3: #
                      4: # $Id:
                      5: #
                      6: # Copyright Michigan State University Board of Trustees
                      7: #
                      8: # This file is part of the LearningOnline Network with CAPA (LON-CAPA).
                      9: #
                     10: # LON-CAPA is free software; you can redistribute it and/or modify
                     11: # it under the terms of the GNU General Public License as published by
                     12: # the Free Software Foundation; either version 2 of the License, or
                     13: # (at your option) any later version.
                     14: #
                     15: # LON-CAPA is distributed in the hope that it will be useful,
                     16: # but WITHOUT ANY WARRANTY; without even the implied warranty of
                     17: # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
                     18: # GNU General Public License for more details.
                     19: #
                     20: # You should have received a copy of the GNU General Public License
                     21: # along with LON-CAPA; if not, write to the Free Software
                     22: # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
                     23: #
                     24: # /home/httpd/html/adm/gpl.txt
                     25: # http://www.lon-capa.org/
                     26: #
                     27: #
                     28: package Apache::entities;
                     29: use strict;
                     30: #
                     31: #   This file contains a table driven entity-->latex converter.
                     32: #
                     33: #  Assumptions:
                     34: #   The number of entities in a resource is small compared with the
                     35: #   number of possible entities that might be translated.
                     36: #   Therefore the strategy is to match a general entity pattern
                     37: #   &.+; over and over, pull out the match look it up in an entity -> tex hash
                     38: #   and do the replacement.
                     39: #
                     40: #  In order to simplify the hash, the following reductions are done:
                     41: #   &#d+; have the &# and ; stripped and is converted to an int.
                     42: #   &#.+; have the &#x and ; stripped and is converted to an int as a hex
                     43: #                             value.
                     44: #   All others have the & and ; stripped.
                     45: 
                     46: 
                     47: #  The hash:  Add new conversions here; leave off the leading & and the trailing ;
                     48: #  all numeric entities need only appear as their decimal versions
                     49: #  (e.g. no need for 1234 is sufficient, no need for 0x4d2 as well.
                     50: #
                     51: #  This entity table is mercilessly cribbed from the  HTML pocket reference
                     52: #  table starting at pg 82.  In most cases the LaTeX equivalent codes come from
                     53: #  the original massive regular expression replacements originally by 
                     54: #  A. Sakharuk in lonprintout.pm
                     55: #
1.2     ! foxr       56: #  I also want to acknowledge
        !            57: #   ISO Character entities and their LaTeX equivalents by 
        !            58: #      Vidar Bronken Gundersen, and Rune Mathisen
        !            59: #    http://www.bitjungle.com/isoent-ref.pdf
        !            60: #
        !            61: 
1.1       foxr       62: #  Note numerical entities are essentially unicode character codes.
                     63: #
                     64: my %entities = {
                     65: 
                     66:     #  ---- ASCII code page: ----------------
                     67: 
                     68:     # Translation to empty strings:
                     69: 
                     70:     7        => "",
                     71:     9        => "",
                     72:     10       => "",
                     73:     13       => "",
                     74:     
                     75:     # Translations to simple characters:
                     76: 
                     77:     32       => " ",
                     78:     33       => "!",
                     79:     34       => '"',
                     80:     'quot'   => '"',
                     81:     35       => '\\\#',
                     82:     36       => '\\\$',
                     83:     37       => '\\%',
                     84:     38       => '\\&',
                     85:     'amp'    => '\\&',
                     86:     39       => '\'',		# Apostrophe
                     87:     40       => '(',
                     88:     41       => ')',
                     89:     42       => '\*',
                     90:     43       => '\+',
                     91:     44       => ',',		#  comma
                     92:     45       => '-',
                     93:     46       => '\.',
                     94:     47       => '\/',
                     95:     48       => '0',
                     96:     49       => '1',
                     97:     50       => '2',
                     98:     51       => '3',
                     99:     52       => '4',
                    100:     53       => '5',
                    101:     54       => '6',
                    102:     55       => '7',
                    103:     56       => '8',
                    104:     57       => '9',
                    105:     58       => ':',
                    106:     59       => ';',
                    107:     60       => '\\ensuremath\{<\}',
                    108:     'lt'     => '\\ensuremath\{<\}',
                    109:     61       => '\\ensuremath\{=\}',
                    110:     62       => '\\ensuremath\{>\}',
                    111:     'gt'     => '\\ensuremath\{>\}',
                    112:     63       => '\?',
                    113:     64       => '@',
                    114:     65       => 'A',
                    115:     66       => 'B',
                    116:     67       => 'C',
                    117:     68       => 'D',
                    118:     69       => 'E',
                    119:     70       => 'F',
                    120:     71       => 'G',
                    121:     72       => 'H',
                    122:     73       => 'I',
                    123:     74       => 'J',
                    124:     75       => 'K',
                    125:     76       => 'L',
                    126:     77       => 'M',
                    127:     78       => 'N',
                    128:     79       => 'O',
                    129:     80       => 'P',
                    130:     81       => 'Q',
                    131:     82       => 'R',
                    132:     83       => 'S',
                    133:     84       => 'T',
                    134:     85       => 'U',
                    135:     86       => 'V',
                    136:     87       => 'W',
                    137:     88       => 'X',
                    138:     89       => 'Y',
                    139:     90       => 'Z',
                    140:     91       => '[',
                    141:     92       => '\\ensuremath\{\\setminus\}', # \setminus is \ with special spacing.
                    142:     93       => ']',
                    143:     94       => '\\ensuremath\{\\wedge\}',
                    144:     95       => '\\underline\{\\makebox[2mm]\\{\\strut\}\}', # Underline 2mm of space for _
                    145:     96       => '`',
                    146:     97       => 'a',
                    147:     98       => 'b',
                    148:     99       => 'c',
                    149:     100      => 'd',
                    150:     101      => 'e',
                    151:     102      => 'f',
                    152:     103      => 'g',
                    153:     104      => 'h', 
                    154:     105      => 'i',
                    155:     106      => 'j',
                    156:     107      => 'k',
                    157:     108      => 'l',
                    158:     109      => 'm',
                    159:     110      => 'n',
                    160:     111      => 'o',
                    161:     112      => 'p',
                    162:     113      => 'q',
                    163:     114      => 'r',
                    164:     115      => 's',
                    165:     116      => 't',
                    166:     117      => 'u',
                    167:     118      => 'v',
                    168:     119      => 'w',
                    169:     120      => 'x',
                    170:     121      => 'y',
                    171:     122      => 'z',
                    172:     123      => '\\{',
                    173:     124      => '\|',
                    174:     125      => '\\}',
                    175:     126      => '\~',
                    176: 
                    177:     #   Controls and Latin-1 supplement.  Note that some entities that have
                    178:     #   visible effect are not printing unicode characters.  Specifically
                    179:     #   &#130;-&#160;
                    180: 
                    181:     130     => ',',
                    182:     131     => '\\textflorin ',
                    183:     132     => ',,',		# Low double left quotes.
                    184:     133     => '\\ensuremat\{\\ldots\}',
                    185:     134     => '\\ensuremath\{\\dagger\}',
                    186:     135     => '\\ensuremath\{\\ddagger\}',
                    187:     136     => '\\ensuremath\{\\wedge\}',
                    188:     137     => '\\textperthousand ',
                    189:     138     => '\\v\{S\}',
                    190:     139     => '\\ensuremath\{<\}',
                    191:     140     => '\{\\OE\}',
                    192:     
                    193:     #  There's a gap here in my entity table
                    194: 
                    195:     145     => '\`',
                    196:     146     => '\'',
                    197:     147     => '\`\`',
                    198:     148     => '\'\'',
                    199:     149     => '\\ensuremath\{\\bullet\}',
                    200:     150     => '--',
                    201:     151     => '---',
                    202:     152     => '\\ensuremath\{\\sim\}',
                    203:     153     => '\\texttrademark',
                    204:     154     => '\\v\{s\}',
                    205:     155     => '\\ensuremath\{>\}',
                    206:     156     => '\\oe ',
                    207:     
                    208:     # Another short gap:
                    209: 
                    210:     159     => '\\"Y',
                    211:     160     => '~',
                    212:     'nbsp'  => '~',
                    213:     161     => '\\textexclamdown ',
                    214:     'iexcl' => '\\textexclamdown ',
                    215:     162     => '\\textcent ',
                    216:     'cent'  => '\\textcent ',
                    217:     163     => '\\pounds ',
                    218:     'pound' => '\\pounds ',
                    219:     164     => '\\textcurrency ',
                    220:     'curren' => '\\textcurrency ',
                    221:     165     => '\\textyen ',
                    222:     'yen'   => '\\textyen ',
                    223:     166     => '\\textbrokenbar ',
                    224:     'brvbar' => '\\textbrokenbar ',
                    225:     167     => '\\textsection ',
                    226:     'sect'  => '\\textsection ',
                    227:     168     => '\\texthighdieresis ',
                    228:     'uml'   => '\\texthighdieresis ',
                    229:     169     => '\\copyright ',
                    230:     'copy'  => '\\copyright ',
                    231:     170     => '\\textordfeminine ',
                    232:     'ordf'  => '\\textordfeminine ',
                    233:     171     => '\\ensuremath\{\ll\}', # approximation of left angle quote.
                    234:     'laquo' => '\\ensuremath\{\ll\}', #   ""
                    235:     172     => '\\ensuremath\{\\neg\}',
                    236:     'not'   => '\\ensuremath\{\\neg\}',
                    237:     173     => ' - ',
                    238:     'shy'   => ' - ',
                    239:     174     => '\\textregistered ',
                    240:     'reg'   => '\\textregistered ',
                    241:     175     => '\\ensuremath\{^\{-\}\}',
                    242:     'macr'  => '\\ensuremath\{^\{-\}\}',
                    243:     176     => '\\ensuremath\{^\{\\circ\}\}',
                    244:     'deg'   => '\\ensuremath\{^\{\\circ\}\}',
                    245:     177     => '\\ensuremath\{\\pm\}',
                    246:     'plusmn' => '\\ensuremath\{\\pm\}',
                    247:     178     => '\\ensuremath\{^2\}',
                    248:     'sup2'  => '\\ensuremath\{^2\}',
                    249:     179     => '\\ensuremath\{^3\}',
                    250:     'sup3'  => '\\ensuremath\{^3\}',
                    251:     180     => '\\textacute ',
                    252:     'acute' => '\\textacute ',
                    253:     181     => '\\ensuremath\{\\mu\}',
                    254:     'micro' => '\\ensuremath\{\\mu\}',
                    255:     182     => '\\P ',
                    256:     para    => '\\P ',
                    257:     183     => '\\ensuremath\{\\cdot\}',
                    258:     'middot' => '\\ensuremath\{\\cdot\}',
                    259:     184     => '\\c\{\\strut\}',
                    260:     'cedil' => '\\c\{\\strut\}',
                    261:     185     => '\\ensuremath\{^1\}',
                    262:     sup1    => '\\ensuremath\{^1\}',
                    263:     186     => '\\textordmasculine ',
                    264:     'ordm'  => '\\textordmasculine ',
                    265:     187     => '\\ensuremath\{\\gg\}',
                    266:     'raquo' => '\\ensuremath\{\\gg\}',
                    267:     188     => '\\textonequarter ',
                    268:     'frac14' => '\\textonequarter ',
                    269:     189     => '\\textonehalf' ,
                    270:     'frac12' => '\\textonehalf' ,
                    271:     190     => '\\textthreequarters ',
                    272:     'frac34' => '\\textthreequarters ',
                    273:     191     =>  '\\textquestiondown ',
                    274:     'iquest' => '\\textquestiondown ',
                    275:     192     => '\\\`\{A\}',
                    276:     'Agrave' => '\\\`\{A\}',
                    277:     193     => '\\\'\{A\}',
                    278:     'Aacute' => '\\\'\{A\}',
                    279:     194     => '\\^\{A\}',
                    280:     'Acirc' => '\\^\{A\}',
                    281:     195     => '\\~{A}',
                    282:     'Atilde'=> '\\~{A}',
                    283:     196     => '\\\"{A}',
                    284:     'Auml'  => '\\\"{A}',
                    285:     197     => '{\\AA}',
                    286:     'Aring' => '{\\AA}',
                    287:     198     => '{\\AE}',
                    288:     'AElig' => '{\\AE}',
                    289:     199     => '\\c{c}',
                    290:     'Ccedil'=> '\\c{c}',
                    291:     '200'   => '\\\`{E}',
                    292:     'Egrave'=> '\\\`{E}',
                    293:     201     => '\\\'{E}',
                    294:     'Eacute'=> '\\\'{E}',
                    295:     202     => '\\\^{E}',
                    296:     'Ecirc' => '\\\^{E}',
                    297:     203     => '\\\"{E}',
                    298:     'Euml'  => '\\\"{E}',
                    299:     204     => '\\\`{I}',
                    300:     'Igrave'=> '\\\`{I}',
                    301:     205     => '\\\'{I}',
                    302:     'Iacute'=> '\\\'{I}',
                    303:     206     => '\\\^{I}',
                    304:     'Icirc' => '\\\^{I}',
                    305:     207     => '\\\"{I}',
                    306:     'Iuml'  => '\\\"{I}',
                    307:     208     => '\\OE',
                    308:     'ETH'   => '\\OE',
                    309:     209     => '\\~{N}',
                    310:     'Ntilde'=> '\\~{N}',
                    311:     210     => '\\\`{O}',
                    312:     'Ograve'=> '\\\`{O}',
                    313:     211     => '\\\'{O}',
                    314:     'Oacute'=> '\\\'{O}',
                    315:     212     => '\\\^{O}',
                    316:     'Ocirc' => '\\\^{O}',
                    317:     213     => '\\~{O}',
                    318:     'Otilde'=> '\\~{O}',
                    319:     214     => '\\\"{O}',
                    320:     'Ouml'  => '\\\"{O}',
                    321:     215     => '\\ensuremath\{\\times\}',
                    322:     'times' => '\\ensuremath\{\\times\}',
                    323:     216     => '\\O',
                    324:     'Oslash'=> '\\O',
                    325:     217     => '\\\`{U}',
                    326:     'Ugrave'=> '\\\`{U}',
                    327:     218     => '\\\'{U}',
                    328:     'Uacute'=> '\\\'{U}',
                    329:     219     => '\\\^{U}',
                    330:     'Ucirc' => '\\\^{U}',
                    331:     220     => '\\\"{U}',
                    332:     'Uuml'  => '\\\"{U}',
                    333:     221     => '\\\'{Y}',
                    334:     'Yacute'=> '\\\'{Y}',
                    335:     222     => '\\TH',
                    336:     'THORN' => '\\TH',
                    337:     223     => '{\\sz}',
                    338:     'szlig' => '{\\sz}',
                    339:     224     => '\\\`{a}',
                    340:     'agrave'=> '\\\`{a}',
                    341:     225     => '\\\'{a}',
                    342:     'aacute'=> '\\\'{a}',
                    343:     226     => '\\\^{a}',
                    344:     'acirc' => '\\\^{a}',
                    345:     227     => '\\\~{a}',
                    346:     'atilde'=> '\\\~{a}',
                    347:     228     => '\\\"{a}',
                    348:     'auml'  => '\\\"{a}',
                    349:     229     => '\\aa',
                    350:     'aring' => '\\aa',
                    351:     230     => '\\ae',
                    352:     'aelig' => '\\ae',
                    353:     231     => '\\c{c}',
                    354:     'ccedil'=> '\\c{c}',
                    355:     232     => '\\\`{e}',
                    356:     'egrave'=> '\\\`{e}',
                    357:     233     => '\\\'{e}',
                    358:     'eacute'=> '\\\'{e}',
                    359:     234     => '\\\^{e}',
                    360:     'ecirc' => '\\\^{e}',
                    361:     235     => '\\\"{e}',
                    362:     'euml'  => '\\\"{e}',
                    363:     236     => '\\\`{i}',
                    364:     'igrave'=> '\\\`{i}',
                    365:     237     => '\\\'{i}',
                    366:     'iacute'=> '\\\'{i}',
                    367:     238     => '\\\^{i}',
                    368:     'icirc' => '\\\^{i}',
                    369:     239     => '\\\"{i}',
                    370:     'iuml'  => '\\\"{i}',
                    371:     240     => '\\dh',
                    372:     'eth'   => '\\dh',
                    373:     241     => '\\\~{n}',
                    374:     'ntilde'=> '\\\~{n}',
                    375:     242     => '\\\`{o}',
                    376:     'ograve'=> '\\\`{o}',
                    377:     243     => '\\\'{o}',
                    378:     'oacute'=> '\\\'{o}',
                    379:     244     => '\\\^{o}',
                    380:     'ocirc' => '\\\^{o}',
                    381:     245     => '\\\~{o}',
                    382:     'otilde'=> '\\\~{o}',
                    383:     246     => '\\\"{o}',
                    384:     'ouml'  => '\\\"{o}',
                    385:     247     => '\\ensuremath\{\\div\}',
                    386:     'divide'=> '\\ensuremath\{\\div\}',
                    387:     248     => '{\\o}',
                    388:     'oslash'=> '{\\o}',
                    389:     249     => '\\\`{u}',
                    390:     'ugrave'=> '\\\`{u}',
                    391:     250     => '\\\'{u}',
                    392:     'uacute'=> '\\\'{u}',
                    393:     251     => '\\\^{u}',
                    394:     'ucirc' => '\\\^{u}',
                    395:     252     => '\\\"{u}',
                    396:     'uuml'  => '\\\"{u}',
                    397:     253     => '\\\'{y}',
                    398:     'yacute'=> '\\\'{y}',
                    399:     254     => '\\th',
                    400:     'thorn' => '\\th',
                    401:     255     => '\\\"{y}',
                    402:     'yuml'  => '\\\"{y}',
                    403: 
                    404:     # hbar entity number comes from the unicode charater:
                    405:     # see e.g. http://www.unicode.org/charts/PDF/U0100.pdf
                    406:     # ISO also documents a 'planck' entity.
                    407: 
                    408:     295     => '\\ensuremath\{\hbar\}',
                    409:     'plank' => '\\ensuremath\{\hbar\}',
                    410: 
                    411:     # Latin extended-A HTML 4.01 entities:
                    412: 
                    413:     338      => '\\OE',
                    414:     'OElig'  => '\\OE',
                    415:     339      => '\\oe',
                    416:     'oelig'  => '\\oe',
                    417:     352      => '\\v{S}',
                    418:     'Scaron' => '\\v{S}',
                    419:     353      => '\\v{s}',
                    420:     'scaron' => '\\v{s}',
                    421:     376      => '\\\"{Y}',
                    422:     'Yuml'   => '\\\"{Y}', 
                    423: 
                    424: 
                    425:     # Latin extended B HTML 4.01 entities
                    426: 
                    427:     402      => '\\ensuremath{f}',
                    428:     'fnof'   => '\\ensuremath{f}',
                    429: 
                    430:     # Spacing modifier letters:
                    431:     
                    432:     710      => '\^{}',
                    433:     'circ'   => '\^{}',
                    434:     732      => '\~{}',
                    435:     'tilde'  => '\~{}',
                    436: 
                    437:     # Greek uppercase:
                    438: 
                    439:     913      => '\\ensuremath\{\\mathrm\{A\}\}',
                    440:     'Alpha'  => '\\ensuremath\{\\mathrm\{A\}\}',
                    441:     914      => '\\ensuremath\{\\mathrm\{B\}\}',
                    442:     'Beta'   => '\\ensuremath\{\\mathrm\{B\}\}',
                    443:     915      => '\\ensuremath\{\\Gamma\}',
                    444:     'Gamma'  => '\\ensuremath\{\\Gamma\}',
                    445:     916      => '\\ensuremath\{\\Delta\}',
                    446:     'Delta'  => '\\ensuremath\{\\Delta\}',
                    447:     917      => '\\ensuremath\{\\mathrm\{E\}\}',
                    448:     'Epsilon'=> '\\ensuremath\{\\mathrm\{E\}\}',
                    449:     918      => '\\ensuremath\{\\mathrm\{Z\}\}',
                    450:     'Zeta'   => '\\ensuremath\{\\mathrm\{Z\}\}',
                    451:     919      => '\\ensuremath\{\\mathrm\{H\}\}',
                    452:     'Eta'    => '\\ensuremath\{\\mathrm\{H\}\}',
                    453:     920      => '\\ensuremath\{\\Theta\}',
                    454:     'Theta'  => '\\ensuremath\{\\Theta\}',
                    455:     921      => '\\ensuremath\{\\mathrm\{I\}\}',
                    456:     'Iota'   => '\\ensuremath\{\\mathrm\{I\}\}',
                    457:     922      => '\\ensuremath\{\\mathrm\{K\}\}',
                    458:     'Kappa'  => '\\ensuremath\{\\mathrm\{K\}\}',
                    459:     923      => '\\ensuremath\{\\Lambda\}',
                    460:     'Lambda' => '\\ensuremath\{\\Lambda\}',
                    461:     924      => '\\ensuremath\{\\mathrm\{M\}\}',
                    462:     'Mu'     => '\\ensuremath\{\\mathrm\{M\}\}',
                    463:     925      => '\\ensuremath\{\\mathrm\{N\}\}',
                    464:     'Nu'     => '\\ensuremath\{\\mathrm\{N\}\}',
                    465:     926      => '\\ensuremath\{\\mathrm\{\\Xi\}',
                    466:     'Xi'     => '\\ensuremath\{\\mathrm\{\\Xi\}',
                    467:     927      => '\\ensuremath\{\\mathrm\{O\}\}',
                    468:     'Omicron'=> '\\ensuremath\{\\mathrm\{O\}\}',
                    469:     928      => '\\ensuremath\{\\Pi\}',
                    470:     'Pi'     => '\\ensuremath\{\\Pi\}',
                    471:     929      => '\\ensuremath\{\\mathrm\{P\}\}',
                    472:     'Rho'    => '\\ensuremath\{\\mathrm\{P\}\}',
                    473:    
                    474:     # Skips 930
                    475: 
                    476:     931      => '\\ensuremath\{\Sigma\}',
                    477:     'Sigma'  => '\\ensuremath\{\Sigma\}',
                    478:     932      => '\\ensuremath\{\\mathrm\{T\}\}',
                    479:     'Tau'    => '\\ensuremath\{\\mathrm\{T\}\}',
                    480:     933      => '\\ensuremath\{\\Upsilon\}',
                    481:     'Upsilon'=> '\\ensuremath\{\\Upsilon\}',
                    482:     934      => '\\ensuremath\{\\Phi\}',
                    483:     'Phi'    => '\\ensuremath\{\\Phi\}',
                    484:     935      => '\\ensuremath\{\\mathrm\{X\}\}',
                    485:     'Chi'    => '\\ensuremath\{\\mathrm\{X\}\}',
                    486:     936      => '\\ensuremath\{\\Psi\}',
                    487:     'Psi'    => '\\ensuermath\{\\Psi\}',
                    488:     937      => '\\ensuremath\{\\Omega\}',
                    489:     'Omega'  => '\\ensuremath\{\\Omega\}',
                    490: 
                    491: 
                    492:     # Greek lowercase:
                    493: 
                    494:     945      => '\\ensuremath\{\\alpha\}',
                    495:     'alpha'  => '\\ensuremath\{\\alpha\}',
                    496:     946      => '\\ensuremath\{\\beta\}',
                    497:     'beta'   => '\\ensuremath\{\\beta\}',
                    498:     947      => '\\ensuremath\{\\gamma\}',
                    499:     'gamma'  => '\\ensuremath\{\\gamma\}',
                    500:     948      => '\\ensuremath\{\\delta\}',
                    501:     'delta'  => '\\ensuremath\{\\delta\}',
                    502:     949      => '\\ensuremath\{\\epsilon\}',
                    503:     'epsilon'=> '\\ensuremath\{\\epsilon\}',
                    504:     950      => '\\ensuremath\{\\zeta\}',
                    505:     'zeta'   => '\\ensuremath\{\\zeta\}',
                    506:     951      => '\\ensuremath\{\\eta\}',
                    507:     'eta'    => '\\ensuremath\{\\eta\}',
1.2     ! foxr      508:     952      => '\\ensuremath\{\\theta\}',
        !           509:     'theta'  => '\\ensuremath\{\\theta\}',
        !           510:     953      => '\\ensuremath\{\\iota\}',
        !           511:     'iota'   => '\\ensuremath\{\\iota\}',
        !           512:     954      => '\\ensuremath\{\\kappa\}',
        !           513:     'kappa'  => '\\ensuremath\{\\kappa\}',
        !           514:     955      => '\\ensuremath\{\\lambda\}',
        !           515:     'lambda' => '\\ensuremath\{\\lambda\}',
        !           516:     956      => '\\ensuremath\{\\mu\}',
        !           517:     'mu'     => '\\ensuremath\{\\mu\}',
        !           518:     957      => '\\ensuremath\{\\nu\}',
        !           519:     'nu'     => '\\ensuremath\{\\nu\}',
        !           520:     958      => '\\ensuremath\{\\xi\}',
        !           521:     'xi'     => '\\ensuremath\{\\xi\}',
        !           522:     959      => '\\ensuremath\{o\}',
        !           523:     'omicron'=> '\\ensuremath\{o\}',
        !           524:     960      => '\\ensuremath\{\\pi\}',
        !           525:     'pi'     => '\\ensuremath\{\\pi\}',
        !           526:     961      => '\\ensuremath\{\\rho\}',
        !           527:     'rho'    => '\\ensuremath\{\\rho\}',
        !           528:     962      => '\\ensuremath\{\\varsigma\}',
        !           529:     'sigmaf' => '\\ensuremath\{\\varsigma\}',
        !           530:     963      => '\\ensuremath\{\\sigma\}',
        !           531:     'sigma'  => '\\ensuremath\{\\sigma\}',
        !           532:     964      => '\\ensuremath\{\\tau\}',
        !           533:     'tau'    => '\\ensuremath\{\\tau\}',
        !           534:     965      => '\\ensuremath\{\\upsilon\}',
        !           535:     'upsilon'=> '\\ensuremath\{\\upsilon\}',
        !           536:     966      => '\\ensuremath\{\\phi\}',
        !           537:     'phi'    => '\\ensuremath\{\\phi\}',
        !           538:     967      => '\\ensuremath\{\\chi\}',
        !           539:     'chi'    => '\\ensuremath\{\\chi\}',
        !           540:     968      => '\\ensuremath\{\\psi\}',
        !           541:     'psi'    => '\\ensuremath\{\\psi\}',
        !           542:     969      => '\\ensuremath\{\\omega\}',
        !           543:     'omega'  => '\\ensuremath\{\\omega\}',
        !           544:     977      => '\\ensuremath\{\\vartheta\}',
        !           545:     'thetasym'=>'\\ensuremath\{\\vartheta\}',
        !           546:     978      => '\\ensuremath\{\\varUpsilon\}',
        !           547:     'upsih'  => '\\ensuremath\{\\varUpsilon\}',
        !           548:     982      => '\\ensuremath\{\\varpi\}',
        !           549:     'piv'    => '\\ensuremath\{\\varpi\}',
        !           550: 
        !           551:     
        !           552:     # The general punctuation set:
        !           553: 
        !           554:     8194,    => '\\hspace{.5em}',
        !           555:     'enspc'  => '\\hspace{.5em}',
        !           556:     8195     => '\\hspace{1.0em}',
        !           557:     'emspc'  => '\\hspace{1.0em}',
        !           558:     8201     => '\\hspace{0.167em}',
        !           559:     'thinsp' => '\\hspace{0.167em}',
        !           560:     8204     => '\{\}',
        !           561:     'zwnj'   => '\{\}',
        !           562:     8205     => '',
        !           563:     'zwj'    => '',
        !           564:     8206     => '',
        !           565:     'lrm'    => '',
        !           566:     8207     => '',
        !           567:     'rlm'    => '',
        !           568:     8211     => '--',
        !           569:     'ndash'  => '--',
        !           570:     8212     => '---',
        !           571:     'mdash'  => '---',
        !           572:     8216     => '`',
        !           573:     'lsquo'  => '`',
        !           574:     8217     => "'",
        !           575:     'rsquo'  => "'",
        !           576:     8218     => '\\quotesinglebase',
        !           577:     'sbquo'  => '\\quotesinglebase',
        !           578:     8220     => '``',
        !           579:     'ldquo'  => '``',
        !           580:     8221     => "''",
        !           581:     'rdquo'  => "''",
        !           582:     8222     => '\\quotedblbase',
        !           583:     'bdquo'  => '\\quotedblbase',
        !           584:     8224     => '\\dagger',
        !           585:     'dagger' => '\\dagger',
        !           586:     '8225'   => '\\ddag',
        !           587:     'Dagger' => '\\ddag',
        !           588:     8226     => '\\textbullet',
        !           589:     'bull'   => '\\textbullet',
        !           590:     8230     => '\\textellipsis',
        !           591:     'hellep' => '\\textellipsis',
        !           592:     8240     => '\\textperthousand',
        !           593:     permil   => '\\textperthousand',
        !           594:     8242     => '\\textquotesingle',
        !           595:     'prime'  => '\\textquotesingle',
        !           596:     8243     => '\\textquotedbl',
        !           597:     'Prime'  => '\\textquotedbl',
        !           598:     8249     => '\\guilsingleleft',
        !           599:     'lsaquo' => '\\guilsingleleft',
        !           600:     8250     => '\\guilsingleright',
        !           601:     'rsaquo' => '\\guilsingleright',
        !           602:     8254     => '\\textasciimacron',
        !           603:     oline    => '\\textasciimacron',
        !           604:     8260     => '\\textfractionsolidus',
        !           605:     'frasl'  => '\\textfractionsolidus',
        !           606:     8364     => '\\texteuro',
        !           607:     'euro'   => '\\texteuro',
        !           608: 
        !           609:     # Letter like symbols
        !           610: 
        !           611:     
        !           612:     8472     => '\\ensuremath\{\\wp\}',
        !           613:     'weierp' => '\\ensuremath\{\\wp\}',
        !           614:     8465     => '\\ensuremath\{\\Im\}',
        !           615:     'image'  => '\\ensuremath\{\\Im\}',
        !           616:     8476     => '\\ensuremath{\\Re\}',
        !           617:     'real'   => '\\ensuremath{\\Re\}',
        !           618:     8482     => '\\texttrademark',
        !           619:     'trade'  => '\\texttrademark',
        !           620:     8501     => '\\ensuremath{\\aleph\}',
        !           621:     'alefsym'=> '\\ensuremath{\\aleph\}',
        !           622: 
        !           623:     # Arrows and then some (harpoons from Hon Kie).
        !           624: 
        !           625:     8592     => '\\textleftarrow',
        !           626:     'larr'   => '\\textleftarrow',
        !           627:     8593     => '\\textuparrow',
        !           628:     'uarr'   => '\\textuparrow',
        !           629:     8594     => '\\textrightarrow',
        !           630:     'rarr'   => '\\textrightarrow',
        !           631:     8595     => '\\textdownarrow',
        !           632:     'darr'   => '\\textdownarrow',
        !           633:     8596     => '\\ensuremath\{\\leftrightarrow\}',
        !           634:     'harr'   => '\\ensuremath\{\\leftrightarrow\}',
        !           635:     8598     => '\\ensuremath\{\\nwarrow\}',
        !           636:     8599     => '\\ensuremath\{\\nearrow\}',
        !           637:     8600     => '\\ensuremath\{\\searrow\}',
        !           638:     8601     => '\\ensuremath\{\\swarrow\}',
        !           639:     8605     => '\\ensuremath\{\\leadsto\}',
        !           640:     8614     => '\\ensuremath\{\\mapsto\}',
        !           641:     8617     => '\\ensuremath\{\\hookleftarrow\}',
        !           642:     8618     => '\\ensuremath\{\\hookrightarrow\}',
        !           643:     8629     => '\\ensuremath\{\\hookleftarrow\}', # not an exact match but best I know.
        !           644:     'crarr'  => '\\ensuremath\{\\hookleftarrow\}', # not an exact match but best I know.
        !           645:     8636     => '\\ensuremath\{\\leftharpoonup\}',
        !           646:     8637     => '\\ensuremath\{\\leftharpoondown\}',
        !           647:     8640     => '\\ensuremath\{\\rightharpoonup\}',
        !           648:     8641     => '\\ensuremath\{\\rightharpoondown\}',
        !           649:     8652     => '\\ensuremath\{\\rightleftharpoons\}',
        !           650:     8656     => '\\ensuremath\{\\Leftarrow\}',
        !           651:     'lArr'   => '\\ensuremath\{\\Leftarrow\}',
        !           652:     8657     => '\\ensuremath\{\\Uparrow\}',
        !           653:     'uArr'   => '\\ensuremath\{\\Uparrow\}',
        !           654:     8658     => '\\ensuremath\{\\Rightarrow\}',
        !           655:     'rArr'   => '\\ensuremath\{\\Rightarrow\}',
        !           656:     8659     => '\\ensuremath\{\\Downarrow\}',
        !           657:     'dArr'   => '\\ensuremath\{\\Downarrow\}',
        !           658:     8660     => '\\ensuremath\{\\Leftrightarrow\}',
1.1       foxr      659: 
1.2     ! foxr      660:     # Mathematical operators.
        !           661: 	
1.1       foxr      662:     
                    663: };

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