public
Last active

Zotero BibTeX translator with tags as citekeys (updated 23rd Apr 2012)

  • Download Gist
pbnjay_bibtex.js
JavaScript
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431
{
"translatorID": "7b4cd20f-4c4e-4d1c-b622-cfb6e2269a1c",
"translatorType": 3,
"label": "BibTeX-citekey",
"creator": "Simon Kornblith and Richard Karnesky",
"target": "bib",
"minVersion": "2.1.9",
"maxVersion": null,
"priority": 2,
"inRepository": false,
"browserSupport": "gcs",
"displayOptions": {
"exportCharset": "UTF-8",
"exportNotes": true,
"exportFileData": false
},
"lastUpdated": "2012-04-09 23:25:00"
}
 
function detectImport() {
var maxChars = 1048576; // 1MB
var inComment = false;
var block = "";
var buffer = "";
var chr = "";
var charsRead = 0;
var re = /^\s*@[a-zA-Z]+[\(\{]/;
while((buffer = Zotero.read(4096)) && charsRead < maxChars) {
Zotero.debug("Scanning " + buffer.length + " characters for BibTeX");
charsRead += buffer.length;
for (var i=0; i<buffer.length; i++) {
chr = buffer[i];
if (inComment && chr != "\r" && chr != "\n") {
continue;
}
inComment = false;
if(chr == "%") {
// read until next newline
block = "";
inComment = true;
} else if((chr == "\n" || chr == "\r"
// allow one-line entries
|| i == (buffer.length - 1))
&& block) {
// check if this is a BibTeX entry
if(re.test(block)) {
return true;
}
block = "";
} else if(" \n\r\t".indexOf(chr) == -1) {
block += chr;
}
}
}
}
 
//%a = first author surname
//%y = year
//%t = first word of title
var citeKeyFormat = "%a_%t_%y";
 
var fieldMap = {
address:"place",
chapter:"section",
edition:"edition",
type:"type",
series:"series",
title:"title",
volume:"volume",
copyright:"rights",
isbn:"ISBN",
issn:"ISSN",
lccn:"callNumber",
location:"archiveLocation",
shorttitle:"shortTitle",
url:"url",
doi:"DOI",
"abstract":"abstractNote"
};
 
var inputFieldMap = {
booktitle :"publicationTitle",
school:"publisher",
institution:"publisher",
publisher:"publisher",
issue:"issue"
};
 
var zotero2bibtexTypeMap = {
"book":"book",
"bookSection":"incollection",
"journalArticle":"article",
"magazineArticle":"article",
"newspaperArticle":"article",
"thesis":"phdthesis",
"letter":"misc",
"manuscript":"unpublished",
"interview":"misc",
"film":"misc",
"artwork":"misc",
"webpage":"misc",
"conferencePaper":"inproceedings",
"report":"techreport"
};
 
var bibtex2zoteroTypeMap = {
"book":"book", // or booklet, proceedings
"inbook":"bookSection",
"incollection":"bookSection",
"article":"journalArticle", // or magazineArticle or newspaperArticle
"phdthesis":"thesis",
"unpublished":"manuscript",
"inproceedings":"conferencePaper", // check for conference also
"conference":"conferencePaper",
"techreport":"report",
"booklet":"book",
"manual":"book",
"mastersthesis":"thesis",
"misc":"book",
"proceedings":"book"
};
 
/*
* three-letter month abbreviations. i assume these are the same ones that the
* docs say are defined in some appendix of the LaTeX book. (i don't have the
* LaTeX book.)
*/
var months = ["jan", "feb", "mar", "apr", "may", "jun",
"jul", "aug", "sep", "oct", "nov", "dec"];
 
/*
* new mapping table based on that from Matthias Steffens,
* then enhanced with some fields generated from the unicode table.
*/
 
var mappingTable = {
"\u00A0":"~", // NO-BREAK SPACE
"\u00A1":"{\\textexclamdown}", // INVERTED EXCLAMATION MARK
"\u00A2":"{\\textcent}", // CENT SIGN
"\u00A3":"{\\textsterling}", // POUND SIGN
"\u00A5":"{\\textyen}", // YEN SIGN
"\u00A6":"{\\textbrokenbar}", // BROKEN BAR
"\u00A7":"{\\textsection}", // SECTION SIGN
"\u00A8":"{\\textasciidieresis}", // DIAERESIS
"\u00A9":"{\\textcopyright}", // COPYRIGHT SIGN
"\u00AA":"{\\textordfeminine}", // FEMININE ORDINAL INDICATOR
"\u00AB":"{\\guillemotleft}", // LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
"\u00AC":"{\\textlnot}", // NOT SIGN
"\u00AD":"-", // SOFT HYPHEN
"\u00AE":"{\\textregistered}", // REGISTERED SIGN
"\u00AF":"{\\textasciimacron}", // MACRON
"\u00B0":"{\\textdegree}", // DEGREE SIGN
"\u00B1":"{\\textpm}", // PLUS-MINUS SIGN
"\u00B2":"{\\texttwosuperior}", // SUPERSCRIPT TWO
"\u00B3":"{\\textthreesuperior}", // SUPERSCRIPT THREE
"\u00B4":"{\\textasciiacute}", // ACUTE ACCENT
"\u00B5":"{\\textmu}", // MICRO SIGN
"\u00B6":"{\\textparagraph}", // PILCROW SIGN
"\u00B7":"{\\textperiodcentered}", // MIDDLE DOT
"\u00B8":"{\\c\\ }", // CEDILLA
"\u00B9":"{\\textonesuperior}", // SUPERSCRIPT ONE
"\u00BA":"{\\textordmasculine}", // MASCULINE ORDINAL INDICATOR
"\u00BB":"{\\guillemotright}", // RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
"\u00BC":"{\\textonequarter}", // VULGAR FRACTION ONE QUARTER
"\u00BD":"{\\textonehalf}", // VULGAR FRACTION ONE HALF
"\u00BE":"{\\textthreequarters}", // VULGAR FRACTION THREE QUARTERS
"\u00BF":"{\\textquestiondown}", // INVERTED QUESTION MARK
"\u00C6":"{\\AE}", // LATIN CAPITAL LETTER AE
"\u00D0":"{\\DH}", // LATIN CAPITAL LETTER ETH
"\u00D7":"{\\texttimes}", // MULTIPLICATION SIGN
"\u00D8":"{\\O}", // LATIN CAPITAL LETTER O WITH STROKE
"\u00DE":"{\\TH}", // LATIN CAPITAL LETTER THORN
"\u00DF":"{\\ss}", // LATIN SMALL LETTER SHARP S
"\u00E6":"{\\ae}", // LATIN SMALL LETTER AE
"\u00F0":"{\\dh}", // LATIN SMALL LETTER ETH
"\u00F7":"{\\textdiv}", // DIVISION SIGN
"\u00F8":"{\\o}", // LATIN SMALL LETTER O WITH STROKE
"\u00FE":"{\\th}", // LATIN SMALL LETTER THORN
"\u0131":"{\\i}", // LATIN SMALL LETTER DOTLESS I
"\u0132":"IJ", // LATIN CAPITAL LIGATURE IJ
"\u0133":"ij", // LATIN SMALL LIGATURE IJ
"\u0138":"k", // LATIN SMALL LETTER KRA
"\u0149":"'n", // LATIN SMALL LETTER N PRECEDED BY APOSTROPHE
"\u014A":"{\\NG}", // LATIN CAPITAL LETTER ENG
"\u014B":"{\\ng}", // LATIN SMALL LETTER ENG
"\u0152":"{\\OE}", // LATIN CAPITAL LIGATURE OE
"\u0153":"{\\oe}", // LATIN SMALL LIGATURE OE
"\u017F":"s", // LATIN SMALL LETTER LONG S
"\u02B9":"'", // MODIFIER LETTER PRIME
"\u02BB":"'", // MODIFIER LETTER TURNED COMMA
"\u02BC":"'", // MODIFIER LETTER APOSTROPHE
"\u02BD":"'", // MODIFIER LETTER REVERSED COMMA
"\u02C6":"{\\textasciicircum}", // MODIFIER LETTER CIRCUMFLEX ACCENT
"\u02C8":"'", // MODIFIER LETTER VERTICAL LINE
"\u02C9":"-", // MODIFIER LETTER MACRON
"\u02CC":",", // MODIFIER LETTER LOW VERTICAL LINE
"\u02D0":":", // MODIFIER LETTER TRIANGULAR COLON
"\u02DA":"o", // RING ABOVE
"\u02DC":"\\~{}", // SMALL TILDE
"\u02DD":"{\\textacutedbl}", // DOUBLE ACUTE ACCENT
"\u0374":"'", // GREEK NUMERAL SIGN
"\u0375":",", // GREEK LOWER NUMERAL SIGN
"\u037E":";", // GREEK QUESTION MARK
"\u2000":" ", // EN QUAD
"\u2001":" ", // EM QUAD
"\u2002":" ", // EN SPACE
"\u2003":" ", // EM SPACE
"\u2004":" ", // THREE-PER-EM SPACE
"\u2005":" ", // FOUR-PER-EM SPACE
"\u2006":" ", // SIX-PER-EM SPACE
"\u2007":" ", // FIGURE SPACE
"\u2008":" ", // PUNCTUATION SPACE
"\u2009":" ", // THIN SPACE
"\u2010":"-", // HYPHEN
"\u2011":"-", // NON-BREAKING HYPHEN
"\u2012":"-", // FIGURE DASH
"\u2013":"{\\textendash}", // EN DASH
"\u2014":"{\\textemdash}", // EM DASH
"\u2015":"{\\textemdash}", // HORIZONTAL BAR or QUOTATION DASH (not in LaTeX -- use EM DASH)
"\u2016":"{\\textbardbl}", // DOUBLE VERTICAL LINE
"\u2017":"{\\textunderscore}", // DOUBLE LOW LINE
"\u2018":"{\\textquoteleft}", // LEFT SINGLE QUOTATION MARK
"\u2019":"{\\textquoteright}", // RIGHT SINGLE QUOTATION MARK
"`" : "\u2018", // LEFT SINGLE QUOTATION MARK
"'" : "\u2019", // RIGHT SINGLE QUOTATION MARK
"\u201A":"{\\quotesinglbase}", // SINGLE LOW-9 QUOTATION MARK
"\u201B":"'", // SINGLE HIGH-REVERSED-9 QUOTATION MARK
"\u201C":"{\\textquotedblleft}", // LEFT DOUBLE QUOTATION MARK
"\u201D":"{\\textquotedblright}", // RIGHT DOUBLE QUOTATION MARK
"\u201E":"{\\quotedblbase}", // DOUBLE LOW-9 QUOTATION MARK
"\u201F":"{\\quotedblbase}", // DOUBLE HIGH-REVERSED-9 QUOTATION MARK
"\u2020":"{\\textdagger}", // DAGGER
"\u2021":"{\\textdaggerdbl}", // DOUBLE DAGGER
"\u2022":"{\\textbullet}", // BULLET
"\u2023":">", // TRIANGULAR BULLET
"\u2024":".", // ONE DOT LEADER
"\u2025":"..", // TWO DOT LEADER
"\u2026":"{\\textellipsis}", // HORIZONTAL ELLIPSIS
"\u2027":"-", // HYPHENATION POINT
"\u202F":" ", // NARROW NO-BREAK SPACE
"\u2030":"{\\textperthousand}", // PER MILLE SIGN
"\u2032":"'", // PRIME
"\u2033":"'", // DOUBLE PRIME
"\u2034":"'''", // TRIPLE PRIME
"\u2035":"`", // REVERSED PRIME
"\u2036":"``", // REVERSED DOUBLE PRIME
"\u2037":"```", // REVERSED TRIPLE PRIME
"\u2039":"{\\guilsinglleft}", // SINGLE LEFT-POINTING ANGLE QUOTATION MARK
"\u203A":"{\\guilsinglright}", // SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
"\u203C":"!!", // DOUBLE EXCLAMATION MARK
"\u203E":"-", // OVERLINE
"\u2043":"-", // HYPHEN BULLET
"\u2044":"{\\textfractionsolidus}", // FRACTION SLASH
"\u2048":"?!", // QUESTION EXCLAMATION MARK
"\u2049":"!?", // EXCLAMATION QUESTION MARK
"\u204A":"7", // TIRONIAN SIGN ET
"\u2070":"$^{0}$", // SUPERSCRIPT ZERO
"\u2074":"$^{4}$", // SUPERSCRIPT FOUR
"\u2075":"$^{5}$", // SUPERSCRIPT FIVE
"\u2076":"$^{6}$", // SUPERSCRIPT SIX
"\u2077":"$^{7}$", // SUPERSCRIPT SEVEN
"\u2078":"$^{8}$", // SUPERSCRIPT EIGHT
"\u2079":"$^{9}$", // SUPERSCRIPT NINE
"\u207A":"$^{+}$", // SUPERSCRIPT PLUS SIGN
"\u207B":"$^{-}$", // SUPERSCRIPT MINUS
"\u207C":"$^{=}$", // SUPERSCRIPT EQUALS SIGN
"\u207D":"$^{(}$", // SUPERSCRIPT LEFT PARENTHESIS
"\u207E":"$^{)}$", // SUPERSCRIPT RIGHT PARENTHESIS
"\u207F":"$^{n}$", // SUPERSCRIPT LATIN SMALL LETTER N
"\u2080":"$_{0}$", // SUBSCRIPT ZERO
"\u2081":"$_{1}$", // SUBSCRIPT ONE
"\u2082":"$_{2}$", // SUBSCRIPT TWO
"\u2083":"$_{3}$", // SUBSCRIPT THREE
"\u2084":"$_{4}$", // SUBSCRIPT FOUR
"\u2085":"$_{5}$", // SUBSCRIPT FIVE
"\u2086":"$_{6}$", // SUBSCRIPT SIX
"\u2087":"$_{7}$", // SUBSCRIPT SEVEN
"\u2088":"$_{8}$", // SUBSCRIPT EIGHT
"\u2089":"$_{9}$", // SUBSCRIPT NINE
"\u208A":"$_{+}$", // SUBSCRIPT PLUS SIGN
"\u208B":"$_{-}$", // SUBSCRIPT MINUS
"\u208C":"$_{=}$", // SUBSCRIPT EQUALS SIGN
"\u208D":"$_{(}$", // SUBSCRIPT LEFT PARENTHESIS
"\u208E":"$_{)}$", // SUBSCRIPT RIGHT PARENTHESIS
"\u20AC":"{\\texteuro}", // EURO SIGN
"\u2100":"a/c", // ACCOUNT OF
"\u2101":"a/s", // ADDRESSED TO THE SUBJECT
"\u2103":"{\\textcelsius}", // DEGREE CELSIUS
"\u2105":"c/o", // CARE OF
"\u2106":"c/u", // CADA UNA
"\u2109":"F", // DEGREE FAHRENHEIT
"\u2113":"l", // SCRIPT SMALL L
"\u2116":"{\\textnumero}", // NUMERO SIGN
"\u2117":"{\\textcircledP}", // SOUND RECORDING COPYRIGHT
"\u2120":"{\\textservicemark}", // SERVICE MARK
"\u2121":"TEL", // TELEPHONE SIGN
"\u2122":"{\\texttrademark}", // TRADE MARK SIGN
"\u2126":"{\\textohm}", // OHM SIGN
"\u212A":"K", // KELVIN SIGN
"\u212B":"A", // ANGSTROM SIGN
"\u212E":"{\\textestimated}", // ESTIMATED SYMBOL
"\u2153":" 1/3", // VULGAR FRACTION ONE THIRD
"\u2154":" 2/3", // VULGAR FRACTION TWO THIRDS
"\u2155":" 1/5", // VULGAR FRACTION ONE FIFTH
"\u2156":" 2/5", // VULGAR FRACTION TWO FIFTHS
"\u2157":" 3/5", // VULGAR FRACTION THREE FIFTHS
"\u2158":" 4/5", // VULGAR FRACTION FOUR FIFTHS
"\u2159":" 1/6", // VULGAR FRACTION ONE SIXTH
"\u215A":" 5/6", // VULGAR FRACTION FIVE SIXTHS
"\u215B":" 1/8", // VULGAR FRACTION ONE EIGHTH
"\u215C":" 3/8", // VULGAR FRACTION THREE EIGHTHS
"\u215D":" 5/8", // VULGAR FRACTION FIVE EIGHTHS
"\u215E":" 7/8", // VULGAR FRACTION SEVEN EIGHTHS
"\u215F":" 1/", // FRACTION NUMERATOR ONE
"\u2160":"I", // ROMAN NUMERAL ONE
"\u2161":"II", // ROMAN NUMERAL TWO
"\u2162":"III", // ROMAN NUMERAL THREE
"\u2163":"IV", // ROMAN NUMERAL FOUR
"\u2164":"V", // ROMAN NUMERAL FIVE
"\u2165":"VI", // ROMAN NUMERAL SIX
"\u2166":"VII", // ROMAN NUMERAL SEVEN
"\u2167":"VIII", // ROMAN NUMERAL EIGHT
"\u2168":"IX", // ROMAN NUMERAL NINE
"\u2169":"X", // ROMAN NUMERAL TEN
"\u216A":"XI", // ROMAN NUMERAL ELEVEN
"\u216B":"XII", // ROMAN NUMERAL TWELVE
"\u216C":"L", // ROMAN NUMERAL FIFTY
"\u216D":"C", // ROMAN NUMERAL ONE HUNDRED
"\u216E":"D", // ROMAN NUMERAL FIVE HUNDRED
"\u216F":"M", // ROMAN NUMERAL ONE THOUSAND
"\u2170":"i", // SMALL ROMAN NUMERAL ONE
"\u2171":"ii", // SMALL ROMAN NUMERAL TWO
"\u2172":"iii", // SMALL ROMAN NUMERAL THREE
"\u2173":"iv", // SMALL ROMAN NUMERAL FOUR
"\u2174":"v", // SMALL ROMAN NUMERAL FIVE
"\u2175":"vi", // SMALL ROMAN NUMERAL SIX
"\u2176":"vii", // SMALL ROMAN NUMERAL SEVEN
"\u2177":"viii", // SMALL ROMAN NUMERAL EIGHT
"\u2178":"ix", // SMALL ROMAN NUMERAL NINE
"\u2179":"x", // SMALL ROMAN NUMERAL TEN
"\u217A":"xi", // SMALL ROMAN NUMERAL ELEVEN
"\u217B":"xii", // SMALL ROMAN NUMERAL TWELVE
"\u217C":"l", // SMALL ROMAN NUMERAL FIFTY
"\u217D":"c", // SMALL ROMAN NUMERAL ONE HUNDRED
"\u217E":"d", // SMALL ROMAN NUMERAL FIVE HUNDRED
"\u217F":"m", // SMALL ROMAN NUMERAL ONE THOUSAND
"\u2190":"{\\textleftarrow}", // LEFTWARDS ARROW
"\u2191":"{\\textuparrow}", // UPWARDS ARROW
"\u2192":"{\\textrightarrow}", // RIGHTWARDS ARROW
"\u2193":"{\\textdownarrow}", // DOWNWARDS ARROW
"\u2194":"<->", // LEFT RIGHT ARROW
"\u21D0":"<=", // LEFTWARDS DOUBLE ARROW
"\u21D2":"=>", // RIGHTWARDS DOUBLE ARROW
"\u21D4":"<=>", // LEFT RIGHT DOUBLE ARROW
"\u2212":"-", // MINUS SIGN
"\u2215":"/", // DIVISION SLASH
"\u2216":"\\", // SET MINUS
"\u2217":"*", // ASTERISK OPERATOR
"\u2218":"o", // RING OPERATOR
"\u2219":".", // BULLET OPERATOR
"\u221E":"$\\infty$", // INFINITY
"\u2223":"|", // DIVIDES
"\u2225":"||", // PARALLEL TO
"\u2236":":", // RATIO
"\u223C":"\\~{}", // TILDE OPERATOR
"\u2260":"/=", // NOT EQUAL TO
"\u2261":"=", // IDENTICAL TO
"\u2264":"<=", // LESS-THAN OR EQUAL TO
"\u2265":">=", // GREATER-THAN OR EQUAL TO
"\u226A":"<<", // MUCH LESS-THAN
"\u226B":">>", // MUCH GREATER-THAN
"\u2295":"(+)", // CIRCLED PLUS
"\u2296":"(-)", // CIRCLED MINUS
"\u2297":"(x)", // CIRCLED TIMES
"\u2298":"(/)", // CIRCLED DIVISION SLASH
"\u22A2":"|-", // RIGHT TACK
"\u22A3":"-|", // LEFT TACK
"\u22A6":"|-", // ASSERTION
"\u22A7":"|=", // MODELS
"\u22A8":"|=", // TRUE
"\u22A9":"||-", // FORCES
"\u22C5":".", // DOT OPERATOR
"\u22C6":"*", // STAR OPERATOR
"\u22D5":"$\\#$", // EQUAL AND PARALLEL TO
"\u22D8":"<<<", // VERY MUCH LESS-THAN
"\u22D9":">>>", // VERY MUCH GREATER-THAN
"\u2329":"{\\textlangle}", // LEFT-POINTING ANGLE BRACKET
"\u232A":"{\\textrangle}", // RIGHT-POINTING ANGLE BRACKET
"\u2400":"NUL", // SYMBOL FOR NULL
"\u2401":"SOH", // SYMBOL FOR START OF HEADING
"\u2402":"STX", // SYMBOL FOR START OF TEXT
"\u2403":"ETX", // SYMBOL FOR END OF TEXT
"\u2404":"EOT", // SYMBOL FOR END OF TRANSMISSION
"\u2405":"ENQ", // SYMBOL FOR ENQUIRY
"\u2406":"ACK", // SYMBOL FOR ACKNOWLEDGE
"\u2407":"BEL", // SYMBOL FOR BELL
"\u2408":"BS", // SYMBOL FOR BACKSPACE
"\u2409":"HT", // SYMBOL FOR HORIZONTAL TABULATION
"\u240A":"LF", // SYMBOL FOR LINE FEED
"\u240B":"VT", // SYMBOL FOR VERTICAL TABULATION
"\u240C":"FF", // SYMBOL FOR FORM FEED
"\u240D":"CR", // SYMBOL FOR CARRIAGE RETURN
"\u240E":"SO", // SYMBOL FOR SHIFT OUT
"\u240F":"SI", // SYMBOL FOR SHIFT IN
"\u2410":"DLE", // SYMBOL FOR DATA LINK ESCAPE
"\u2411":"DC1", // SYMBOL FOR DEVICE CONTROL ONE
"\u2412":"DC2", // SYMBOL FOR DEVICE CONTROL TWO
"\u2413":"DC3", // SYMBOL FOR DEVICE CONTROL THREE
"\u2414":"DC4", // SYMBOL FOR DEVICE CONTROL FOUR
"\u2415":"NAK", // SYMBOL FOR NEGATIVE ACKNOWLEDGE
"\u2416":"SYN", // SYMBOL FOR SYNCHRONOUS IDLE
"\u2417":"ETB", // SYMBOL FOR END OF TRANSMISSION BLOCK
"\u2418":"CAN", // SYMBOL FOR CANCEL
"\u2419":"EM", // SYMBOL FOR END OF MEDIUM
"\u241A":"SUB", // SYMBOL FOR SUBSTITUTE
"\u241B":"ESC", // SYMBOL FOR ESCAPE
"\u241C":"FS", // SYMBOL FOR FILE SEPARATOR
"\u241D":"GS", // SYMBOL FOR GROUP SEPARATOR
"\u241E":"RS", // SYMBOL FOR RECORD SEPARATOR
"\u241F":"US", // SYMBOL FOR UNIT SEPARATOR
"\u2420":"SP", // SYMBOL FOR SPACE
"\u2421":"DEL", // SYMBOL FOR DELETE
"\u2423":"{\\textvisiblespace}", // OPEN BOX
"\u2424":"NL", // SYMBOL FOR NEWLINE
"\u2425":"///", // SYMBOL FOR DELETE FORM TWO
"\u2426":"?", // SYMBOL FOR SUBSTITUTE FORM TWO
"\u2460":"(1)", // CIRCLED DIGIT ONE
"\u2461":"(2)", // CIRCLED DIGIT TWO
"\u2462":"(3)", // CIRCLED DIGIT THREE
"\u2463":"(4)", // CIRCLED DIGIT FOUR
"\u2464":"(5)", // CIRCLED DIGIT FIVE
"\u2465":"(6)", // CIRCLED DIGIT SIX
"\u2466":"(7)", // CIRCLED DIGIT SEVEN
"\u2467":"(8)", // CIRCLED DIGIT EIGHT
"\u2468":"(9)", // CIRCLED DIGIT NINE
"\u2469":"(10)", // CIRCLED NUMBER TEN
"\u246A":"(11)", // CIRCLED NUMBER ELEVEN
"\u246B":"(12)", // CIRCLED NUMBER TWELVE
"\u246C":"(13)", // CIRCLED NUMBER THIRTEEN
"\u246D":"(14)", // CIRCLED NUMBER FOURTEEN
"\u246E":"(15)", // CIRCLED NUMBER FIFTEEN
"\u246F":"(16)", // CIRCLED NUMBER SIXTEEN
"\u2470":"(17)", // CIRCLED NUMBER SEVENTEEN
"\u2471":"(18)", // CIRCLED NUMBER EIGHTEEN
"\u2472":"(19)", // CIRCLED NUMBER NINETEEN
"\u2473":"(20)", // CIRCLED NUMBER TWENTY
"\u2474":"(1)", // PARENTHESIZED DIGIT ONE
"\u2475":"(2)", // PARENTHESIZED DIGIT TWO
"\u2476":"(3)", // PARENTHESIZED DIGIT THREE
"\u2477":"(4)", // PARENTHESIZED DIGIT FOUR
"\u2478":"(5)", // PARENTHESIZED DIGIT FIVE
"\u2479":"(6)", // PARENTHESIZED DIGIT SIX
"\u247A":"(7)", // PARENTHESIZED DIGIT SEVEN
"\u247B":"(8)", // PARENTHESIZED DIGIT EIGHT
"\u247C":"(9)", // PARENTHESIZED DIGIT NINE
"\u247D":"(10)", // PARENTHESIZED NUMBER TEN
"\u247E":"(11)", // PARENTHESIZED NUMBER ELEVEN
"\u247F":"(12)", // PARENTHESIZED NUMBER TWELVE
"\u2480":"(13)", // PARENTHESIZED NUMBER THIRTEEN
"\u2481":"(14)", // PARENTHESIZED NUMBER FOURTEEN
"\u2482":"(15)", // PARENTHESIZED NUMBER FIFTEEN
"\u2483":"(16)", // PARENTHESIZED NUMBER SIXTEEN
"\u2484":"(17)", // PARENTHESIZED NUMBER SEVENTEEN
"\u2485":"(18)", // PARENTHESIZED NUMBER EIGHTEEN
"\u2486":"(19)", // PARENTHESIZED NUMBER NINETEEN
"\u2487":"(20)", // PARENTHESIZED NUMBER TWENTY
"\u2488":"1.", // DIGIT ONE FULL STOP
"\u2489":"2.", // DIGIT TWO FULL STOP
"\u248A":"3.", // DIGIT THREE FULL STOP
"\u248B":"4.", // DIGIT FOUR FULL STOP
"\u248C":"5.", // DIGIT FIVE FULL STOP
"\u248D":"6.", // DIGIT SIX FULL STOP
"\u248E":"7.", // DIGIT SEVEN FULL STOP
"\u248F":"8.", // DIGIT EIGHT FULL STOP
"\u2490":"9.", // DIGIT NINE FULL STOP
"\u2491":"10.", // NUMBER TEN FULL STOP
"\u2492":"11.", // NUMBER ELEVEN FULL STOP
"\u2493":"12.", // NUMBER TWELVE FULL STOP
"\u2494":"13.", // NUMBER THIRTEEN FULL STOP
"\u2495":"14.", // NUMBER FOURTEEN FULL STOP
"\u2496":"15.", // NUMBER FIFTEEN FULL STOP
"\u2497":"16.", // NUMBER SIXTEEN FULL STOP
"\u2498":"17.", // NUMBER SEVENTEEN FULL STOP
"\u2499":"18.", // NUMBER EIGHTEEN FULL STOP
"\u249A":"19.", // NUMBER NINETEEN FULL STOP
"\u249B":"20.", // NUMBER TWENTY FULL STOP
"\u249C":"(a)", // PARENTHESIZED LATIN SMALL LETTER A
"\u249D":"(b)", // PARENTHESIZED LATIN SMALL LETTER B
"\u249E":"(c)", // PARENTHESIZED LATIN SMALL LETTER C
"\u249F":"(d)", // PARENTHESIZED LATIN SMALL LETTER D
"\u24A0":"(e)", // PARENTHESIZED LATIN SMALL LETTER E
"\u24A1":"(f)", // PARENTHESIZED LATIN SMALL LETTER F
"\u24A2":"(g)", // PARENTHESIZED LATIN SMALL LETTER G
"\u24A3":"(h)", // PARENTHESIZED LATIN SMALL LETTER H
"\u24A4":"(i)", // PARENTHESIZED LATIN SMALL LETTER I
"\u24A5":"(j)", // PARENTHESIZED LATIN SMALL LETTER J
"\u24A6":"(k)", // PARENTHESIZED LATIN SMALL LETTER K
"\u24A7":"(l)", // PARENTHESIZED LATIN SMALL LETTER L
"\u24A8":"(m)", // PARENTHESIZED LATIN SMALL LETTER M
"\u24A9":"(n)", // PARENTHESIZED LATIN SMALL LETTER N
"\u24AA":"(o)", // PARENTHESIZED LATIN SMALL LETTER O
"\u24AB":"(p)", // PARENTHESIZED LATIN SMALL LETTER P
"\u24AC":"(q)", // PARENTHESIZED LATIN SMALL LETTER Q
"\u24AD":"(r)", // PARENTHESIZED LATIN SMALL LETTER R
"\u24AE":"(s)", // PARENTHESIZED LATIN SMALL LETTER S
"\u24AF":"(t)", // PARENTHESIZED LATIN SMALL LETTER T
"\u24B0":"(u)", // PARENTHESIZED LATIN SMALL LETTER U
"\u24B1":"(v)", // PARENTHESIZED LATIN SMALL LETTER V
"\u24B2":"(w)", // PARENTHESIZED LATIN SMALL LETTER W
"\u24B3":"(x)", // PARENTHESIZED LATIN SMALL LETTER X
"\u24B4":"(y)", // PARENTHESIZED LATIN SMALL LETTER Y
"\u24B5":"(z)", // PARENTHESIZED LATIN SMALL LETTER Z
"\u24B6":"(A)", // CIRCLED LATIN CAPITAL LETTER A
"\u24B7":"(B)", // CIRCLED LATIN CAPITAL LETTER B
"\u24B8":"(C)", // CIRCLED LATIN CAPITAL LETTER C
"\u24B9":"(D)", // CIRCLED LATIN CAPITAL LETTER D
"\u24BA":"(E)", // CIRCLED LATIN CAPITAL LETTER E
"\u24BB":"(F)", // CIRCLED LATIN CAPITAL LETTER F
"\u24BC":"(G)", // CIRCLED LATIN CAPITAL LETTER G
"\u24BD":"(H)", // CIRCLED LATIN CAPITAL LETTER H
"\u24BE":"(I)", // CIRCLED LATIN CAPITAL LETTER I
"\u24BF":"(J)", // CIRCLED LATIN CAPITAL LETTER J
"\u24C0":"(K)", // CIRCLED LATIN CAPITAL LETTER K
"\u24C1":"(L)", // CIRCLED LATIN CAPITAL LETTER L
"\u24C2":"(M)", // CIRCLED LATIN CAPITAL LETTER M
"\u24C3":"(N)", // CIRCLED LATIN CAPITAL LETTER N
"\u24C4":"(O)", // CIRCLED LATIN CAPITAL LETTER O
"\u24C5":"(P)", // CIRCLED LATIN CAPITAL LETTER P
"\u24C6":"(Q)", // CIRCLED LATIN CAPITAL LETTER Q
"\u24C7":"(R)", // CIRCLED LATIN CAPITAL LETTER R
"\u24C8":"(S)", // CIRCLED LATIN CAPITAL LETTER S
"\u24C9":"(T)", // CIRCLED LATIN CAPITAL LETTER T
"\u24CA":"(U)", // CIRCLED LATIN CAPITAL LETTER U
"\u24CB":"(V)", // CIRCLED LATIN CAPITAL LETTER V
"\u24CC":"(W)", // CIRCLED LATIN CAPITAL LETTER W
"\u24CD":"(X)", // CIRCLED LATIN CAPITAL LETTER X
"\u24CE":"(Y)", // CIRCLED LATIN CAPITAL LETTER Y
"\u24CF":"(Z)", // CIRCLED LATIN CAPITAL LETTER Z
"\u24D0":"(a)", // CIRCLED LATIN SMALL LETTER A
"\u24D1":"(b)", // CIRCLED LATIN SMALL LETTER B
"\u24D2":"(c)", // CIRCLED LATIN SMALL LETTER C
"\u24D3":"(d)", // CIRCLED LATIN SMALL LETTER D
"\u24D4":"(e)", // CIRCLED LATIN SMALL LETTER E
"\u24D5":"(f)", // CIRCLED LATIN SMALL LETTER F
"\u24D6":"(g)", // CIRCLED LATIN SMALL LETTER G
"\u24D7":"(h)", // CIRCLED LATIN SMALL LETTER H
"\u24D8":"(i)", // CIRCLED LATIN SMALL LETTER I
"\u24D9":"(j)", // CIRCLED LATIN SMALL LETTER J
"\u24DA":"(k)", // CIRCLED LATIN SMALL LETTER K
"\u24DB":"(l)", // CIRCLED LATIN SMALL LETTER L
"\u24DC":"(m)", // CIRCLED LATIN SMALL LETTER M
"\u24DD":"(n)", // CIRCLED LATIN SMALL LETTER N
"\u24DE":"(o)", // CIRCLED LATIN SMALL LETTER O
"\u24DF":"(p)", // CIRCLED LATIN SMALL LETTER P
"\u24E0":"(q)", // CIRCLED LATIN SMALL LETTER Q
"\u24E1":"(r)", // CIRCLED LATIN SMALL LETTER R
"\u24E2":"(s)", // CIRCLED LATIN SMALL LETTER S
"\u24E3":"(t)", // CIRCLED LATIN SMALL LETTER T
"\u24E4":"(u)", // CIRCLED LATIN SMALL LETTER U
"\u24E5":"(v)", // CIRCLED LATIN SMALL LETTER V
"\u24E6":"(w)", // CIRCLED LATIN SMALL LETTER W
"\u24E7":"(x)", // CIRCLED LATIN SMALL LETTER X
"\u24E8":"(y)", // CIRCLED LATIN SMALL LETTER Y
"\u24E9":"(z)", // CIRCLED LATIN SMALL LETTER Z
"\u24EA":"(0)", // CIRCLED DIGIT ZERO
"\u2500":"-", // BOX DRAWINGS LIGHT HORIZONTAL
"\u2501":"=", // BOX DRAWINGS HEAVY HORIZONTAL
"\u2502":"|", // BOX DRAWINGS LIGHT VERTICAL
"\u2503":"|", // BOX DRAWINGS HEAVY VERTICAL
"\u2504":"-", // BOX DRAWINGS LIGHT TRIPLE DASH HORIZONTAL
"\u2505":"=", // BOX DRAWINGS HEAVY TRIPLE DASH HORIZONTAL
"\u2506":"|", // BOX DRAWINGS LIGHT TRIPLE DASH VERTICAL
"\u2507":"|", // BOX DRAWINGS HEAVY TRIPLE DASH VERTICAL
"\u2508":"-", // BOX DRAWINGS LIGHT QUADRUPLE DASH HORIZONTAL
"\u2509":"=", // BOX DRAWINGS HEAVY QUADRUPLE DASH HORIZONTAL
"\u250A":"|", // BOX DRAWINGS LIGHT QUADRUPLE DASH VERTICAL
"\u250B":"|", // BOX DRAWINGS HEAVY QUADRUPLE DASH VERTICAL
"\u250C":"+", // BOX DRAWINGS LIGHT DOWN AND RIGHT
"\u250D":"+", // BOX DRAWINGS DOWN LIGHT AND RIGHT HEAVY
"\u250E":"+", // BOX DRAWINGS DOWN HEAVY AND RIGHT LIGHT
"\u250F":"+", // BOX DRAWINGS HEAVY DOWN AND RIGHT
"\u2510":"+", // BOX DRAWINGS LIGHT DOWN AND LEFT
"\u2511":"+", // BOX DRAWINGS DOWN LIGHT AND LEFT HEAVY
"\u2512":"+", // BOX DRAWINGS DOWN HEAVY AND LEFT LIGHT
"\u2513":"+", // BOX DRAWINGS HEAVY DOWN AND LEFT
"\u2514":"+", // BOX DRAWINGS LIGHT UP AND RIGHT
"\u2515":"+", // BOX DRAWINGS UP LIGHT AND RIGHT HEAVY
"\u2516":"+", // BOX DRAWINGS UP HEAVY AND RIGHT LIGHT
"\u2517":"+", // BOX DRAWINGS HEAVY UP AND RIGHT
"\u2518":"+", // BOX DRAWINGS LIGHT UP AND LEFT
"\u2519":"+", // BOX DRAWINGS UP LIGHT AND LEFT HEAVY
"\u251A":"+", // BOX DRAWINGS UP HEAVY AND LEFT LIGHT
"\u251B":"+", // BOX DRAWINGS HEAVY UP AND LEFT
"\u251C":"+", // BOX DRAWINGS LIGHT VERTICAL AND RIGHT
"\u251D":"+", // BOX DRAWINGS VERTICAL LIGHT AND RIGHT HEAVY
"\u251E":"+", // BOX DRAWINGS UP HEAVY AND RIGHT DOWN LIGHT
"\u251F":"+", // BOX DRAWINGS DOWN HEAVY AND RIGHT UP LIGHT
"\u2520":"+", // BOX DRAWINGS VERTICAL HEAVY AND RIGHT LIGHT
"\u2521":"+", // BOX DRAWINGS DOWN LIGHT AND RIGHT UP HEAVY
"\u2522":"+", // BOX DRAWINGS UP LIGHT AND RIGHT DOWN HEAVY
"\u2523":"+", // BOX DRAWINGS HEAVY VERTICAL AND RIGHT
"\u2524":"+", // BOX DRAWINGS LIGHT VERTICAL AND LEFT
"\u2525":"+", // BOX DRAWINGS VERTICAL LIGHT AND LEFT HEAVY
"\u2526":"+", // BOX DRAWINGS UP HEAVY AND LEFT DOWN LIGHT
"\u2527":"+", // BOX DRAWINGS DOWN HEAVY AND LEFT UP LIGHT
"\u2528":"+", // BOX DRAWINGS VERTICAL HEAVY AND LEFT LIGHT
"\u2529":"+", // BOX DRAWINGS DOWN LIGHT AND LEFT UP HEAVY
"\u252A":"+", // BOX DRAWINGS UP LIGHT AND LEFT DOWN HEAVY
"\u252B":"+", // BOX DRAWINGS HEAVY VERTICAL AND LEFT
"\u252C":"+", // BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
"\u252D":"+", // BOX DRAWINGS LEFT HEAVY AND RIGHT DOWN LIGHT
"\u252E":"+", // BOX DRAWINGS RIGHT HEAVY AND LEFT DOWN LIGHT
"\u252F":"+", // BOX DRAWINGS DOWN LIGHT AND HORIZONTAL HEAVY
"\u2530":"+", // BOX DRAWINGS DOWN HEAVY AND HORIZONTAL LIGHT
"\u2531":"+", // BOX DRAWINGS RIGHT LIGHT AND LEFT DOWN HEAVY
"\u2532":"+", // BOX DRAWINGS LEFT LIGHT AND RIGHT DOWN HEAVY
"\u2533":"+", // BOX DRAWINGS HEAVY DOWN AND HORIZONTAL
"\u2534":"+", // BOX DRAWINGS LIGHT UP AND HORIZONTAL
"\u2535":"+", // BOX DRAWINGS LEFT HEAVY AND RIGHT UP LIGHT
"\u2536":"+", // BOX DRAWINGS RIGHT HEAVY AND LEFT UP LIGHT
"\u2537":"+", // BOX DRAWINGS UP LIGHT AND HORIZONTAL HEAVY
"\u2538":"+", // BOX DRAWINGS UP HEAVY AND HORIZONTAL LIGHT
"\u2539":"+", // BOX DRAWINGS RIGHT LIGHT AND LEFT UP HEAVY
"\u253A":"+", // BOX DRAWINGS LEFT LIGHT AND RIGHT UP HEAVY
"\u253B":"+", // BOX DRAWINGS HEAVY UP AND HORIZONTAL
"\u253C":"+", // BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL
"\u253D":"+", // BOX DRAWINGS LEFT HEAVY AND RIGHT VERTICAL LIGHT
"\u253E":"+", // BOX DRAWINGS RIGHT HEAVY AND LEFT VERTICAL LIGHT
"\u253F":"+", // BOX DRAWINGS VERTICAL LIGHT AND HORIZONTAL HEAVY
"\u2540":"+", // BOX DRAWINGS UP HEAVY AND DOWN HORIZONTAL LIGHT
"\u2541":"+", // BOX DRAWINGS DOWN HEAVY AND UP HORIZONTAL LIGHT
"\u2542":"+", // BOX DRAWINGS VERTICAL HEAVY AND HORIZONTAL LIGHT
"\u2543":"+", // BOX DRAWINGS LEFT UP HEAVY AND RIGHT DOWN LIGHT
"\u2544":"+", // BOX DRAWINGS RIGHT UP HEAVY AND LEFT DOWN LIGHT
"\u2545":"+", // BOX DRAWINGS LEFT DOWN HEAVY AND RIGHT UP LIGHT
"\u2546":"+", // BOX DRAWINGS RIGHT DOWN HEAVY AND LEFT UP LIGHT
"\u2547":"+", // BOX DRAWINGS DOWN LIGHT AND UP HORIZONTAL HEAVY
"\u2548":"+", // BOX DRAWINGS UP LIGHT AND DOWN HORIZONTAL HEAVY
"\u2549":"+", // BOX DRAWINGS RIGHT LIGHT AND LEFT VERTICAL HEAVY
"\u254A":"+", // BOX DRAWINGS LEFT LIGHT AND RIGHT VERTICAL HEAVY
"\u254B":"+", // BOX DRAWINGS HEAVY VERTICAL AND HORIZONTAL
"\u254C":"-", // BOX DRAWINGS LIGHT DOUBLE DASH HORIZONTAL
"\u254D":"=", // BOX DRAWINGS HEAVY DOUBLE DASH HORIZONTAL
"\u254E":"|", // BOX DRAWINGS LIGHT DOUBLE DASH VERTICAL
"\u254F":"|", // BOX DRAWINGS HEAVY DOUBLE DASH VERTICAL
"\u2550":"=", // BOX DRAWINGS DOUBLE HORIZONTAL
"\u2551":"|", // BOX DRAWINGS DOUBLE VERTICAL
"\u2552":"+", // BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE
"\u2553":"+", // BOX DRAWINGS DOWN DOUBLE AND RIGHT SINGLE
"\u2554":"+", // BOX DRAWINGS DOUBLE DOWN AND RIGHT
"\u2555":"+", // BOX DRAWINGS DOWN SINGLE AND LEFT DOUBLE
"\u2556":"+", // BOX DRAWINGS DOWN DOUBLE AND LEFT SINGLE
"\u2557":"+", // BOX DRAWINGS DOUBLE DOWN AND LEFT
"\u2558":"+", // BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE
"\u2559":"+", // BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE
"\u255A":"+", // BOX DRAWINGS DOUBLE UP AND RIGHT
"\u255B":"+", // BOX DRAWINGS UP SINGLE AND LEFT DOUBLE
"\u255C":"+", // BOX DRAWINGS UP DOUBLE AND LEFT SINGLE
"\u255D":"+", // BOX DRAWINGS DOUBLE UP AND LEFT
"\u255E":"+", // BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE
"\u255F":"+", // BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE
"\u2560":"+", // BOX DRAWINGS DOUBLE VERTICAL AND RIGHT
"\u2561":"+", // BOX DRAWINGS VERTICAL SINGLE AND LEFT DOUBLE
"\u2562":"+", // BOX DRAWINGS VERTICAL DOUBLE AND LEFT SINGLE
"\u2563":"+", // BOX DRAWINGS DOUBLE VERTICAL AND LEFT
"\u2564":"+", // BOX DRAWINGS DOWN SINGLE AND HORIZONTAL DOUBLE
"\u2565":"+", // BOX DRAWINGS DOWN DOUBLE AND HORIZONTAL SINGLE
"\u2566":"+", // BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL
"\u2567":"+", // BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE
"\u2568":"+", // BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE
"\u2569":"+", // BOX DRAWINGS DOUBLE UP AND HORIZONTAL
"\u256A":"+", // BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE
"\u256B":"+", // BOX DRAWINGS VERTICAL DOUBLE AND HORIZONTAL SINGLE
"\u256C":"+", // BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL
"\u256D":"+", // BOX DRAWINGS LIGHT ARC DOWN AND RIGHT
"\u256E":"+", // BOX DRAWINGS LIGHT ARC DOWN AND LEFT
"\u256F":"+", // BOX DRAWINGS LIGHT ARC UP AND LEFT
"\u2570":"+", // BOX DRAWINGS LIGHT ARC UP AND RIGHT
"\u2571":"/", // BOX DRAWINGS LIGHT DIAGONAL UPPER RIGHT TO LOWER LEFT
"\u2572":"\\", // BOX DRAWINGS LIGHT DIAGONAL UPPER LEFT TO LOWER RIGHT
"\u2573":"X", // BOX DRAWINGS LIGHT DIAGONAL CROSS
"\u257C":"-", // BOX DRAWINGS LIGHT LEFT AND HEAVY RIGHT
"\u257D":"|", // BOX DRAWINGS LIGHT UP AND HEAVY DOWN
"\u257E":"-", // BOX DRAWINGS HEAVY LEFT AND LIGHT RIGHT
"\u257F":"|", // BOX DRAWINGS HEAVY UP AND LIGHT DOWN
"\u25CB":"o", // WHITE CIRCLE
"\u25E6":"{\\textopenbullet}", // WHITE BULLET
"\u2605":"*", // BLACK STAR
"\u2606":"*", // WHITE STAR
"\u2612":"X", // BALLOT BOX WITH X
"\u2613":"X", // SALTIRE
"\u2639":":-(", // WHITE FROWNING FACE
"\u263A":":-)", // WHITE SMILING FACE
"\u263B":"(-:", // BLACK SMILING FACE
"\u266D":"b", // MUSIC FLAT SIGN
"\u266F":"$\\#$", // MUSIC SHARP SIGN
"\u2701":"$\\%<$", // UPPER BLADE SCISSORS
"\u2702":"$\\%<$", // BLACK SCISSORS
"\u2703":"$\\%<$", // LOWER BLADE SCISSORS
"\u2704":"$\\%<$", // WHITE SCISSORS
"\u270C":"V", // VICTORY HAND
"\u2713":"v", // CHECK MARK
"\u2714":"V", // HEAVY CHECK MARK
"\u2715":"x", // MULTIPLICATION X
"\u2716":"x", // HEAVY MULTIPLICATION X
"\u2717":"X", // BALLOT X
"\u2718":"X", // HEAVY BALLOT X
"\u2719":"+", // OUTLINED GREEK CROSS
"\u271A":"+", // HEAVY GREEK CROSS
"\u271B":"+", // OPEN CENTRE CROSS
"\u271C":"+", // HEAVY OPEN CENTRE CROSS
"\u271D":"+", // LATIN CROSS
"\u271E":"+", // SHADOWED WHITE LATIN CROSS
"\u271F":"+", // OUTLINED LATIN CROSS
"\u2720":"+", // MALTESE CROSS
"\u2721":"*", // STAR OF DAVID
"\u2722":"+", // FOUR TEARDROP-SPOKED ASTERISK
"\u2723":"+", // FOUR BALLOON-SPOKED ASTERISK
"\u2724":"+", // HEAVY FOUR BALLOON-SPOKED ASTERISK
"\u2725":"+", // FOUR CLUB-SPOKED ASTERISK
"\u2726":"+", // BLACK FOUR POINTED STAR
"\u2727":"+", // WHITE FOUR POINTED STAR
"\u2729":"*", // STRESS OUTLINED WHITE STAR
"\u272A":"*", // CIRCLED WHITE STAR
"\u272B":"*", // OPEN CENTRE BLACK STAR
"\u272C":"*", // BLACK CENTRE WHITE STAR
"\u272D":"*", // OUTLINED BLACK STAR
"\u272E":"*", // HEAVY OUTLINED BLACK STAR
"\u272F":"*", // PINWHEEL STAR
"\u2730":"*", // SHADOWED WHITE STAR
"\u2731":"*", // HEAVY ASTERISK
"\u2732":"*", // OPEN CENTRE ASTERISK
"\u2733":"*", // EIGHT SPOKED ASTERISK
"\u2734":"*", // EIGHT POINTED BLACK STAR
"\u2735":"*", // EIGHT POINTED PINWHEEL STAR
"\u2736":"*", // SIX POINTED BLACK STAR
"\u2737":"*", // EIGHT POINTED RECTILINEAR BLACK STAR
"\u2738":"*", // HEAVY EIGHT POINTED RECTILINEAR BLACK STAR
"\u2739":"*", // TWELVE POINTED BLACK STAR
"\u273A":"*", // SIXTEEN POINTED ASTERISK
"\u273B":"*", // TEARDROP-SPOKED ASTERISK
"\u273C":"*", // OPEN CENTRE TEARDROP-SPOKED ASTERISK
"\u273D":"*", // HEAVY TEARDROP-SPOKED ASTERISK
"\u273E":"*", // SIX PETALLED BLACK AND WHITE FLORETTE
"\u273F":"*", // BLACK FLORETTE
"\u2740":"*", // WHITE FLORETTE
"\u2741":"*", // EIGHT PETALLED OUTLINED BLACK FLORETTE
"\u2742":"*", // CIRCLED OPEN CENTRE EIGHT POINTED STAR
"\u2743":"*", // HEAVY TEARDROP-SPOKED PINWHEEL ASTERISK
"\u2744":"*", // SNOWFLAKE
"\u2745":"*", // TIGHT TRIFOLIATE SNOWFLAKE
"\u2746":"*", // HEAVY CHEVRON SNOWFLAKE
"\u2747":"*", // SPARKLE
"\u2748":"*", // HEAVY SPARKLE
"\u2749":"*", // BALLOON-SPOKED ASTERISK
"\u274A":"*", // EIGHT TEARDROP-SPOKED PROPELLER ASTERISK
"\u274B":"*", // HEAVY EIGHT TEARDROP-SPOKED PROPELLER ASTERISK
"\uFB00":"ff", // LATIN SMALL LIGATURE FF
"\uFB01":"fi", // LATIN SMALL LIGATURE FI
"\uFB02":"fl", // LATIN SMALL LIGATURE FL
"\uFB03":"ffi", // LATIN SMALL LIGATURE FFI
"\uFB04":"ffl", // LATIN SMALL LIGATURE FFL
"\uFB05":"st", // LATIN SMALL LIGATURE LONG S T
"\uFB06":"st", // LATIN SMALL LIGATURE ST
/* Derived accented characters */
 
/* These two require the "semtrans" package to work; uncomment to enable */
/* "\u02BF":"\{\\Ayn}", // MGR Ayn
"\u02BE":"\{\\Alif}", // MGR Alif/Hamza
*/
"\u00C0":"\\`{A}", // LATIN CAPITAL LETTER A WITH GRAVE
"\u00C1":"\\'{A}", // LATIN CAPITAL LETTER A WITH ACUTE
"\u00C2":"\\^{A}", // LATIN CAPITAL LETTER A WITH CIRCUMFLEX
"\u00C3":"\\~{A}", // LATIN CAPITAL LETTER A WITH TILDE
"\u00C4":"\\\"{A}", // LATIN CAPITAL LETTER A WITH DIAERESIS
"\u00C5":"\\r{A}", // LATIN CAPITAL LETTER A WITH RING ABOVE
"\u00C7":"\\c{C}", // LATIN CAPITAL LETTER C WITH CEDILLA
"\u00C8":"\\`{E}", // LATIN CAPITAL LETTER E WITH GRAVE
"\u00C9":"\\'{E}", // LATIN CAPITAL LETTER E WITH ACUTE
"\u00CA":"\\^{E}", // LATIN CAPITAL LETTER E WITH CIRCUMFLEX
"\u00CB":"\\\"{E}", // LATIN CAPITAL LETTER E WITH DIAERESIS
"\u00CC":"\\`{I}", // LATIN CAPITAL LETTER I WITH GRAVE
"\u00CD":"\\'{I}", // LATIN CAPITAL LETTER I WITH ACUTE
"\u00CE":"\\^{I}", // LATIN CAPITAL LETTER I WITH CIRCUMFLEX
"\u00CF":"\\\"{I}", // LATIN CAPITAL LETTER I WITH DIAERESIS
"\u00D1":"\\~{N}", // LATIN CAPITAL LETTER N WITH TILDE
"\u00D2":"\\`{O}", // LATIN CAPITAL LETTER O WITH GRAVE
"\u00D3":"\\'{O}", // LATIN CAPITAL LETTER O WITH ACUTE
"\u00D4":"\\^{O}", // LATIN CAPITAL LETTER O WITH CIRCUMFLEX
"\u00D5":"\\~{O}", // LATIN CAPITAL LETTER O WITH TILDE
"\u00D6":"\\\"{O}", // LATIN CAPITAL LETTER O WITH DIAERESIS
"\u00D9":"\\`{U}", // LATIN CAPITAL LETTER U WITH GRAVE
"\u00DA":"\\'{U}", // LATIN CAPITAL LETTER U WITH ACUTE
"\u00DB":"\\^{U}", // LATIN CAPITAL LETTER U WITH CIRCUMFLEX
"\u00DC":"\\\"{U}", // LATIN CAPITAL LETTER U WITH DIAERESIS
"\u00DD":"\\'{Y}", // LATIN CAPITAL LETTER Y WITH ACUTE
"\u00E0":"\\`{a}", // LATIN SMALL LETTER A WITH GRAVE
"\u00E1":"\\'{a}", // LATIN SMALL LETTER A WITH ACUTE
"\u00E2":"\\^{a}", // LATIN SMALL LETTER A WITH CIRCUMFLEX
"\u00E3":"\\~{a}", // LATIN SMALL LETTER A WITH TILDE
"\u00E4":"\\\"{a}", // LATIN SMALL LETTER A WITH DIAERESIS
"\u00E5":"\\r{a}", // LATIN SMALL LETTER A WITH RING ABOVE
"\u00E7":"\\c{c}", // LATIN SMALL LETTER C WITH CEDILLA
"\u00E8":"\\`{e}", // LATIN SMALL LETTER E WITH GRAVE
"\u00E9":"\\'{e}", // LATIN SMALL LETTER E WITH ACUTE
"\u00EA":"\\^{e}", // LATIN SMALL LETTER E WITH CIRCUMFLEX
"\u00EB":"\\\"{e}", // LATIN SMALL LETTER E WITH DIAERESIS
"\u00EC":"\\`{i}", // LATIN SMALL LETTER I WITH GRAVE
"\u00ED":"\\'{i}", // LATIN SMALL LETTER I WITH ACUTE
"\u00EE":"\\^{i}", // LATIN SMALL LETTER I WITH CIRCUMFLEX
"\u00EF":"\\\"{i}", // LATIN SMALL LETTER I WITH DIAERESIS
"\u00F1":"\\~{n}", // LATIN SMALL LETTER N WITH TILDE
"\u00F2":"\\`{o}", // LATIN SMALL LETTER O WITH GRAVE
"\u00F3":"\\'{o}", // LATIN SMALL LETTER O WITH ACUTE
"\u00F4":"\\^{o}", // LATIN SMALL LETTER O WITH CIRCUMFLEX
"\u00F5":"\\~{o}", // LATIN SMALL LETTER O WITH TILDE
"\u00F6":"\\\"{o}", // LATIN SMALL LETTER O WITH DIAERESIS
"\u00F9":"\\`{u}", // LATIN SMALL LETTER U WITH GRAVE
"\u00FA":"\\'{u}", // LATIN SMALL LETTER U WITH ACUTE
"\u00FB":"\\^{u}", // LATIN SMALL LETTER U WITH CIRCUMFLEX
"\u00FC":"\\\"{u}", // LATIN SMALL LETTER U WITH DIAERESIS
"\u00FD":"\\'{y}", // LATIN SMALL LETTER Y WITH ACUTE
"\u00FF":"\\\"{y}", // LATIN SMALL LETTER Y WITH DIAERESIS
"\u0100":"\\={A}", // LATIN CAPITAL LETTER A WITH MACRON
"\u0101":"\\={a}", // LATIN SMALL LETTER A WITH MACRON
"\u0102":"\\u{A}", // LATIN CAPITAL LETTER A WITH BREVE
"\u0103":"\\u{a}", // LATIN SMALL LETTER A WITH BREVE
"\u0104":"\\k{A}", // LATIN CAPITAL LETTER A WITH OGONEK
"\u0105":"\\k{a}", // LATIN SMALL LETTER A WITH OGONEK
"\u0106":"\\'{C}", // LATIN CAPITAL LETTER C WITH ACUTE
"\u0107":"\\'{c}", // LATIN SMALL LETTER C WITH ACUTE
"\u0108":"\\^{C}", // LATIN CAPITAL LETTER C WITH CIRCUMFLEX
"\u0109":"\\^{c}", // LATIN SMALL LETTER C WITH CIRCUMFLEX
"\u010A":"\\.{C}", // LATIN CAPITAL LETTER C WITH DOT ABOVE
"\u010B":"\\.{c}", // LATIN SMALL LETTER C WITH DOT ABOVE
"\u010C":"\\v{C}", // LATIN CAPITAL LETTER C WITH CARON
"\u010D":"\\v{c}", // LATIN SMALL LETTER C WITH CARON
"\u010E":"\\v{D}", // LATIN CAPITAL LETTER D WITH CARON
"\u010F":"\\v{d}", // LATIN SMALL LETTER D WITH CARON
"\u0112":"\\={E}", // LATIN CAPITAL LETTER E WITH MACRON
"\u0113":"\\={e}", // LATIN SMALL LETTER E WITH MACRON
"\u0114":"\\u{E}", // LATIN CAPITAL LETTER E WITH BREVE
"\u0115":"\\u{e}", // LATIN SMALL LETTER E WITH BREVE
"\u0116":"\\.{E}", // LATIN CAPITAL LETTER E WITH DOT ABOVE
"\u0117":"\\.{e}", // LATIN SMALL LETTER E WITH DOT ABOVE
"\u0118":"\\k{E}", // LATIN CAPITAL LETTER E WITH OGONEK
"\u0119":"\\k{e}", // LATIN SMALL LETTER E WITH OGONEK
"\u011A":"\\v{E}", // LATIN CAPITAL LETTER E WITH CARON
"\u011B":"\\v{e}", // LATIN SMALL LETTER E WITH CARON
"\u011C":"\\^{G}", // LATIN CAPITAL LETTER G WITH CIRCUMFLEX
"\u011D":"\\^{g}", // LATIN SMALL LETTER G WITH CIRCUMFLEX
"\u011E":"\\u{G}", // LATIN CAPITAL LETTER G WITH BREVE
"\u011F":"\\u{g}", // LATIN SMALL LETTER G WITH BREVE
"\u0120":"\\.{G}", // LATIN CAPITAL LETTER G WITH DOT ABOVE
"\u0121":"\\.{g}", // LATIN SMALL LETTER G WITH DOT ABOVE
"\u0122":"\\c{G}", // LATIN CAPITAL LETTER G WITH CEDILLA
"\u0123":"\\c{g}", // LATIN SMALL LETTER G WITH CEDILLA
"\u0124":"\\^{H}", // LATIN CAPITAL LETTER H WITH CIRCUMFLEX
"\u0125":"\\^{h}", // LATIN SMALL LETTER H WITH CIRCUMFLEX
"\u0128":"\\~{I}", // LATIN CAPITAL LETTER I WITH TILDE
"\u0129":"\\~{i}", // LATIN SMALL LETTER I WITH TILDE
"\u012A":"\\={I}", // LATIN CAPITAL LETTER I WITH MACRON
"\u012B":"\\={\\i}", // LATIN SMALL LETTER I WITH MACRON
"\u012C":"\\u{I}", // LATIN CAPITAL LETTER I WITH BREVE
"\u012D":"\\u{i}", // LATIN SMALL LETTER I WITH BREVE
"\u012E":"\\k{I}", // LATIN CAPITAL LETTER I WITH OGONEK
"\u012F":"\\k{i}", // LATIN SMALL LETTER I WITH OGONEK
"\u0130":"\\.{I}", // LATIN CAPITAL LETTER I WITH DOT ABOVE
"\u0134":"\\^{J}", // LATIN CAPITAL LETTER J WITH CIRCUMFLEX
"\u0135":"\\^{j}", // LATIN SMALL LETTER J WITH CIRCUMFLEX
"\u0136":"\\c{K}", // LATIN CAPITAL LETTER K WITH CEDILLA
"\u0137":"\\c{k}", // LATIN SMALL LETTER K WITH CEDILLA
"\u0139":"\\'{L}", // LATIN CAPITAL LETTER L WITH ACUTE
"\u013A":"\\'{l}", // LATIN SMALL LETTER L WITH ACUTE
"\u013B":"\\c{L}", // LATIN CAPITAL LETTER L WITH CEDILLA
"\u013C":"\\c{l}", // LATIN SMALL LETTER L WITH CEDILLA
"\u013D":"\\v{L}", // LATIN CAPITAL LETTER L WITH CARON
"\u013E":"\\v{l}", // LATIN SMALL LETTER L WITH CARON
"\u0141":"\\L{}", //LATIN CAPITAL LETTER L WITH STROKE
"\u0142":"\\l{}", //LATIN SMALL LETTER L WITH STROKE
"\u0143":"\\'{N}", // LATIN CAPITAL LETTER N WITH ACUTE
"\u0144":"\\'{n}", // LATIN SMALL LETTER N WITH ACUTE
"\u0145":"\\c{N}", // LATIN CAPITAL LETTER N WITH CEDILLA
"\u0146":"\\c{n}", // LATIN SMALL LETTER N WITH CEDILLA
"\u0147":"\\v{N}", // LATIN CAPITAL LETTER N WITH CARON
"\u0148":"\\v{n}", // LATIN SMALL LETTER N WITH CARON
"\u014C":"\\={O}", // LATIN CAPITAL LETTER O WITH MACRON
"\u014D":"\\={o}", // LATIN SMALL LETTER O WITH MACRON
"\u014E":"\\u{O}", // LATIN CAPITAL LETTER O WITH BREVE
"\u014F":"\\u{o}", // LATIN SMALL LETTER O WITH BREVE
"\u0150":"\\H{O}", // LATIN CAPITAL LETTER O WITH DOUBLE ACUTE
"\u0151":"\\H{o}", // LATIN SMALL LETTER O WITH DOUBLE ACUTE
"\u0154":"\\'{R}", // LATIN CAPITAL LETTER R WITH ACUTE
"\u0155":"\\'{r}", // LATIN SMALL LETTER R WITH ACUTE
"\u0156":"\\c{R}", // LATIN CAPITAL LETTER R WITH CEDILLA
"\u0157":"\\c{r}", // LATIN SMALL LETTER R WITH CEDILLA
"\u0158":"\\v{R}", // LATIN CAPITAL LETTER R WITH CARON
"\u0159":"\\v{r}", // LATIN SMALL LETTER R WITH CARON
"\u015A":"\\'{S}", // LATIN CAPITAL LETTER S WITH ACUTE
"\u015B":"\\'{s}", // LATIN SMALL LETTER S WITH ACUTE
"\u015C":"\\^{S}", // LATIN CAPITAL LETTER S WITH CIRCUMFLEX
"\u015D":"\\^{s}", // LATIN SMALL LETTER S WITH CIRCUMFLEX
"\u015E":"\\c{S}", // LATIN CAPITAL LETTER S WITH CEDILLA
"\u015F":"\\c{s}", // LATIN SMALL LETTER S WITH CEDILLA
"\u0160":"\\v{S}", // LATIN CAPITAL LETTER S WITH CARON
"\u0161":"\\v{s}", // LATIN SMALL LETTER S WITH CARON
"\u0162":"\\c{T}", // LATIN CAPITAL LETTER T WITH CEDILLA
"\u0163":"\\c{t}", // LATIN SMALL LETTER T WITH CEDILLA
"\u0164":"\\v{T}", // LATIN CAPITAL LETTER T WITH CARON
"\u0165":"\\v{t}", // LATIN SMALL LETTER T WITH CARON
"\u0168":"\\~{U}", // LATIN CAPITAL LETTER U WITH TILDE
"\u0169":"\\~{u}", // LATIN SMALL LETTER U WITH TILDE
"\u016A":"\\={U}", // LATIN CAPITAL LETTER U WITH MACRON
"\u016B":"\\={u}", // LATIN SMALL LETTER U WITH MACRON
"\u016C":"\\u{U}", // LATIN CAPITAL LETTER U WITH BREVE
"\u016D":"\\u{u}", // LATIN SMALL LETTER U WITH BREVE
"\u0170":"\\H{U}", // LATIN CAPITAL LETTER U WITH DOUBLE ACUTE
"\u0171":"\\H{u}", // LATIN SMALL LETTER U WITH DOUBLE ACUTE
"\u0172":"\\k{U}", // LATIN CAPITAL LETTER U WITH OGONEK
"\u0173":"\\k{u}", // LATIN SMALL LETTER U WITH OGONEK
"\u0174":"\\^{W}", // LATIN CAPITAL LETTER W WITH CIRCUMFLEX
"\u0175":"\\^{w}", // LATIN SMALL LETTER W WITH CIRCUMFLEX
"\u0176":"\\^{Y}", // LATIN CAPITAL LETTER Y WITH CIRCUMFLEX
"\u0177":"\\^{y}", // LATIN SMALL LETTER Y WITH CIRCUMFLEX
"\u0178":"\\\"{Y}", // LATIN CAPITAL LETTER Y WITH DIAERESIS
"\u0179":"\\'{Z}", // LATIN CAPITAL LETTER Z WITH ACUTE
"\u017A":"\\'{z}", // LATIN SMALL LETTER Z WITH ACUTE
"\u017B":"\\.{Z}", // LATIN CAPITAL LETTER Z WITH DOT ABOVE
"\u017C":"\\.{z}", // LATIN SMALL LETTER Z WITH DOT ABOVE
"\u017D":"\\v{Z}", // LATIN CAPITAL LETTER Z WITH CARON
"\u017E":"\\v{z}", // LATIN SMALL LETTER Z WITH CARON
"\u01CD":"\\v{A}", // LATIN CAPITAL LETTER A WITH CARON
"\u01CE":"\\v{a}", // LATIN SMALL LETTER A WITH CARON
"\u01CF":"\\v{I}", // LATIN CAPITAL LETTER I WITH CARON
"\u01D0":"\\v{i}", // LATIN SMALL LETTER I WITH CARON
"\u01D1":"\\v{O}", // LATIN CAPITAL LETTER O WITH CARON
"\u01D2":"\\v{o}", // LATIN SMALL LETTER O WITH CARON
"\u01D3":"\\v{U}", // LATIN CAPITAL LETTER U WITH CARON
"\u01D4":"\\v{u}", // LATIN SMALL LETTER U WITH CARON
"\u01E6":"\\v{G}", // LATIN CAPITAL LETTER G WITH CARON
"\u01E7":"\\v{g}", // LATIN SMALL LETTER G WITH CARON
"\u01E8":"\\v{K}", // LATIN CAPITAL LETTER K WITH CARON
"\u01E9":"\\v{k}", // LATIN SMALL LETTER K WITH CARON
"\u01EA":"\\k{O}", // LATIN CAPITAL LETTER O WITH OGONEK
"\u01EB":"\\k{o}", // LATIN SMALL LETTER O WITH OGONEK
"\u01F0":"\\v{j}", // LATIN SMALL LETTER J WITH CARON
"\u01F4":"\\'{G}", // LATIN CAPITAL LETTER G WITH ACUTE
"\u01F5":"\\'{g}", // LATIN SMALL LETTER G WITH ACUTE
"\u1E02":"\\.{B}", // LATIN CAPITAL LETTER B WITH DOT ABOVE
"\u1E03":"\\.{b}", // LATIN SMALL LETTER B WITH DOT ABOVE
"\u1E04":"\\d{B}", // LATIN CAPITAL LETTER B WITH DOT BELOW
"\u1E05":"\\d{b}", // LATIN SMALL LETTER B WITH DOT BELOW
"\u1E06":"\\b{B}", // LATIN CAPITAL LETTER B WITH LINE BELOW
"\u1E07":"\\b{b}", // LATIN SMALL LETTER B WITH LINE BELOW
"\u1E0A":"\\.{D}", // LATIN CAPITAL LETTER D WITH DOT ABOVE
"\u1E0B":"\\.{d}", // LATIN SMALL LETTER D WITH DOT ABOVE
"\u1E0C":"\\d{D}", // LATIN CAPITAL LETTER D WITH DOT BELOW
"\u1E0D":"\\d{d}", // LATIN SMALL LETTER D WITH DOT BELOW
"\u1E0E":"\\b{D}", // LATIN CAPITAL LETTER D WITH LINE BELOW
"\u1E0F":"\\b{d}", // LATIN SMALL LETTER D WITH LINE BELOW
"\u1E10":"\\c{D}", // LATIN CAPITAL LETTER D WITH CEDILLA
"\u1E11":"\\c{d}", // LATIN SMALL LETTER D WITH CEDILLA
"\u1E1E":"\\.{F}", // LATIN CAPITAL LETTER F WITH DOT ABOVE
"\u1E1F":"\\.{f}", // LATIN SMALL LETTER F WITH DOT ABOVE
"\u1E20":"\\={G}", // LATIN CAPITAL LETTER G WITH MACRON
"\u1E21":"\\={g}", // LATIN SMALL LETTER G WITH MACRON
"\u1E22":"\\.{H}", // LATIN CAPITAL LETTER H WITH DOT ABOVE
"\u1E23":"\\.{h}", // LATIN SMALL LETTER H WITH DOT ABOVE
"\u1E24":"\\d{H}", // LATIN CAPITAL LETTER H WITH DOT BELOW
"\u1E25":"\\d{h}", // LATIN SMALL LETTER H WITH DOT BELOW
"\u1E26":"\\\"{H}", // LATIN CAPITAL LETTER H WITH DIAERESIS
"\u1E27":"\\\"{h}", // LATIN SMALL LETTER H WITH DIAERESIS
"\u1E28":"\\c{H}", // LATIN CAPITAL LETTER H WITH CEDILLA
"\u1E29":"\\c{h}", // LATIN SMALL LETTER H WITH CEDILLA
"\u1E30":"\\'{K}", // LATIN CAPITAL LETTER K WITH ACUTE
"\u1E31":"\\'{k}", // LATIN SMALL LETTER K WITH ACUTE
"\u1E32":"\\d{K}", // LATIN CAPITAL LETTER K WITH DOT BELOW
"\u1E33":"\\d{k}", // LATIN SMALL LETTER K WITH DOT BELOW
"\u1E34":"\\b{K}", // LATIN CAPITAL LETTER K WITH LINE BELOW
"\u1E35":"\\b{k}", // LATIN SMALL LETTER K WITH LINE BELOW
"\u1E36":"\\d{L}", // LATIN CAPITAL LETTER L WITH DOT BELOW
"\u1E37":"\\d{l}", // LATIN SMALL LETTER L WITH DOT BELOW
"\u1E3A":"\\b{L}", // LATIN CAPITAL LETTER L WITH LINE BELOW
"\u1E3B":"\\b{l}", // LATIN SMALL LETTER L WITH LINE BELOW
"\u1E3E":"\\'{M}", // LATIN CAPITAL LETTER M WITH ACUTE
"\u1E3F":"\\'{m}", // LATIN SMALL LETTER M WITH ACUTE
"\u1E40":"\\.{M}", // LATIN CAPITAL LETTER M WITH DOT ABOVE
"\u1E41":"\\.{m}", // LATIN SMALL LETTER M WITH DOT ABOVE
"\u1E42":"\\d{M}", // LATIN CAPITAL LETTER M WITH DOT BELOW
"\u1E43":"\\d{m}", // LATIN SMALL LETTER M WITH DOT BELOW
"\u1E44":"\\.{N}", // LATIN CAPITAL LETTER N WITH DOT ABOVE
"\u1E45":"\\.{n}", // LATIN SMALL LETTER N WITH DOT ABOVE
"\u1E46":"\\d{N}", // LATIN CAPITAL LETTER N WITH DOT BELOW
"\u1E47":"\\d{n}", // LATIN SMALL LETTER N WITH DOT BELOW
"\u1E48":"\\b{N}", // LATIN CAPITAL LETTER N WITH LINE BELOW
"\u1E49":"\\b{n}", // LATIN SMALL LETTER N WITH LINE BELOW
"\u1E54":"\\'{P}", // LATIN CAPITAL LETTER P WITH ACUTE
"\u1E55":"\\'{p}", // LATIN SMALL LETTER P WITH ACUTE
"\u1E56":"\\.{P}", // LATIN CAPITAL LETTER P WITH DOT ABOVE
"\u1E57":"\\.{p}", // LATIN SMALL LETTER P WITH DOT ABOVE
"\u1E58":"\\.{R}", // LATIN CAPITAL LETTER R WITH DOT ABOVE
"\u1E59":"\\.{r}", // LATIN SMALL LETTER R WITH DOT ABOVE
"\u1E5A":"\\d{R}", // LATIN CAPITAL LETTER R WITH DOT BELOW
"\u1E5B":"\\d{r}", // LATIN SMALL LETTER R WITH DOT BELOW
"\u1E5E":"\\b{R}", // LATIN CAPITAL LETTER R WITH LINE BELOW
"\u1E5F":"\\b{r}", // LATIN SMALL LETTER R WITH LINE BELOW
"\u1E60":"\\.{S}", // LATIN CAPITAL LETTER S WITH DOT ABOVE
"\u1E61":"\\.{s}", // LATIN SMALL LETTER S WITH DOT ABOVE
"\u1E62":"\\d{S}", // LATIN CAPITAL LETTER S WITH DOT BELOW
"\u1E63":"\\d{s}", // LATIN SMALL LETTER S WITH DOT BELOW
"\u1E6A":"\\.{T}", // LATIN CAPITAL LETTER T WITH DOT ABOVE
"\u1E6B":"\\.{t}", // LATIN SMALL LETTER T WITH DOT ABOVE
"\u1E6C":"\\d{T}", // LATIN CAPITAL LETTER T WITH DOT BELOW
"\u1E6D":"\\d{t}", // LATIN SMALL LETTER T WITH DOT BELOW
"\u1E6E":"\\b{T}", // LATIN CAPITAL LETTER T WITH LINE BELOW
"\u1E6F":"\\b{t}", // LATIN SMALL LETTER T WITH LINE BELOW
"\u1E7C":"\\~{V}", // LATIN CAPITAL LETTER V WITH TILDE
"\u1E7D":"\\~{v}", // LATIN SMALL LETTER V WITH TILDE
"\u1E7E":"\\d{V}", // LATIN CAPITAL LETTER V WITH DOT BELOW
"\u1E7F":"\\d{v}", // LATIN SMALL LETTER V WITH DOT BELOW
"\u1E80":"\\`{W}", // LATIN CAPITAL LETTER W WITH GRAVE
"\u1E81":"\\`{w}", // LATIN SMALL LETTER W WITH GRAVE
"\u1E82":"\\'{W}", // LATIN CAPITAL LETTER W WITH ACUTE
"\u1E83":"\\'{w}", // LATIN SMALL LETTER W WITH ACUTE
"\u1E84":"\\\"{W}", // LATIN CAPITAL LETTER W WITH DIAERESIS
"\u1E85":"\\\"{w}", // LATIN SMALL LETTER W WITH DIAERESIS
"\u1E86":"\\.{W}", // LATIN CAPITAL LETTER W WITH DOT ABOVE
"\u1E87":"\\.{w}", // LATIN SMALL LETTER W WITH DOT ABOVE
"\u1E88":"\\d{W}", // LATIN CAPITAL LETTER W WITH DOT BELOW
"\u1E89":"\\d{w}", // LATIN SMALL LETTER W WITH DOT BELOW
"\u1E8A":"\\.{X}", // LATIN CAPITAL LETTER X WITH DOT ABOVE
"\u1E8B":"\\.{x}", // LATIN SMALL LETTER X WITH DOT ABOVE
"\u1E8C":"\\\"{X}", // LATIN CAPITAL LETTER X WITH DIAERESIS
"\u1E8D":"\\\"{x}", // LATIN SMALL LETTER X WITH DIAERESIS
"\u1E8E":"\\.{Y}", // LATIN CAPITAL LETTER Y WITH DOT ABOVE
"\u1E8F":"\\.{y}", // LATIN SMALL LETTER Y WITH DOT ABOVE
"\u1E90":"\\^{Z}", // LATIN CAPITAL LETTER Z WITH CIRCUMFLEX
"\u1E91":"\\^{z}", // LATIN SMALL LETTER Z WITH CIRCUMFLEX
"\u1E92":"\\d{Z}", // LATIN CAPITAL LETTER Z WITH DOT BELOW
"\u1E93":"\\d{z}", // LATIN SMALL LETTER Z WITH DOT BELOW
"\u1E94":"\\b{Z}", // LATIN CAPITAL LETTER Z WITH LINE BELOW
"\u1E95":"\\b{z}", // LATIN SMALL LETTER Z WITH LINE BELOW
"\u1E96":"\\b{h}", // LATIN SMALL LETTER H WITH LINE BELOW
"\u1E97":"\\\"{t}", // LATIN SMALL LETTER T WITH DIAERESIS
"\u1EA0":"\\d{A}", // LATIN CAPITAL LETTER A WITH DOT BELOW
"\u1EA1":"\\d{a}", // LATIN SMALL LETTER A WITH DOT BELOW
"\u1EB8":"\\d{E}", // LATIN CAPITAL LETTER E WITH DOT BELOW
"\u1EB9":"\\d{e}", // LATIN SMALL LETTER E WITH DOT BELOW
"\u1EBC":"\\~{E}", // LATIN CAPITAL LETTER E WITH TILDE
"\u1EBD":"\\~{e}", // LATIN SMALL LETTER E WITH TILDE
"\u1ECA":"\\d{I}", // LATIN CAPITAL LETTER I WITH DOT BELOW
"\u1ECB":"\\d{i}", // LATIN SMALL LETTER I WITH DOT BELOW
"\u1ECC":"\\d{O}", // LATIN CAPITAL LETTER O WITH DOT BELOW
"\u1ECD":"\\d{o}", // LATIN SMALL LETTER O WITH DOT BELOW
"\u1EE4":"\\d{U}", // LATIN CAPITAL LETTER U WITH DOT BELOW
"\u1EE5":"\\d{u}", // LATIN SMALL LETTER U WITH DOT BELOW
"\u1EF2":"\\`{Y}", // LATIN CAPITAL LETTER Y WITH GRAVE
"\u1EF3":"\\`{y}", // LATIN SMALL LETTER Y WITH GRAVE
"\u1EF4":"\\d{Y}", // LATIN CAPITAL LETTER Y WITH DOT BELOW
"\u1EF5":"\\d{y}", // LATIN SMALL LETTER Y WITH DOT BELOW
"\u1EF8":"\\~{Y}", // LATIN CAPITAL LETTER Y WITH TILDE
"\u1EF9":"\\~{y}" // LATIN SMALL LETTER Y WITH TILDE
};
 
/* unfortunately the mapping isn't reversible - hence this second table - sigh! */
var reversemappingTable = {
"\\url" : "", // strip 'url'
"\\href" : "", // strip 'href'
"{\\textexclamdown}" : "\u00A1", // INVERTED EXCLAMATION MARK
"{\\textcent}" : "\u00A2", // CENT SIGN
"{\\textsterling}" : "\u00A3", // POUND SIGN
"{\\textyen}" : "\u00A5", // YEN SIGN
"{\\textbrokenbar}" : "\u00A6", // BROKEN BAR
"{\\textsection}" : "\u00A7", // SECTION SIGN
"{\\textasciidieresis}" : "\u00A8", // DIAERESIS
"{\\textcopyright}" : "\u00A9", // COPYRIGHT SIGN
"{\\textordfeminine}" : "\u00AA", // FEMININE ORDINAL INDICATOR
"{\\guillemotleft}" : "\u00AB", // LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
"{\\textlnot}" : "\u00AC", // NOT SIGN
"{\\textregistered}" : "\u00AE", // REGISTERED SIGN
"{\\textasciimacron}" : "\u00AF", // MACRON
"{\\textdegree}" : "\u00B0", // DEGREE SIGN
"{\\textpm}" : "\u00B1", // PLUS-MINUS SIGN
"{\\texttwosuperior}" : "\u00B2", // SUPERSCRIPT TWO
"{\\textthreesuperior}" : "\u00B3", // SUPERSCRIPT THREE
"{\\textasciiacute}" : "\u00B4", // ACUTE ACCENT
"{\\textmu}" : "\u00B5", // MICRO SIGN
"{\\textparagraph}" : "\u00B6", // PILCROW SIGN
"{\\textperiodcentered}" : "\u00B7", // MIDDLE DOT
"{\\c\\ }" : "\u00B8", // CEDILLA
"{\\textonesuperior}" : "\u00B9", // SUPERSCRIPT ONE
"{\\textordmasculine}" : "\u00BA", // MASCULINE ORDINAL INDICATOR
"{\\guillemotright}" : "\u00BB", // RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
"{\\textonequarter}" : "\u00BC", // VULGAR FRACTION ONE QUARTER
"{\\textonehalf}" : "\u00BD", // VULGAR FRACTION ONE HALF
"{\\textthreequarters}" : "\u00BE", // VULGAR FRACTION THREE QUARTERS
"{\\textquestiondown}" : "\u00BF", // INVERTED QUESTION MARK
"{\\AE}" : "\u00C6", // LATIN CAPITAL LETTER AE
"{\\DH}" : "\u00D0", // LATIN CAPITAL LETTER ETH
"{\\texttimes}" : "\u00D7", // MULTIPLICATION SIGN
"{\\O}" : "\u00D8", // LATIN SMALL LETTER O WITH STROKE
"{\\TH}" : "\u00DE", // LATIN CAPITAL LETTER THORN
"{\\ss}" : "\u00DF", // LATIN SMALL LETTER SHARP S
"{\\ae}" : "\u00E6", // LATIN SMALL LETTER AE
"{\\dh}" : "\u00F0", // LATIN SMALL LETTER ETH
"{\\textdiv}" : "\u00F7", // DIVISION SIGN
"{\\o}" : "\u00F8", // LATIN SMALL LETTER O WITH STROKE
"{\\th}" : "\u00FE", // LATIN SMALL LETTER THORN
"{\\i}" : "\u0131", // LATIN SMALL LETTER DOTLESS I
//"'n" : "\u0149", // LATIN SMALL LETTER N PRECEDED BY APOSTROPHE
"{\\NG}" : "\u014A", // LATIN CAPITAL LETTER ENG
"{\\ng}" : "\u014B", // LATIN SMALL LETTER ENG
"{\\OE}" : "\u0152", // LATIN CAPITAL LIGATURE OE
"{\\oe}" : "\u0153", // LATIN SMALL LIGATURE OE
"{\\textasciicircum}" : "\u02C6", // MODIFIER LETTER CIRCUMFLEX ACCENT
// "\\~{}" : "\u02DC", // SMALL TILDE
"{\\textacutedbl}" : "\u02DD", // DOUBLE ACUTE ACCENT
"{\\textendash}" : "\u2013", // EN DASH
"{\\textemdash}" : "\u2014", // EM DASH
"---" : "\u2014", // EM DASH
"--" : "\u2013", // EN DASH
"{\\textbardbl}" : "\u2016", // DOUBLE VERTICAL LINE
"{\\textunderscore}" : "\u2017", // DOUBLE LOW LINE
"{\\textquoteleft}" : "\u2018", // LEFT SINGLE QUOTATION MARK
"{\\textquoteright}" : "\u2019", // RIGHT SINGLE QUOTATION MARK
"{\\quotesinglbase}" : "\u201A", // SINGLE LOW-9 QUOTATION MARK
"{\\textquotedblleft}" : "\u201C", // LEFT DOUBLE QUOTATION MARK
"{\\textquotedblright}" : "\u201D", // RIGHT DOUBLE QUOTATION MARK
"{\\quotedblbase}" : "\u201E", // DOUBLE LOW-9 QUOTATION MARK
// "{\\quotedblbase}" : "\u201F", // DOUBLE HIGH-REVERSED-9 QUOTATION MARK
"{\\textdagger}" : "\u2020", // DAGGER
"{\\textdaggerdbl}" : "\u2021", // DOUBLE DAGGER
"{\\textbullet}" : "\u2022", // BULLET
"{\\textellipsis}" : "\u2026", // HORIZONTAL ELLIPSIS
"{\\textperthousand}" : "\u2030", // PER MILLE SIGN
"'''" : "\u2034", // TRIPLE PRIME
"''" : "\u201D", // RIGHT DOUBLE QUOTATION MARK (could be a double prime)
"``" : "\u201C", // LEFT DOUBLE QUOTATION MARK (could be a reversed double prime)
"```" : "\u2037", // REVERSED TRIPLE PRIME
"{\\guilsinglleft}" : "\u2039", // SINGLE LEFT-POINTING ANGLE QUOTATION MARK
"{\\guilsinglright}" : "\u203A", // SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
"!!" : "\u203C", // DOUBLE EXCLAMATION MARK
"{\\textfractionsolidus}" : "\u2044", // FRACTION SLASH
"?!" : "\u2048", // QUESTION EXCLAMATION MARK
"!?" : "\u2049", // EXCLAMATION QUESTION MARK
"$^{0}$" : "\u2070", // SUPERSCRIPT ZERO
"$^{4}$" : "\u2074", // SUPERSCRIPT FOUR
"$^{5}$" : "\u2075", // SUPERSCRIPT FIVE
"$^{6}$" : "\u2076", // SUPERSCRIPT SIX
"$^{7}$" : "\u2077", // SUPERSCRIPT SEVEN
"$^{8}$" : "\u2078", // SUPERSCRIPT EIGHT
"$^{9}$" : "\u2079", // SUPERSCRIPT NINE
"$^{+}$" : "\u207A", // SUPERSCRIPT PLUS SIGN
"$^{-}$" : "\u207B", // SUPERSCRIPT MINUS
"$^{=}$" : "\u207C", // SUPERSCRIPT EQUALS SIGN
"$^{(}$" : "\u207D", // SUPERSCRIPT LEFT PARENTHESIS
"$^{)}$" : "\u207E", // SUPERSCRIPT RIGHT PARENTHESIS
"$^{n}$" : "\u207F", // SUPERSCRIPT LATIN SMALL LETTER N
"$_{0}$" : "\u2080", // SUBSCRIPT ZERO
"$_{1}$" : "\u2081", // SUBSCRIPT ONE
"$_{2}$" : "\u2082", // SUBSCRIPT TWO
"$_{3}$" : "\u2083", // SUBSCRIPT THREE
"$_{4}$" : "\u2084", // SUBSCRIPT FOUR
"$_{5}$" : "\u2085", // SUBSCRIPT FIVE
"$_{6}$" : "\u2086", // SUBSCRIPT SIX
"$_{7}$" : "\u2087", // SUBSCRIPT SEVEN
"$_{8}$" : "\u2088", // SUBSCRIPT EIGHT
"$_{9}$" : "\u2089", // SUBSCRIPT NINE
"$_{+}$" : "\u208A", // SUBSCRIPT PLUS SIGN
"$_{-}$" : "\u208B", // SUBSCRIPT MINUS
"$_{=}$" : "\u208C", // SUBSCRIPT EQUALS SIGN
"$_{(}$" : "\u208D", // SUBSCRIPT LEFT PARENTHESIS
"$_{)}$" : "\u208E", // SUBSCRIPT RIGHT PARENTHESIS
"{\\texteuro}" : "\u20AC", // EURO SIGN
//"a/c" : "\u2100", // ACCOUNT OF
//"a/s" : "\u2101", // ADDRESSED TO THE SUBJECT
"{\\textcelsius}" : "\u2103", // DEGREE CELSIUS
//"c/o" : "\u2105", // CARE OF
//"c/u" : "\u2106", // CADA UNA
"{\\textnumero}" : "\u2116", // NUMERO SIGN
"{\\textcircledP}" : "\u2117", // SOUND RECORDING COPYRIGHT
"{\\textservicemark}" : "\u2120", // SERVICE MARK
"{TEL}" : "\u2121", // TELEPHONE SIGN
"{\\texttrademark}" : "\u2122", // TRADE MARK SIGN
"{\\textohm}" : "\u2126", // OHM SIGN
"{\\textestimated}" : "\u212E", // ESTIMATED SYMBOL
/*" 1/3" : "\u2153", // VULGAR FRACTION ONE THIRD
" 2/3" : "\u2154", // VULGAR FRACTION TWO THIRDS
" 1/5" : "\u2155", // VULGAR FRACTION ONE FIFTH
" 2/5" : "\u2156", // VULGAR FRACTION TWO FIFTHS
" 3/5" : "\u2157", // VULGAR FRACTION THREE FIFTHS
" 4/5" : "\u2158", // VULGAR FRACTION FOUR FIFTHS
" 1/6" : "\u2159", // VULGAR FRACTION ONE SIXTH
" 5/6" : "\u215A", // VULGAR FRACTION FIVE SIXTHS
" 1/8" : "\u215B", // VULGAR FRACTION ONE EIGHTH
" 3/8" : "\u215C", // VULGAR FRACTION THREE EIGHTHS
" 5/8" : "\u215D", // VULGAR FRACTION FIVE EIGHTHS
" 7/8" : "\u215E", // VULGAR FRACTION SEVEN EIGHTHS
" 1/" : "\u215F", // FRACTION NUMERATOR ONE */
"{\\textleftarrow}" : "\u2190", // LEFTWARDS ARROW
"{\\textuparrow}" : "\u2191", // UPWARDS ARROW
"{\\textrightarrow}" : "\u2192", // RIGHTWARDS ARROW
"{\\textdownarrow}" : "\u2193", // DOWNWARDS ARROW
/*"<->" : "\u2194", // LEFT RIGHT ARROW
"<=" : "\u21D0", // LEFTWARDS DOUBLE ARROW
"=>" : "\u21D2", // RIGHTWARDS DOUBLE ARROW
"<=>" : "\u21D4", // LEFT RIGHT DOUBLE ARROW */
"$\\infty$" : "\u221E", // INFINITY
/*"||" : "\u2225", // PARALLEL TO
"/=" : "\u2260", // NOT EQUAL TO
"<=" : "\u2264", // LESS-THAN OR EQUAL TO
">=" : "\u2265", // GREATER-THAN OR EQUAL TO
"<<" : "\u226A", // MUCH LESS-THAN
">>" : "\u226B", // MUCH GREATER-THAN
"(+)" : "\u2295", // CIRCLED PLUS
"(-)" : "\u2296", // CIRCLED MINUS
"(x)" : "\u2297", // CIRCLED TIMES
"(/)" : "\u2298", // CIRCLED DIVISION SLASH
"|-" : "\u22A2", // RIGHT TACK
"-|" : "\u22A3", // LEFT TACK
"|-" : "\u22A6", // ASSERTION
"|=" : "\u22A7", // MODELS
"|=" : "\u22A8", // TRUE
"||-" : "\u22A9", // FORCES */
"$\\#$" : "\u22D5", // EQUAL AND PARALLEL TO
//"<<<" : "\u22D8", // VERY MUCH LESS-THAN
//">>>" : "\u22D9", // VERY MUCH GREATER-THAN
"{\\textlangle}" : "\u2329", // LEFT-POINTING ANGLE BRACKET
"{\\textrangle}" : "\u232A", // RIGHT-POINTING ANGLE BRACKET
"{\\textvisiblespace}" : "\u2423", // OPEN BOX
//"///" : "\u2425", // SYMBOL FOR DELETE FORM TWO
"{\\textopenbullet}" : "\u25E6", // WHITE BULLET
//":-(" : "\u2639", // WHITE FROWNING FACE
//":-)" : "\u263A", // WHITE SMILING FACE
//"(-: " : "\u263B", // BLACK SMILING FACE
// "$\\#$" : "\u266F", // MUSIC SHARP SIGN
"$\\%<$" : "\u2701", // UPPER BLADE SCISSORS
/* "$\\%<$" : "\u2702", // BLACK SCISSORS
"$\\%<$" : "\u2703", // LOWER BLADE SCISSORS
"$\\%<$" : "\u2704", // WHITE SCISSORS */
/* Derived accented characters */
"\\`{A}" : "\u00C0", // LATIN CAPITAL LETTER A WITH GRAVE
"\\'{A}" : "\u00C1", // LATIN CAPITAL LETTER A WITH ACUTE
"\\^{A}" : "\u00C2", // LATIN CAPITAL LETTER A WITH CIRCUMFLEX
"\\~{A}" : "\u00C3", // LATIN CAPITAL LETTER A WITH TILDE
"\\\"{A}" : "\u00C4", // LATIN CAPITAL LETTER A WITH DIAERESIS
"\\r{A}" : "\u00C5", // LATIN CAPITAL LETTER A WITH RING ABOVE
"\\c{C}" : "\u00C7", // LATIN CAPITAL LETTER C WITH CEDILLA
"\\`{E}" : "\u00C8", // LATIN CAPITAL LETTER E WITH GRAVE
"\\'{E}" : "\u00C9", // LATIN CAPITAL LETTER E WITH ACUTE
"\\^{E}" : "\u00CA", // LATIN CAPITAL LETTER E WITH CIRCUMFLEX
"\\\"{E}" : "\u00CB", // LATIN CAPITAL LETTER E WITH DIAERESIS
"\\`{I}" : "\u00CC", // LATIN CAPITAL LETTER I WITH GRAVE
"\\'{I}" : "\u00CD", // LATIN CAPITAL LETTER I WITH ACUTE
"\\^{I}" : "\u00CE", // LATIN CAPITAL LETTER I WITH CIRCUMFLEX
"\\\"{I}" : "\u00CF", // LATIN CAPITAL LETTER I WITH DIAERESIS
"\\~{N}" : "\u00D1", // LATIN CAPITAL LETTER N WITH TILDE
"\\`{O}" : "\u00D2", // LATIN CAPITAL LETTER O WITH GRAVE
"\\'{O}" : "\u00D3", // LATIN CAPITAL LETTER O WITH ACUTE
"\\^{O}" : "\u00D4", // LATIN CAPITAL LETTER O WITH CIRCUMFLEX
"\\~{O}" : "\u00D5", // LATIN CAPITAL LETTER O WITH TILDE
"\\\"{O}" : "\u00D6", // LATIN CAPITAL LETTER O WITH DIAERESIS
"\\`{U}" : "\u00D9", // LATIN CAPITAL LETTER U WITH GRAVE
"\\'{U}" : "\u00DA", // LATIN CAPITAL LETTER U WITH ACUTE
"\\^{U}" : "\u00DB", // LATIN CAPITAL LETTER U WITH CIRCUMFLEX
"\\\"{U}" : "\u00DC", // LATIN CAPITAL LETTER U WITH DIAERESIS
"\\'{Y}" : "\u00DD", // LATIN CAPITAL LETTER Y WITH ACUTE
"\\`{a}" : "\u00E0", // LATIN SMALL LETTER A WITH GRAVE
"\\'{a}" : "\u00E1", // LATIN SMALL LETTER A WITH ACUTE
"\\^{a}" : "\u00E2", // LATIN SMALL LETTER A WITH CIRCUMFLEX
"\\~{a}" : "\u00E3", // LATIN SMALL LETTER A WITH TILDE
"\\\"{a}" : "\u00E4", // LATIN SMALL LETTER A WITH DIAERESIS
"\\r{a}" : "\u00E5", // LATIN SMALL LETTER A WITH RING ABOVE
"\\c{c}" : "\u00E7", // LATIN SMALL LETTER C WITH CEDILLA
"\\`{e}" : "\u00E8", // LATIN SMALL LETTER E WITH GRAVE
"\\'{e}" : "\u00E9", // LATIN SMALL LETTER E WITH ACUTE
"\\^{e}" : "\u00EA", // LATIN SMALL LETTER E WITH CIRCUMFLEX
"\\\"{e}" : "\u00EB", // LATIN SMALL LETTER E WITH DIAERESIS
"\\`{i}" : "\u00EC", // LATIN SMALL LETTER I WITH GRAVE
"\\'{i}" : "\u00ED", // LATIN SMALL LETTER I WITH ACUTE
"\\^{i}" : "\u00EE", // LATIN SMALL LETTER I WITH CIRCUMFLEX
"\\\"{i}" : "\u00EF", // LATIN SMALL LETTER I WITH DIAERESIS
"\\~{n}" : "\u00F1", // LATIN SMALL LETTER N WITH TILDE
"\\`{o}" : "\u00F2", // LATIN SMALL LETTER O WITH GRAVE
"\\'{o}" : "\u00F3", // LATIN SMALL LETTER O WITH ACUTE
"\\^{o}" : "\u00F4", // LATIN SMALL LETTER O WITH CIRCUMFLEX
"\\~{o}" : "\u00F5", // LATIN SMALL LETTER O WITH TILDE
"\\\"{o}" : "\u00F6", // LATIN SMALL LETTER O WITH DIAERESIS
"\\`{u}" : "\u00F9", // LATIN SMALL LETTER U WITH GRAVE
"\\'{u}" : "\u00FA", // LATIN SMALL LETTER U WITH ACUTE
"\\^{u}" : "\u00FB", // LATIN SMALL LETTER U WITH CIRCUMFLEX
"\\\"{u}" : "\u00FC", // LATIN SMALL LETTER U WITH DIAERESIS
"\\'{y}" : "\u00FD", // LATIN SMALL LETTER Y WITH ACUTE
"\\\"{y}" : "\u00FF", // LATIN SMALL LETTER Y WITH DIAERESIS
"\\={A}" : "\u0100", // LATIN CAPITAL LETTER A WITH MACRON
"\\={a}" : "\u0101", // LATIN SMALL LETTER A WITH MACRON
"\\u{A}" : "\u0102", // LATIN CAPITAL LETTER A WITH BREVE
"\\u{a}" : "\u0103", // LATIN SMALL LETTER A WITH BREVE
"\\k{A}" : "\u0104", // LATIN CAPITAL LETTER A WITH OGONEK
"\\k{a}" : "\u0105", // LATIN SMALL LETTER A WITH OGONEK
"\\'{C}" : "\u0106", // LATIN CAPITAL LETTER C WITH ACUTE
"\\'{c}" : "\u0107", // LATIN SMALL LETTER C WITH ACUTE
"\\^{C}" : "\u0108", // LATIN CAPITAL LETTER C WITH CIRCUMFLEX
"\\^{c}" : "\u0109", // LATIN SMALL LETTER C WITH CIRCUMFLEX
"\\.{C}" : "\u010A", // LATIN CAPITAL LETTER C WITH DOT ABOVE
"\\.{c}" : "\u010B", // LATIN SMALL LETTER C WITH DOT ABOVE
"\\v{C}" : "\u010C", // LATIN CAPITAL LETTER C WITH CARON
"\\v{c}" : "\u010D", // LATIN SMALL LETTER C WITH CARON
"\\v{D}" : "\u010E", // LATIN CAPITAL LETTER D WITH CARON
"\\v{d}" : "\u010F", // LATIN SMALL LETTER D WITH CARON
"\\={E}" : "\u0112", // LATIN CAPITAL LETTER E WITH MACRON
"\\={e}" : "\u0113", // LATIN SMALL LETTER E WITH MACRON
"\\u{E}" : "\u0114", // LATIN CAPITAL LETTER E WITH BREVE
"\\u{e}" : "\u0115", // LATIN SMALL LETTER E WITH BREVE
"\\.{E}" : "\u0116", // LATIN CAPITAL LETTER E WITH DOT ABOVE
"\\.{e}" : "\u0117", // LATIN SMALL LETTER E WITH DOT ABOVE
"\\k{E}" : "\u0118", // LATIN CAPITAL LETTER E WITH OGONEK
"\\k{e}" : "\u0119", // LATIN SMALL LETTER E WITH OGONEK
"\\v{E}" : "\u011A", // LATIN CAPITAL LETTER E WITH CARON
"\\v{e}" : "\u011B", // LATIN SMALL LETTER E WITH CARON
"\\^{G}" : "\u011C", // LATIN CAPITAL LETTER G WITH CIRCUMFLEX
"\\^{g}" : "\u011D", // LATIN SMALL LETTER G WITH CIRCUMFLEX
"\\u{G}" : "\u011E", // LATIN CAPITAL LETTER G WITH BREVE
"\\u{g}" : "\u011F", // LATIN SMALL LETTER G WITH BREVE
"\\.{G}" : "\u0120", // LATIN CAPITAL LETTER G WITH DOT ABOVE
"\\.{g}" : "\u0121", // LATIN SMALL LETTER G WITH DOT ABOVE
"\\c{G}" : "\u0122", // LATIN CAPITAL LETTER G WITH CEDILLA
"\\c{g}" : "\u0123", // LATIN SMALL LETTER G WITH CEDILLA
"\\^{H}" : "\u0124", // LATIN CAPITAL LETTER H WITH CIRCUMFLEX
"\\^{h}" : "\u0125", // LATIN SMALL LETTER H WITH CIRCUMFLEX
"\\~{I}" : "\u0128", // LATIN CAPITAL LETTER I WITH TILDE
"\\~{i}" : "\u0129", // LATIN SMALL LETTER I WITH TILDE
"\\={I}" : "\u012A", // LATIN CAPITAL LETTER I WITH MACRON
"\\={i}" : "\u012B", // LATIN SMALL LETTER I WITH MACRON
"\\={\\i}" : "\u012B", // LATIN SMALL LETTER I WITH MACRON
"\\u{I}" : "\u012C", // LATIN CAPITAL LETTER I WITH BREVE
"\\u{i}" : "\u012D", // LATIN SMALL LETTER I WITH BREVE
"\\k{I}" : "\u012E", // LATIN CAPITAL LETTER I WITH OGONEK
"\\k{i}" : "\u012F", // LATIN SMALL LETTER I WITH OGONEK
"\\.{I}" : "\u0130", // LATIN CAPITAL LETTER I WITH DOT ABOVE
"\\^{J}" : "\u0134", // LATIN CAPITAL LETTER J WITH CIRCUMFLEX
"\\^{j}" : "\u0135", // LATIN SMALL LETTER J WITH CIRCUMFLEX
"\\c{K}" : "\u0136", // LATIN CAPITAL LETTER K WITH CEDILLA
"\\c{k}" : "\u0137", // LATIN SMALL LETTER K WITH CEDILLA
"\\'{L}" : "\u0139", // LATIN CAPITAL LETTER L WITH ACUTE
"\\'{l}" : "\u013A", // LATIN SMALL LETTER L WITH ACUTE
"\\c{L}" : "\u013B", // LATIN CAPITAL LETTER L WITH CEDILLA
"\\c{l}" : "\u013C", // LATIN SMALL LETTER L WITH CEDILLA
"\\v{L}" : "\u013D", // LATIN CAPITAL LETTER L WITH CARON
"\\v{l}" : "\u013E", // LATIN SMALL LETTER L WITH CARON
"\\L{}" : "\u0141", //LATIN CAPITAL LETTER L WITH STROKE
"\\l{}" : "\u0142", //LATIN SMALL LETTER L WITH STROKE
"\\'{N}" : "\u0143", // LATIN CAPITAL LETTER N WITH ACUTE
"\\'{n}" : "\u0144", // LATIN SMALL LETTER N WITH ACUTE
"\\c{N}" : "\u0145", // LATIN CAPITAL LETTER N WITH CEDILLA
"\\c{n}" : "\u0146", // LATIN SMALL LETTER N WITH CEDILLA
"\\v{N}" : "\u0147", // LATIN CAPITAL LETTER N WITH CARON
"\\v{n}" : "\u0148", // LATIN SMALL LETTER N WITH CARON
"\\={O}" : "\u014C", // LATIN CAPITAL LETTER O WITH MACRON
"\\={o}" : "\u014D", // LATIN SMALL LETTER O WITH MACRON
"\\u{O}" : "\u014E", // LATIN CAPITAL LETTER O WITH BREVE
"\\u{o}" : "\u014F", // LATIN SMALL LETTER O WITH BREVE
"\\H{O}" : "\u0150", // LATIN CAPITAL LETTER O WITH DOUBLE ACUTE
"\\H{o}" : "\u0151", // LATIN SMALL LETTER O WITH DOUBLE ACUTE
"\\'{R}" : "\u0154", // LATIN CAPITAL LETTER R WITH ACUTE
"\\'{r}" : "\u0155", // LATIN SMALL LETTER R WITH ACUTE
"\\c{R}" : "\u0156", // LATIN CAPITAL LETTER R WITH CEDILLA
"\\c{r}" : "\u0157", // LATIN SMALL LETTER R WITH CEDILLA
"\\v{R}" : "\u0158", // LATIN CAPITAL LETTER R WITH CARON
"\\v{r}" : "\u0159", // LATIN SMALL LETTER R WITH CARON
"\\'{S}" : "\u015A", // LATIN CAPITAL LETTER S WITH ACUTE
"\\'{s}" : "\u015B", // LATIN SMALL LETTER S WITH ACUTE
"\\^{S}" : "\u015C", // LATIN CAPITAL LETTER S WITH CIRCUMFLEX
"\\^{s}" : "\u015D", // LATIN SMALL LETTER S WITH CIRCUMFLEX
"\\c{S}" : "\u015E", // LATIN CAPITAL LETTER S WITH CEDILLA
"\\c{s}" : "\u015F", // LATIN SMALL LETTER S WITH CEDILLA
"\\v{S}" : "\u0160", // LATIN CAPITAL LETTER S WITH CARON
"\\v{s}" : "\u0161", // LATIN SMALL LETTER S WITH CARON
"\\c{T}" : "\u0162", // LATIN CAPITAL LETTER T WITH CEDILLA
"\\c{t}" : "\u0163", // LATIN SMALL LETTER T WITH CEDILLA
"\\v{T}" : "\u0164", // LATIN CAPITAL LETTER T WITH CARON
"\\v{t}" : "\u0165", // LATIN SMALL LETTER T WITH CARON
"\\~{U}" : "\u0168", // LATIN CAPITAL LETTER U WITH TILDE
"\\~{u}" : "\u0169", // LATIN SMALL LETTER U WITH TILDE
"\\={U}" : "\u016A", // LATIN CAPITAL LETTER U WITH MACRON
"\\={u}" : "\u016B", // LATIN SMALL LETTER U WITH MACRON
"\\u{U}" : "\u016C", // LATIN CAPITAL LETTER U WITH BREVE
"\\u{u}" : "\u016D", // LATIN SMALL LETTER U WITH BREVE
"\\H{U}" : "\u0170", // LATIN CAPITAL LETTER U WITH DOUBLE ACUTE
"\\H{u}" : "\u0171", // LATIN SMALL LETTER U WITH DOUBLE ACUTE
"\\k{U}" : "\u0172", // LATIN CAPITAL LETTER U WITH OGONEK
"\\k{u}" : "\u0173", // LATIN SMALL LETTER U WITH OGONEK
"\\^{W}" : "\u0174", // LATIN CAPITAL LETTER W WITH CIRCUMFLEX
"\\^{w}" : "\u0175", // LATIN SMALL LETTER W WITH CIRCUMFLEX
"\\^{Y}" : "\u0176", // LATIN CAPITAL LETTER Y WITH CIRCUMFLEX
"\\^{y}" : "\u0177", // LATIN SMALL LETTER Y WITH CIRCUMFLEX
"\\\"{Y}" : "\u0178", // LATIN CAPITAL LETTER Y WITH DIAERESIS
"\\'{Z}" : "\u0179", // LATIN CAPITAL LETTER Z WITH ACUTE
"\\'{z}" : "\u017A", // LATIN SMALL LETTER Z WITH ACUTE
"\\.{Z}" : "\u017B", // LATIN CAPITAL LETTER Z WITH DOT ABOVE
"\\.{z}" : "\u017C", // LATIN SMALL LETTER Z WITH DOT ABOVE
"\\v{Z}" : "\u017D", // LATIN CAPITAL LETTER Z WITH CARON
"\\v{z}" : "\u017E", // LATIN SMALL LETTER Z WITH CARON
"\\v{A}" : "\u01CD", // LATIN CAPITAL LETTER A WITH CARON
"\\v{a}" : "\u01CE", // LATIN SMALL LETTER A WITH CARON
"\\v{I}" : "\u01CF", // LATIN CAPITAL LETTER I WITH CARON
"\\v{i}" : "\u01D0", // LATIN SMALL LETTER I WITH CARON
"\\v{O}" : "\u01D1", // LATIN CAPITAL LETTER O WITH CARON
"\\v{o}" : "\u01D2", // LATIN SMALL LETTER O WITH CARON
"\\v{U}" : "\u01D3", // LATIN CAPITAL LETTER U WITH CARON
"\\v{u}" : "\u01D4", // LATIN SMALL LETTER U WITH CARON
"\\v{G}" : "\u01E6", // LATIN CAPITAL LETTER G WITH CARON
"\\v{g}" : "\u01E7", // LATIN SMALL LETTER G WITH CARON
"\\v{K}" : "\u01E8", // LATIN CAPITAL LETTER K WITH CARON
"\\v{k}" : "\u01E9", // LATIN SMALL LETTER K WITH CARON
"\\k{O}" : "\u01EA", // LATIN CAPITAL LETTER O WITH OGONEK
"\\k{o}" : "\u01EB", // LATIN SMALL LETTER O WITH OGONEK
"\\v{j}" : "\u01F0", // LATIN SMALL LETTER J WITH CARON
"\\'{G}" : "\u01F4", // LATIN CAPITAL LETTER G WITH ACUTE
"\\'{g}" : "\u01F5", // LATIN SMALL LETTER G WITH ACUTE
"\\.{B}" : "\u1E02", // LATIN CAPITAL LETTER B WITH DOT ABOVE
"\\.{b}" : "\u1E03", // LATIN SMALL LETTER B WITH DOT ABOVE
"\\d{B}" : "\u1E04", // LATIN CAPITAL LETTER B WITH DOT BELOW
"\\d{b}" : "\u1E05", // LATIN SMALL LETTER B WITH DOT BELOW
"\\b{B}" : "\u1E06", // LATIN CAPITAL LETTER B WITH LINE BELOW
"\\b{b}" : "\u1E07", // LATIN SMALL LETTER B WITH LINE BELOW
"\\.{D}" : "\u1E0A", // LATIN CAPITAL LETTER D WITH DOT ABOVE
"\\.{d}" : "\u1E0B", // LATIN SMALL LETTER D WITH DOT ABOVE
"\\d{D}" : "\u1E0C", // LATIN CAPITAL LETTER D WITH DOT BELOW
"\\d{d}" : "\u1E0D", // LATIN SMALL LETTER D WITH DOT BELOW
"\\b{D}" : "\u1E0E", // LATIN CAPITAL LETTER D WITH LINE BELOW
"\\b{d}" : "\u1E0F", // LATIN SMALL LETTER D WITH LINE BELOW
"\\c{D}" : "\u1E10", // LATIN CAPITAL LETTER D WITH CEDILLA
"\\c{d}" : "\u1E11", // LATIN SMALL LETTER D WITH CEDILLA
"\\.{F}" : "\u1E1E", // LATIN CAPITAL LETTER F WITH DOT ABOVE
"\\.{f}" : "\u1E1F", // LATIN SMALL LETTER F WITH DOT ABOVE
"\\={G}" : "\u1E20", // LATIN CAPITAL LETTER G WITH MACRON
"\\={g}" : "\u1E21", // LATIN SMALL LETTER G WITH MACRON
"\\.{H}" : "\u1E22", // LATIN CAPITAL LETTER H WITH DOT ABOVE
"\\.{h}" : "\u1E23", // LATIN SMALL LETTER H WITH DOT ABOVE
"\\d{H}" : "\u1E24", // LATIN CAPITAL LETTER H WITH DOT BELOW
"\\d{h}" : "\u1E25", // LATIN SMALL LETTER H WITH DOT BELOW
"\\\"{H}" : "\u1E26", // LATIN CAPITAL LETTER H WITH DIAERESIS
"\\\"{h}" : "\u1E27", // LATIN SMALL LETTER H WITH DIAERESIS
"\\c{H}" : "\u1E28", // LATIN CAPITAL LETTER H WITH CEDILLA
"\\c{h}" : "\u1E29", // LATIN SMALL LETTER H WITH CEDILLA
"\\'{K}" : "\u1E30", // LATIN CAPITAL LETTER K WITH ACUTE
"\\'{k}" : "\u1E31", // LATIN SMALL LETTER K WITH ACUTE
"\\d{K}" : "\u1E32", // LATIN CAPITAL LETTER K WITH DOT BELOW
"\\d{k}" : "\u1E33", // LATIN SMALL LETTER K WITH DOT BELOW
"\\b{K}" : "\u1E34", // LATIN CAPITAL LETTER K WITH LINE BELOW
"\\b{k}" : "\u1E35", // LATIN SMALL LETTER K WITH LINE BELOW
"\\d{L}" : "\u1E36", // LATIN CAPITAL LETTER L WITH DOT BELOW
"\\d{l}" : "\u1E37", // LATIN SMALL LETTER L WITH DOT BELOW
"\\b{L}" : "\u1E3A", // LATIN CAPITAL LETTER L WITH LINE BELOW
"\\b{l}" : "\u1E3B", // LATIN SMALL LETTER L WITH LINE BELOW
"\\'{M}" : "\u1E3E", // LATIN CAPITAL LETTER M WITH ACUTE
"\\'{m}" : "\u1E3F", // LATIN SMALL LETTER M WITH ACUTE
"\\.{M}" : "\u1E40", // LATIN CAPITAL LETTER M WITH DOT ABOVE
"\\.{m}" : "\u1E41", // LATIN SMALL LETTER M WITH DOT ABOVE
"\\d{M}" : "\u1E42", // LATIN CAPITAL LETTER M WITH DOT BELOW
"\\d{m}" : "\u1E43", // LATIN SMALL LETTER M WITH DOT BELOW
"\\.{N}" : "\u1E44", // LATIN CAPITAL LETTER N WITH DOT ABOVE
"\\.{n}" : "\u1E45", // LATIN SMALL LETTER N WITH DOT ABOVE
"\\d{N}" : "\u1E46", // LATIN CAPITAL LETTER N WITH DOT BELOW
"\\d{n}" : "\u1E47", // LATIN SMALL LETTER N WITH DOT BELOW
"\\b{N}" : "\u1E48", // LATIN CAPITAL LETTER N WITH LINE BELOW
"\\b{n}" : "\u1E49", // LATIN SMALL LETTER N WITH LINE BELOW
"\\'{P}" : "\u1E54", // LATIN CAPITAL LETTER P WITH ACUTE
"\\'{p}" : "\u1E55", // LATIN SMALL LETTER P WITH ACUTE
"\\.{P}" : "\u1E56", // LATIN CAPITAL LETTER P WITH DOT ABOVE
"\\.{p}" : "\u1E57", // LATIN SMALL LETTER P WITH DOT ABOVE
"\\.{R}" : "\u1E58", // LATIN CAPITAL LETTER R WITH DOT ABOVE
"\\.{r}" : "\u1E59", // LATIN SMALL LETTER R WITH DOT ABOVE
"\\d{R}" : "\u1E5A", // LATIN CAPITAL LETTER R WITH DOT BELOW
"\\d{r}" : "\u1E5B", // LATIN SMALL LETTER R WITH DOT BELOW
"\\b{R}" : "\u1E5E", // LATIN CAPITAL LETTER R WITH LINE BELOW
"\\b{r}" : "\u1E5F", // LATIN SMALL LETTER R WITH LINE BELOW
"\\.{S}" : "\u1E60", // LATIN CAPITAL LETTER S WITH DOT ABOVE
"\\.{s}" : "\u1E61", // LATIN SMALL LETTER S WITH DOT ABOVE
"\\d{S}" : "\u1E62", // LATIN CAPITAL LETTER S WITH DOT BELOW
"\\d{s}" : "\u1E63", // LATIN SMALL LETTER S WITH DOT BELOW
"\\.{T}" : "\u1E6A", // LATIN CAPITAL LETTER T WITH DOT ABOVE
"\\.{t}" : "\u1E6B", // LATIN SMALL LETTER T WITH DOT ABOVE
"\\d{T}" : "\u1E6C", // LATIN CAPITAL LETTER T WITH DOT BELOW
"\\d{t}" : "\u1E6D", // LATIN SMALL LETTER T WITH DOT BELOW
"\\b{T}" : "\u1E6E", // LATIN CAPITAL LETTER T WITH LINE BELOW
"\\b{t}" : "\u1E6F", // LATIN SMALL LETTER T WITH LINE BELOW
"\\~{V}" : "\u1E7C", // LATIN CAPITAL LETTER V WITH TILDE
"\\~{v}" : "\u1E7D", // LATIN SMALL LETTER V WITH TILDE
"\\d{V}" : "\u1E7E", // LATIN CAPITAL LETTER V WITH DOT BELOW
"\\d{v}" : "\u1E7F", // LATIN SMALL LETTER V WITH DOT BELOW
"\\`{W}" : "\u1E80", // LATIN CAPITAL LETTER W WITH GRAVE
"\\`{w}" : "\u1E81", // LATIN SMALL LETTER W WITH GRAVE
"\\'{W}" : "\u1E82", // LATIN CAPITAL LETTER W WITH ACUTE
"\\'{w}" : "\u1E83", // LATIN SMALL LETTER W WITH ACUTE
"\\\"{W}" : "\u1E84", // LATIN CAPITAL LETTER W WITH DIAERESIS
"\\\"{w}" : "\u1E85", // LATIN SMALL LETTER W WITH DIAERESIS
"\\.{W}" : "\u1E86", // LATIN CAPITAL LETTER W WITH DOT ABOVE
"\\.{w}" : "\u1E87", // LATIN SMALL LETTER W WITH DOT ABOVE
"\\d{W}" : "\u1E88", // LATIN CAPITAL LETTER W WITH DOT BELOW
"\\d{w}" : "\u1E89", // LATIN SMALL LETTER W WITH DOT BELOW
"\\.{X}" : "\u1E8A", // LATIN CAPITAL LETTER X WITH DOT ABOVE
"\\.{x}" : "\u1E8B", // LATIN SMALL LETTER X WITH DOT ABOVE
"\\\"{X}" : "\u1E8C", // LATIN CAPITAL LETTER X WITH DIAERESIS
"\\\"{x}" : "\u1E8D", // LATIN SMALL LETTER X WITH DIAERESIS
"\\.{Y}" : "\u1E8E", // LATIN CAPITAL LETTER Y WITH DOT ABOVE
"\\.{y}" : "\u1E8F", // LATIN SMALL LETTER Y WITH DOT ABOVE
"\\^{Z}" : "\u1E90", // LATIN CAPITAL LETTER Z WITH CIRCUMFLEX
"\\^{z}" : "\u1E91", // LATIN SMALL LETTER Z WITH CIRCUMFLEX
"\\d{Z}" : "\u1E92", // LATIN CAPITAL LETTER Z WITH DOT BELOW
"\\d{z}" : "\u1E93", // LATIN SMALL LETTER Z WITH DOT BELOW
"\\b{Z}" : "\u1E94", // LATIN CAPITAL LETTER Z WITH LINE BELOW
"\\b{z}" : "\u1E95", // LATIN SMALL LETTER Z WITH LINE BELOW
"\\b{h}" : "\u1E96", // LATIN SMALL LETTER H WITH LINE BELOW
"\\\"{t}" : "\u1E97", // LATIN SMALL LETTER T WITH DIAERESIS
"\\d{A}" : "\u1EA0", // LATIN CAPITAL LETTER A WITH DOT BELOW
"\\d{a}" : "\u1EA1", // LATIN SMALL LETTER A WITH DOT BELOW
"\\d{E}" : "\u1EB8", // LATIN CAPITAL LETTER E WITH DOT BELOW
"\\d{e}" : "\u1EB9", // LATIN SMALL LETTER E WITH DOT BELOW
"\\~{E}" : "\u1EBC", // LATIN CAPITAL LETTER E WITH TILDE
"\\~{e}" : "\u1EBD", // LATIN SMALL LETTER E WITH TILDE
"\\d{I}" : "\u1ECA", // LATIN CAPITAL LETTER I WITH DOT BELOW
"\\d{i}" : "\u1ECB", // LATIN SMALL LETTER I WITH DOT BELOW
"\\d{O}" : "\u1ECC", // LATIN CAPITAL LETTER O WITH DOT BELOW
"\\d{o}" : "\u1ECD", // LATIN SMALL LETTER O WITH DOT BELOW
"\\d{U}" : "\u1EE4", // LATIN CAPITAL LETTER U WITH DOT BELOW
"\\d{u}" : "\u1EE5", // LATIN SMALL LETTER U WITH DOT BELOW
"\\`{Y}" : "\u1EF2", // LATIN CAPITAL LETTER Y WITH GRAVE
"\\`{y}" : "\u1EF3", // LATIN SMALL LETTER Y WITH GRAVE
"\\d{Y}" : "\u1EF4", // LATIN CAPITAL LETTER Y WITH DOT BELOW
"\\d{y}" : "\u1EF5", // LATIN SMALL LETTER Y WITH DOT BELOW
"\\~{Y}" : "\u1EF8", // LATIN CAPITAL LETTER Y WITH TILDE
"\\~{y}" : "\u1EF9", // LATIN SMALL LETTER Y WITH TILDE
"\\~{}" : "\u223C", // TILDE OPERATOR
"~" : "\u00A0" // NO-BREAK SPACE
};
 
var alwaysMap = {
"|":"{\\textbar}",
"<":"{\\textless}",
">":"{\\textgreater}",
"~":"{\\textasciitilde}",
"^":"{\\textasciicircum}",
"\\":"{\\textbackslash}"
};
 
var strings = {};
var keyRe = /[a-zA-Z0-9\-]/;
var keywordSplitOnSpace = true;
var keywordDelimRe = ',\\s*';
var keywordDelimReFlags = '';
 
function setKeywordSplitOnSpace( val ) {
keywordSplitOnSpace = val;
}
 
function setKeywordDelimRe( val, flags ) {
//expect string, but it could be RegExp
if(typeof(val) != 'string') {
keywordDelimRe = val.toString().slice(1, val.toString().lastIndexOf('/'));
keywordDelimReFlags = val.toString().slice(val.toString().lastIndexOf('/')+1);
} else {
keywordDelimRe = val;
keywordDelimReFlags = flags;
}
}
 
function processField(item, field, value) {
if(Zotero.Utilities.trim(value) == '') return null;
if(fieldMap[field]) {
item[fieldMap[field]] = value;
} else if(inputFieldMap[field]) {
item[inputFieldMap[field]] = value;
} else if(field == "journal") {
if(item.publicationTitle) {
item.journalAbbreviation = value;
} else {
item.publicationTitle = value;
}
} else if(field == "fjournal") {
if(item.publicationTitle) {
// move publicationTitle to abbreviation
item.journalAbbreviation = value;
}
item.publicationTitle = value;
} else if(field == "author" || field == "editor" || field == "translator") {
// parse authors/editors/translators
var names = value.split(/ and /i); // now case insensitive
for(var i in names) {
var name = names[i];
// skip empty names
if (name.trim() == '') {
continue;
}
// Names in BibTeX can have three commas
pieces = name.split(',');
var creator = {};
if (pieces.length > 1) {
creator.firstName = pieces.pop().trim();
creator.lastName = pieces.join(',').trim();
creator.creatorType = field;
} else {
creator = Zotero.Utilities.cleanAuthor(name, field, false);
}
item.creators.push(creator);
}
} else if(field == "institution" || field == "organization") {
item.backupPublisher = value;
} else if(field == "number"){ // fix for techreport
if (item.itemType == "report") {
item.reportNumber = value;
} else if (item.itemType == "book" || item.itemType == "bookSection") {
item.seriesNumber = value;
} else {
item.issue = value;
}
} else if(field == "month") {
var monthIndex = months.indexOf(value.toLowerCase());
if(monthIndex != -1) {
value = Zotero.Utilities.formatDate({month:monthIndex});
} else {
value += " ";
}
if(item.date) {
if(value.indexOf(item.date) != -1) {
// value contains year and more
item.date = value;
} else {
item.date = value+item.date;
}
} else {
item.date = value;
}
} else if(field == "year") {
if(item.date) {
if(item.date.indexOf(value) == -1) {
// date does not already contain year
item.date += value;
}
} else {
item.date = value;
}
} else if(field == "pages") {
if (item.itemType == "book" || item.itemType == "thesis" || item.itemType == "manuscript") {
item.numPages = value;
}
else {
item.pages = value.replace(/--/g, "-");
}
} else if(field == "note") {
item.extra += "\n"+value;
} else if(field == "howpublished") {
if(value.length >= 7) {
var str = value.substr(0, 7);
if(str == "http://" || str == "https:/" || str == "mailto:") {
item.url = value;
} else {
item.extra += "\nPublished: "+value;
}
}
} else if(field == "keywords" || field == "keyword") {
var re = new RegExp(keywordDelimRe, keywordDelimReFlags);
if(!value.match(re) && keywordSplitOnSpace) {
// keywords/tags
item.tags = value.split(" ");
} else {
item.tags = value.split(re);
}
} else if (field == "comment" || field == "annote" || field == "review") {
item.notes.push({note:Zotero.Utilities.text2html(value)});
} else if (field == "pdf") {
if (/:\/\//.test(value)) { // a full uri is given
item.attachments = [{url:value, mimeType:"application/pdf", downloadable:true}];
} else { // if no uri is given, assume that it is an absolute path to the PDF
item.attachments = [{url:"file://"+value, mimeType:"application/pdf"}];
}
} else if (field == "sentelink") { // the reference manager 'Sente' has a unique file scheme in exported BibTeX
item.attachments = [{url:value.split(",")[0], mimeType:"application/pdf", downloadable:true}];
} else if (field == "file") {
var attachments = value.split(";");
for(var i in attachments){
var attachment = attachments[i];
var parts = attachment.split(":");
var filetitle = parts[0];
var filepath = parts[1];
if (filepath.trim() === '') continue; // skip empty entries
var filetype = parts[2];
if (filetitle.length == 0) {
filetitle = "Attachment";
}
if (filetype.match(/pdf/i)) {
item.attachments.push({url:"file://"+filepath, mimeType:"application/pdf", title:filetitle, downloadable:true});
} else {
item.attachments.push({url:"file://"+filepath, title:filetitle, downloadable:true});
}
}
}
}
 
function getFieldValue(read) {
var value = "";
// now, we have the first character of the field
if(read == "{") {
// character is a brace
var openBraces = 1;
while(read = Zotero.read(1)) {
if(read == "{" && value[value.length-1] != "\\") {
openBraces++;
value += "{";
} else if(read == "}" && value[value.length-1] != "\\") {
openBraces--;
if(openBraces == 0) {
break;
} else {
value += "}";
}
} else {
value += read;
}
}
} else if(read == '"') {
var openBraces = 0;
while(read = Zotero.read(1)) {
if(read == "{" && value[value.length-1] != "\\") {
openBraces++;
value += "{";
} else if(read == "}" && value[value.length-1] != "\\") {
openBraces--;
value += "}";
} else if(read == '"' && openBraces == 0) {
break;
} else {
value += read;
}
}
}
if(value.length > 1) {
// replace accented characters (yucky slow)
value = value.replace(/{?(\\[`"'^~=a-z]){?\\?([A-Za-z])}/g, "$1{$2}");
for (var mapped in reversemappingTable) { // really really slow!
var unicode = reversemappingTable[mapped];
if (value.indexOf(mapped) != -1) {
Zotero.debug("Replace " + mapped + " in " + value + " with " + unicode);
value = value.replace(mapped, unicode, "g");
}
mapped = mapped.replace(/[{}]/g, "");
if (value.indexOf(mapped) != -1) {
Zotero.debug("Replace(2) " + mapped + " in " + value + " with " + unicode);
value = value.replace(mapped, unicode, "g");
}
}
// kill braces
value = value.replace(/([^\\])[{}]+/g, "$1");
if(value[0] == "{") {
value = value.substr(1);
}
// chop off backslashes
value = value.replace(/([^\\])\\([#$%&~_^\\{}])/g, "$1$2");
value = value.replace(/([^\\])\\([#$%&~_^\\{}])/g, "$1$2");
if(value[0] == "\\" && "#$%&~_^\\{}".indexOf(value[1]) != -1) {
value = value.substr(1);
}
if(value[value.length-1] == "\\" && "#$%&~_^\\{}".indexOf(value[value.length-2]) != -1) {
value = value.substr(0, value.length-1);
}
value = value.replace(/\\\\/g, "\\");
value = value.replace(/\s+/g, " ");
}
return value;
}
 
function beginRecord(type, closeChar) {
var isCiteKey=false;
type = Zotero.Utilities.trimInternal(type.toLowerCase());
if(type != "string") {
var zoteroType = bibtex2zoteroTypeMap[type];
if (!zoteroType) {
Zotero.debug("discarded item from BibTeX; type was "+type);
return;
}
var item = new Zotero.Item(zoteroType);
isCiteKey=true;
item.extra = "";
}
var field = "";
// by setting dontRead to true, we can skip a read on the next iteration
// of this loop. this is useful after we read past the end of a string.
var dontRead = false;
while(dontRead || (read = Zotero.read(1))) {
dontRead = false;
if(read == "=") { // equals begin a field
// read whitespace
var read = Zotero.read(1);
while(" \n\r\t".indexOf(read) != -1) {
read = Zotero.read(1);
}
if(keyRe.test(read)) {
// read numeric data here, since we might get an end bracket
// that we should care about
value = "";
value += read;
// character is a number
while((read = Zotero.read(1)) && keyRe.test(read)) {
value += read;
}
// don't read the next char; instead, process the character
// we already read past the end of the string
dontRead = true;
// see if there's a defined string
if(strings[value]) value = strings[value];
} else {
var value = getFieldValue(read);
}
if(item) {
processField(item, field.toLowerCase(), value);
} else if(type == "string") {
strings[field] = value;
}
field = "";
} else if(read == ",") { // commas reset
if( isCiteKey ) {
item.tags.push('bibtex:'+field);
isCiteKey=false;
}
field = "";
} else if(read == closeChar) {
if(item) {
if(item.extra) item.extra = item.extra.substr(1); // chop \n
item.complete();
}
return;
} else if(" \n\r\t".indexOf(read) == -1) { // skip whitespace
field += read;
}
}
}
 
function doImport() {
var read = "", text = "", recordCloseElement = false;
var type = false;
while(read = Zotero.read(1)) {
if(read == "@") {
type = "";
} else if(type !== false) {
if(type == "comment") {
type = false;
} else if(read == "{") { // possible open character
beginRecord(type, "}");
type = false;
} else if(read == "(") { // possible open character
beginRecord(type, ")");
type = false;
} else if(/[a-zA-Z0-9-_]/.test(read)) {
type += read;
}
}
}
}
 
// some fields are, in fact, macros. If that is the case then we should not put the
// data in the braces as it will cause the macros to not expand properly
function writeField(field, value, isMacro) {
if(!value && typeof value != "number") return;
value = value + ""; // convert integers to strings
Zotero.write(",\n\t"+field+" = ");
if(!isMacro) Zotero.write("{");
// url field is preserved, for use with \href and \url
// Other fields (DOI?) may need similar treatment
if(!((field == "url") || (field == "doi") | (field == "file"))) {
// I hope these are all the escape characters!
value = value.replace(/[|\<\>\~\^\\]/g, mapEscape).replace(/([\#\$\%\&\_])/g, "\\$1");
// Case of words with uppercase characters in non-initial positions is preserved with braces.
if(!isMacro&&field != "pages") value = value.replace(/([^\s]+[A-Z][^\s,]*)/g, "{$1}");
}
if (Zotero.getOption("exportCharset") != "UTF-8") {
value = value.replace(/[\u0080-\uFFFF]/g, mapAccent);
}
Zotero.write(value);
if(!isMacro) Zotero.write("}");
}
 
function mapEscape(character) {
return alwaysMap[character];
}
 
function mapAccent(character) {
return (mappingTable[character] ? mappingTable[character] : "?");
}
 
// a little substitution function for BibTeX keys, where we don't want LaTeX
// escaping, but we do want to preserve the base characters
 
function tidyAccents(s) {
var r=s.toLowerCase();
 
// XXX Remove conditional when we drop Zotero 2.1.x support
// This is supported in Zotero 3.0 and higher
if (ZU.removeDiacritics !== undefined)
r = ZU.removeDiacritics(r, true);
else {
// We fall back on the replacement list we used previously
r = r.replace(new RegExp("[ä]", 'g'),"ae");
r = r.replace(new RegExp("[ö]", 'g'),"oe");
r = r.replace(new RegExp("[ü]", 'g'),"ue");
r = r.replace(new RegExp("[àáâãå]", 'g'),"a");
r = r.replace(new RegExp("æ", 'g'),"ae");
r = r.replace(new RegExp("ç", 'g'),"c");
r = r.replace(new RegExp("[èéêë]", 'g'),"e");
r = r.replace(new RegExp("[ìíîï]", 'g'),"i");
r = r.replace(new RegExp("ñ", 'g'),"n");
r = r.replace(new RegExp("[òóôõ]", 'g'),"o");
r = r.replace(new RegExp("œ", 'g'),"oe");
r = r.replace(new RegExp("[ùúû]", 'g'),"u");
r = r.replace(new RegExp("[ýÿ]", 'g'),"y");
}
 
return r;
};
 
var numberRe = /^[0-9]+/;
// Below is a list of words that should not appear as part of the citation key
// in includes the indefinite articles of English, German, French and Spanish, as well as a small set of English prepositions whose
// force is more grammatical than lexical, i.e. which are likely to strike many as 'insignificant'.
// The assumption is that most who want a title word in their key would prefer the first word of significance.
var citeKeyTitleBannedRe = /\b(a|an|the|some|from|on|in|to|of|do|with|der|die|das|ein|eine|einer|eines|einem|einen|un|une|la|le|l\'|el|las|los|al|uno|una|unos|unas|de|des|del|d\')(\s+|\b)/g;
var citeKeyConversionsRe = /%([a-zA-Z])/;
var citeKeyCleanRe = /[^a-z0-9\!\$\&\*\+\-\.\/\:\;\<\>\?\[\]\^\_\`\|]+/g;
 
var citeKeyConversions = {
"a":function (flags, item) {
if(item.creators && item.creators[0] && item.creators[0].lastName) {
return item.creators[0].lastName.toLowerCase().replace(/ /g,"_").replace(/,/g,"");
}
return "";
},
"t":function (flags, item) {
if (item["title"]) {
return item["title"].toLowerCase().replace(citeKeyTitleBannedRe, "").split(/\s+/g)[0];
}
return "";
},
"y":function (flags, item) {
if(item.date) {
var date = Zotero.Utilities.strToDate(item.date);
if(date.year && numberRe.test(date.year)) {
return date.year;
}
}
return "????";
}
}
 
 
function buildCiteKey (item,citekeys) {
for( t in item.tags ) {
Zotero.debug('TAG: '+t);
if( item.tags[t].tag.substr(0,7)=='bibtex:' ) {
return item.tags[t].tag.substr(7);
}
}
var basekey = "";
var counter = 0;
citeKeyFormatRemaining = citeKeyFormat;
while (citeKeyConversionsRe.test(citeKeyFormatRemaining)) {
if (counter > 100) {
Zotero.debug("Pathological BibTeX format: " + citeKeyFormat);
break;
}
var m = citeKeyFormatRemaining.match(citeKeyConversionsRe);
if (m.index > 0) {
//add data before the conversion match to basekey
basekey = basekey + citeKeyFormatRemaining.substr(0, m.index);
}
var flags = ""; // for now
var f = citeKeyConversions[m[1]];
if (typeof(f) == "function") {
var value = f(flags, item);
Zotero.debug("Got value " + value + " for %" + m[1]);
//add conversion to basekey
basekey = basekey + value;
}
citeKeyFormatRemaining = citeKeyFormatRemaining.substr(m.index + m.length);
counter++;
}
if (citeKeyFormatRemaining.length > 0) {
basekey = basekey + citeKeyFormatRemaining;
}
 
// for now, remove any characters not explicitly known to be allowed;
// we might want to allow UTF-8 citation keys in the future, depending
// on implementation support.
//
// no matter what, we want to make sure we exclude
// " # % ' ( ) , = { } ~ and backslash
// however, we want to keep the base characters
 
basekey = tidyAccents(basekey);
basekey = basekey.replace(citeKeyCleanRe, "");
var citekey = basekey;
var i = 0;
while(citekeys[citekey]) {
i++;
citekey = basekey + "-" + i;
}
citekeys[citekey] = true;
return citekey;
}
 
function doExport() {
//Zotero.write("% BibTeX export generated by Zotero "+Zotero.Utilities.getVersion());
// to make sure the BOM gets ignored
Zotero.write("\n");
var first = true;
var citekeys = new Object();
var item;
while(item = Zotero.nextItem()) {
// determine type
var type = zotero2bibtexTypeMap[item.itemType];
if (typeof(type) == "function") { type = type(item); }
if(!type) type = "misc";
// create a unique citation key
var citekey = buildCiteKey(item, citekeys);
// write citation key
Zotero.write((first ? "" : ",\n\n") + "@"+type+"{"+citekey);
first = false;
for(var field in fieldMap) {
if(item[fieldMap[field]]) {
writeField(field, item[fieldMap[field]]);
}
}
 
if(item.reportNumber || item.issue || item.seriesNumber) {
writeField("number", item.reportNumber || item.issue || item.seriesNumber);
}
 
if(item.publicationTitle) {
if(item.itemType == "bookSection" || item.itemType == "conferencePaper") {
writeField("booktitle", item.publicationTitle);
} else {
writeField("journal", item.publicationTitle);
}
}
if(item.publisher) {
if(item.itemType == "thesis") {
writeField("school", item.publisher);
} else if(item.itemType =="report") {
writeField("institution", item.publisher);
} else {
writeField("publisher", item.publisher);
}
}
if(item.creators && item.creators.length) {
// split creators into subcategories
var author = "";
var editor = "";
var translator = "";
for(var i in item.creators) {
var creator = item.creators[i];
var creatorString = creator.lastName;
 
if (creator.firstName) {
creatorString = creator.lastName + ", " + creator.firstName;
} else if (creator.fieldMode == true) { // fieldMode true, assume corporate author
creatorString = "{" + creator.lastName + "}";
}
 
if (creator.creatorType == "editor" || creator.creatorType == "seriesEditor") {
editor += " and "+creatorString;
} else if (creator.creatorType == "translator") {
translator += " and "+creatorString;
} else {
author += " and "+creatorString;
}
}
if(author) {
writeField("author", author.substr(5));
}
if(editor) {
writeField("editor", editor.substr(5));
}
if(translator) {
writeField("translator", translator.substr(5));
}
}
if(item.date) {
var date = Zotero.Utilities.strToDate(item.date);
// need to use non-localized abbreviation
if(typeof date.month == "number") {
writeField("month", months[date.month], true);
}
if(date.year) {
writeField("year", date.year);
}
}
if(item.extra) {
writeField("note", item.extra);
}
if(item.tags && item.tags.length) {
var tagString = "";
for(var i in item.tags) {
var tag = item.tags[i];
if( tag.tag.substr(0,7)!='bibtex:' ) {
tagString += ", "+tag.tag;
}
}
writeField("keywords", tagString.substr(2));
}
if(item.pages) {
writeField("pages", item.pages.replace("-","--"));
}
// Commented out, because we don't want a books number of pages in the BibTeX "pages" field for books.
//if(item.numPages) {
// writeField("pages", item.numPages);
//}
if(item.itemType == "webpage") {
writeField("howpublished", item.url);
}
if (item.notes && Zotero.getOption("exportNotes")) {
for(var i in item.notes) {
var note = item.notes[i];
writeField("annote", Zotero.Utilities.unescapeHTML(note["note"]));
}
}
if(Zotero.getOption("exportFileData")) {
if(item.attachments) {
var attachmentString = "";
for(var i in item.attachments) {
var attachment = item.attachments[i];
if(attachment.saveFile) {
attachment.saveFile(attachment.defaultPath, true);
attachmentString += ";" + attachment.title + ":" + attachment.defaultPath + ":" + attachment.mimeType;
}
}
if(attachmentString) {
writeField("file", attachmentString.substr(1));
}
}
}
Zotero.write("\n}");
}
}
 
var exports = {
"doExport": doExport,
"doImport": doImport,
"setKeywordDelimRe": setKeywordDelimRe,
"setKeywordSplitOnSpace": setKeywordSplitOnSpace
}
 
/** BEGIN TEST CASES **/
var testCases = [
{
"type": "import",
"input": "@article{Adams2001,\nauthor = {Adams, Nancy K and DeSilva, Shanaka L and Self, Steven and Salas, Guido and Schubring, Steven and Permenter, Jason L and Arbesman, Kendra},\nfile = {:Users/heatherwright/Documents/Scientific Papers/Adams\\_Huaynaputina.pdf:pdf;::},\njournal = {Bulletin of Volcanology},\nkeywords = {Vulcanian eruptions,breadcrust,plinian},\npages = {493--518},\ntitle = {{The physical volcanology of the 1600 eruption of Huaynaputina, southern Peru}},\nvolume = {62},\nyear = {2001}\n}",
"items": [
{
"itemType": "journalArticle",
"creators": [
{
"firstName": "Nancy K",
"lastName": "Adams",
"creatorType": "author"
},
{
"firstName": "Shanaka L",
"lastName": "DeSilva",
"creatorType": "author"
},
{
"firstName": "Steven",
"lastName": "Self",
"creatorType": "author"
},
{
"firstName": "Guido",
"lastName": "Salas",
"creatorType": "author"
},
{
"firstName": "Steven",
"lastName": "Schubring",
"creatorType": "author"
},
{
"firstName": "Jason L",
"lastName": "Permenter",
"creatorType": "author"
},
{
"firstName": "Kendra",
"lastName": "Arbesman",
"creatorType": "author"
}
],
"notes": [],
"tags": [
"Vulcanian eruptions",
"breadcrust",
"plinian"
],
"seeAlso": [],
"attachments": [
{
"url": "file://Users/heatherwright/Documents/Scientific Papers/Adams_Huaynaputina.pdf",
"mimeType": "application/pdf",
"title": "Attachment",
"downloadable": true
}
],
"publicationTitle": "Bulletin of Volcanology",
"pages": "493–518",
"title": "The physical volcanology of the 1600 eruption of Huaynaputina, southern Peru",
"volume": "62",
"date": "2001"
}
]
},
{
"type": "import",
"input": "@Book{abramowitz+stegun,\n author = \"Milton {Abramowitz} and Irene A. {Stegun}\",\n title = \"Handbook of Mathematical Functions with\n Formulas, Graphs, and Mathematical Tables\",\n publisher = \"Dover\",\n year = 1964,\n address = \"New York\",\n edition = \"ninth Dover printing, tenth GPO printing\"\n}\n\n@Book{Torre2008,\n author = \"Joe Torre and Tom Verducci\",\n publisher = \"Doubleday\",\n title = \"The Yankee Years\",\n year = 2008,\n isbn = \"0385527403\"\n}\n",
"items": [
{
"itemType": "book",
"creators": [
{
"firstName": "Milton",
"lastName": "Abramowitz",
"creatorType": "author"
},
{
"firstName": "Irene A.",
"lastName": "Stegun",
"creatorType": "author"
}
],
"notes": [],
"tags": [],
"seeAlso": [],
"attachments": [],
"title": "Handbook of Mathematical Functions with Formulas, Graphs, and Mathematical Tables",
"publisher": "Dover",
"date": "1964",
"place": "New York",
"edition": "ninth Dover printing, tenth GPO printing"
},
{
"itemType": "book",
"creators": [
{
"firstName": "Joe",
"lastName": "Torre",
"creatorType": "author"
},
{
"firstName": "Tom",
"lastName": "Verducci",
"creatorType": "author"
}
],
"notes": [],
"tags": [],
"seeAlso": [],
"attachments": [],
"publisher": "Doubleday",
"title": "The Yankee Years",
"date": "2008",
"ISBN": "0385527403"
}
]
},
{
"type": "import",
"input": "@INPROCEEDINGS {author:06,\n title = {Some publication title},\n author = {First Author and Second Author},\n crossref = {conference:06},\n pages = {330—331},\n}\n@PROCEEDINGS {conference:06,\n editor = {First Editor and Second Editor},\n title = {Proceedings of the Xth Conference on XYZ},\n booktitle = {Proceedings of the Xth Conference on XYZ},\n year = {2006},\n month = oct,\n}",
"items": [
{
"itemType": "conferencePaper",
"creators": [
{
"firstName": "First",
"lastName": "Author",
"creatorType": "author"
},
{
"firstName": "Second",
"lastName": "Author",
"creatorType": "author"
}
],
"notes": [],
"tags": [],
"seeAlso": [],
"attachments": [],
"title": "Some publication title",
"pages": "330—331"
},
{
"itemType": "book",
"creators": [
{
"firstName": "First",
"lastName": "Editor",
"creatorType": "editor"
},
{
"firstName": "Second",
"lastName": "Editor",
"creatorType": "editor"
}
],
"notes": [],
"tags": [],
"seeAlso": [],
"attachments": [],
"title": "Proceedings of the Xth Conference on XYZ",
"publicationTitle": "Proceedings of the Xth Conference on XYZ",
"date": "October 2006"
}
]
},
{
"type": "import",
"input": "@Book{hicks2001,\n author = \"von Hicks, III, Michael\",\n title = \"Design of a Carbon Fiber Composite Grid Structure for the GLAST\n Spacecraft Using a Novel Manufacturing Technique\",\n publisher = \"Stanford Press\",\n year = 2001,\n address = \"Palo Alto\",\n edition = \"1st,\",\n isbn = \"0-69-697269-4\"\n}",
"items": [
{
"itemType": "book",
"creators": [
{
"firstName": "Michael",
"lastName": "von Hicks, III",
"creatorType": "author"
}
],
"notes": [],
"tags": [],
"seeAlso": [],
"attachments": [],
"title": "Design of a Carbon Fiber Composite Grid Structure for the GLAST Spacecraft Using a Novel Manufacturing Technique",
"publisher": "Stanford Press",
"date": "2001",
"place": "Palo Alto",
"edition": "1st,",
"ISBN": "0-69-697269-4"
}
]
},
{
"type": "import",
"input": "@article{Oliveira_2009, title={USGS monitoring ecological impacts}, volume={107}, number={29}, journal={Oil & Gas Journal}, author={Oliveira, A}, year={2009}, pages={29}}",
"items": [
{
"itemType": "journalArticle",
"creators": [
{
"firstName": "A",
"lastName": "Oliveira",
"creatorType": "author"
}
],
"notes": [],
"tags": [],
"seeAlso": [],
"attachments": [],
"title": "USGS monitoring ecological impacts",
"volume": "107",
"issue": "29",
"publicationTitle": "Oil & Gas Journal",
"date": "2009",
"pages": "29"
}
]
},
{
"type": "import",
"input": "@article{test-ticket1661,\ntitle={non-braking space: ~; accented characters: {\\~n} and \\~{n}; tilde operator: \\~},\n} ",
"items": [
{
"itemType": "journalArticle",
"creators": [],
"notes": [],
"tags": [],
"seeAlso": [],
"attachments": [],
"title": "non-braking space: ; accented characters: ñ and ñ; tilde operator: ∼"
}
]
}
]
/** END TEST CASES **/

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.