##// END OF EJS Templates
worjk latex completion and back
Matthias Bussonnier -
Show More
@@ -1,1172 +1,1267 b''
1 1 # encoding: utf-8
2 2 """Word completion for IPython.
3 3
4 4 This module is a fork of the rlcompleter module in the Python standard
5 5 library. The original enhancements made to rlcompleter have been sent
6 6 upstream and were accepted as of Python 2.3, but we need a lot more
7 7 functionality specific to IPython, so this module will continue to live as an
8 8 IPython-specific utility.
9 9
10 10 Original rlcompleter documentation:
11 11
12 12 This requires the latest extension to the readline module (the
13 13 completes keywords, built-ins and globals in __main__; when completing
14 14 NAME.NAME..., it evaluates (!) the expression up to the last dot and
15 15 completes its attributes.
16 16
17 17 It's very cool to do "import string" type "string.", hit the
18 18 completion key (twice), and see the list of names defined by the
19 19 string module!
20 20
21 21 Tip: to use the tab key as the completion key, call
22 22
23 23 readline.parse_and_bind("tab: complete")
24 24
25 25 Notes:
26 26
27 27 - Exceptions raised by the completer function are *ignored* (and
28 28 generally cause the completion to fail). This is a feature -- since
29 29 readline sets the tty device in raw (or cbreak) mode, printing a
30 30 traceback wouldn't work well without some complicated hoopla to save,
31 31 reset and restore the tty state.
32 32
33 33 - The evaluation of the NAME.NAME... form may cause arbitrary
34 34 application defined code to be executed if an object with a
35 35 ``__getattr__`` hook is found. Since it is the responsibility of the
36 36 application (or the user) to enable this feature, I consider this an
37 37 acceptable risk. More complicated expressions (e.g. function calls or
38 38 indexing operations) are *not* evaluated.
39 39
40 40 - GNU readline is also used by the built-in functions input() and
41 41 raw_input(), and thus these also benefit/suffer from the completer
42 42 features. Clearly an interactive application can benefit by
43 43 specifying its own completer function and using raw_input() for all
44 44 its input.
45 45
46 46 - When the original stdin is not a tty device, GNU readline is never
47 47 used, and this module (and the readline module) are silently inactive.
48 48 """
49 49
50 50 # Copyright (c) IPython Development Team.
51 51 # Distributed under the terms of the Modified BSD License.
52 52 #
53 53 # Some of this code originated from rlcompleter in the Python standard library
54 54 # Copyright (C) 2001 Python Software Foundation, www.python.org
55 55
56 56 import __main__
57 57 import glob
58 58 import inspect
59 59 import itertools
60 60 import keyword
61 61 import os
62 62 import re
63 63 import sys
64 import unicodedata
65 import string
64 66
65 from IPython.config.configurable import Configurable
67 from IPython.config.configurable import Configurable
66 68 from IPython.core.error import TryNext
67 69 from IPython.core.inputsplitter import ESC_MAGIC
68 from IPython.core.latex_symbols import latex_symbols
70 from IPython.core.latex_symbols import latex_symbols, reverse_latex_symbol
69 71 from IPython.utils import generics
70 72 from IPython.utils import io
71 73 from IPython.utils.decorators import undoc
72 74 from IPython.utils.dir2 import dir2
73 75 from IPython.utils.process import arg_split
74 76 from IPython.utils.py3compat import builtin_mod, string_types, PY3
75 77 from IPython.utils.traitlets import CBool, Enum
76 78
77 79 #-----------------------------------------------------------------------------
78 80 # Globals
79 81 #-----------------------------------------------------------------------------
80 82
81 83 # Public API
82 84 __all__ = ['Completer','IPCompleter']
83 85
84 86 if sys.platform == 'win32':
85 87 PROTECTABLES = ' '
86 88 else:
87 89 PROTECTABLES = ' ()[]{}?=\\|;:\'#*"^&'
88 90
89 91
90 92 #-----------------------------------------------------------------------------
91 93 # Main functions and classes
92 94 #-----------------------------------------------------------------------------
93 95
94 96 def has_open_quotes(s):
95 97 """Return whether a string has open quotes.
96 98
97 99 This simply counts whether the number of quote characters of either type in
98 100 the string is odd.
99 101
100 102 Returns
101 103 -------
102 104 If there is an open quote, the quote character is returned. Else, return
103 105 False.
104 106 """
105 107 # We check " first, then ', so complex cases with nested quotes will get
106 108 # the " to take precedence.
107 109 if s.count('"') % 2:
108 110 return '"'
109 111 elif s.count("'") % 2:
110 112 return "'"
111 113 else:
112 114 return False
113 115
114 116
115 117 def protect_filename(s):
116 118 """Escape a string to protect certain characters."""
117 119
118 120 return "".join([(ch in PROTECTABLES and '\\' + ch or ch)
119 121 for ch in s])
120 122
121 123 def expand_user(path):
122 124 """Expand '~'-style usernames in strings.
123 125
124 126 This is similar to :func:`os.path.expanduser`, but it computes and returns
125 127 extra information that will be useful if the input was being used in
126 128 computing completions, and you wish to return the completions with the
127 129 original '~' instead of its expanded value.
128 130
129 131 Parameters
130 132 ----------
131 133 path : str
132 134 String to be expanded. If no ~ is present, the output is the same as the
133 135 input.
134 136
135 137 Returns
136 138 -------
137 139 newpath : str
138 140 Result of ~ expansion in the input path.
139 141 tilde_expand : bool
140 142 Whether any expansion was performed or not.
141 143 tilde_val : str
142 144 The value that ~ was replaced with.
143 145 """
144 146 # Default values
145 147 tilde_expand = False
146 148 tilde_val = ''
147 149 newpath = path
148 150
149 151 if path.startswith('~'):
150 152 tilde_expand = True
151 153 rest = len(path)-1
152 154 newpath = os.path.expanduser(path)
153 155 if rest:
154 156 tilde_val = newpath[:-rest]
155 157 else:
156 158 tilde_val = newpath
157 159
158 160 return newpath, tilde_expand, tilde_val
159 161
160 162
161 163 def compress_user(path, tilde_expand, tilde_val):
162 164 """Does the opposite of expand_user, with its outputs.
163 165 """
164 166 if tilde_expand:
165 167 return path.replace(tilde_val, '~')
166 168 else:
167 169 return path
168 170
169 171
170 172
171 173 def penalize_magics_key(word):
172 174 """key for sorting that penalizes magic commands in the ordering
173 175
174 176 Normal words are left alone.
175 177
176 178 Magic commands have the initial % moved to the end, e.g.
177 179 %matplotlib is transformed as follows:
178 180
179 181 %matplotlib -> matplotlib%
180 182
181 183 [The choice of the final % is arbitrary.]
182 184
183 185 Since "matplotlib" < "matplotlib%" as strings,
184 186 "timeit" will appear before the magic "%timeit" in the ordering
185 187
186 188 For consistency, move "%%" to the end, so cell magics appear *after*
187 189 line magics with the same name.
188 190
189 191 A check is performed that there are no other "%" in the string;
190 192 if there are, then the string is not a magic command and is left unchanged.
191 193
192 194 """
193 195
194 196 # Move any % signs from start to end of the key
195 197 # provided there are no others elsewhere in the string
196 198
197 199 if word[:2] == "%%":
198 200 if not "%" in word[2:]:
199 201 return word[2:] + "%%"
200 202
201 203 if word[:1] == "%":
202 204 if not "%" in word[1:]:
203 205 return word[1:] + "%"
204 206
205 207 return word
206 208
207 209
208 210 @undoc
209 211 class Bunch(object): pass
210 212
211 213
212 214 DELIMS = ' \t\n`!@#$^&*()=+[{]}\\|;:\'",<>?'
213 215 GREEDY_DELIMS = ' =\r\n'
214 216
215 217
216 218 class CompletionSplitter(object):
217 219 """An object to split an input line in a manner similar to readline.
218 220
219 221 By having our own implementation, we can expose readline-like completion in
220 222 a uniform manner to all frontends. This object only needs to be given the
221 223 line of text to be split and the cursor position on said line, and it
222 224 returns the 'word' to be completed on at the cursor after splitting the
223 225 entire line.
224 226
225 227 What characters are used as splitting delimiters can be controlled by
226 228 setting the `delims` attribute (this is a property that internally
227 229 automatically builds the necessary regular expression)"""
228 230
229 231 # Private interface
230 232
231 233 # A string of delimiter characters. The default value makes sense for
232 234 # IPython's most typical usage patterns.
233 235 _delims = DELIMS
234 236
235 237 # The expression (a normal string) to be compiled into a regular expression
236 238 # for actual splitting. We store it as an attribute mostly for ease of
237 239 # debugging, since this type of code can be so tricky to debug.
238 240 _delim_expr = None
239 241
240 242 # The regular expression that does the actual splitting
241 243 _delim_re = None
242 244
243 245 def __init__(self, delims=None):
244 246 delims = CompletionSplitter._delims if delims is None else delims
245 247 self.delims = delims
246 248
247 249 @property
248 250 def delims(self):
249 251 """Return the string of delimiter characters."""
250 252 return self._delims
251 253
252 254 @delims.setter
253 255 def delims(self, delims):
254 256 """Set the delimiters for line splitting."""
255 257 expr = '[' + ''.join('\\'+ c for c in delims) + ']'
256 258 self._delim_re = re.compile(expr)
257 259 self._delims = delims
258 260 self._delim_expr = expr
259 261
260 262 def split_line(self, line, cursor_pos=None):
261 263 """Split a line of text with a cursor at the given position.
262 264 """
263 265 l = line if cursor_pos is None else line[:cursor_pos]
264 266 return self._delim_re.split(l)[-1]
265 267
266 268
267 269 class Completer(Configurable):
268 270
269 271 greedy = CBool(False, config=True,
270 272 help="""Activate greedy completion
271 273
272 274 This will enable completion on elements of lists, results of function calls, etc.,
273 275 but can be unsafe because the code is actually evaluated on TAB.
274 276 """
275 277 )
276 278
277 279
278 280 def __init__(self, namespace=None, global_namespace=None, **kwargs):
279 281 """Create a new completer for the command line.
280 282
281 283 Completer(namespace=ns,global_namespace=ns2) -> completer instance.
282 284
283 285 If unspecified, the default namespace where completions are performed
284 286 is __main__ (technically, __main__.__dict__). Namespaces should be
285 287 given as dictionaries.
286 288
287 289 An optional second namespace can be given. This allows the completer
288 290 to handle cases where both the local and global scopes need to be
289 291 distinguished.
290 292
291 293 Completer instances should be used as the completion mechanism of
292 294 readline via the set_completer() call:
293 295
294 296 readline.set_completer(Completer(my_namespace).complete)
295 297 """
296 298
297 299 # Don't bind to namespace quite yet, but flag whether the user wants a
298 300 # specific namespace or to use __main__.__dict__. This will allow us
299 301 # to bind to __main__.__dict__ at completion time, not now.
300 302 if namespace is None:
301 303 self.use_main_ns = 1
302 304 else:
303 305 self.use_main_ns = 0
304 306 self.namespace = namespace
305 307
306 308 # The global namespace, if given, can be bound directly
307 309 if global_namespace is None:
308 310 self.global_namespace = {}
309 311 else:
310 312 self.global_namespace = global_namespace
311 313
312 314 super(Completer, self).__init__(**kwargs)
313 315
314 316 def complete(self, text, state):
315 317 """Return the next possible completion for 'text'.
316 318
317 319 This is called successively with state == 0, 1, 2, ... until it
318 320 returns None. The completion should begin with 'text'.
319 321
320 322 """
321 323 if self.use_main_ns:
322 324 self.namespace = __main__.__dict__
323 325
324 326 if state == 0:
325 327 if "." in text:
326 328 self.matches = self.attr_matches(text)
327 329 else:
328 330 self.matches = self.global_matches(text)
329 331 try:
330 332 return self.matches[state]
331 333 except IndexError:
332 334 return None
333 335
334 336 def global_matches(self, text):
335 337 """Compute matches when text is a simple name.
336 338
337 339 Return a list of all keywords, built-in functions and names currently
338 340 defined in self.namespace or self.global_namespace that match.
339 341
340 342 """
341 343 #print 'Completer->global_matches, txt=%r' % text # dbg
342 344 matches = []
343 345 match_append = matches.append
344 346 n = len(text)
345 347 for lst in [keyword.kwlist,
346 348 builtin_mod.__dict__.keys(),
347 349 self.namespace.keys(),
348 350 self.global_namespace.keys()]:
349 351 for word in lst:
350 352 if word[:n] == text and word != "__builtins__":
351 353 match_append(word)
352 354 return matches
353 355
354 356 def attr_matches(self, text):
355 357 """Compute matches when text contains a dot.
356 358
357 359 Assuming the text is of the form NAME.NAME....[NAME], and is
358 360 evaluatable in self.namespace or self.global_namespace, it will be
359 361 evaluated and its attributes (as revealed by dir()) are used as
360 362 possible completions. (For class instances, class members are are
361 363 also considered.)
362 364
363 365 WARNING: this can still invoke arbitrary C code, if an object
364 366 with a __getattr__ hook is evaluated.
365 367
366 368 """
367 369
368 370 #io.rprint('Completer->attr_matches, txt=%r' % text) # dbg
369 371 # Another option, seems to work great. Catches things like ''.<tab>
370 372 m = re.match(r"(\S+(\.\w+)*)\.(\w*)$", text)
371 373
372 374 if m:
373 375 expr, attr = m.group(1, 3)
374 376 elif self.greedy:
375 377 m2 = re.match(r"(.+)\.(\w*)$", self.line_buffer)
376 378 if not m2:
377 379 return []
378 380 expr, attr = m2.group(1,2)
379 381 else:
380 382 return []
381 383
382 384 try:
383 385 obj = eval(expr, self.namespace)
384 386 except:
385 387 try:
386 388 obj = eval(expr, self.global_namespace)
387 389 except:
388 390 return []
389 391
390 392 if self.limit_to__all__ and hasattr(obj, '__all__'):
391 393 words = get__all__entries(obj)
392 394 else:
393 395 words = dir2(obj)
394 396
395 397 try:
396 398 words = generics.complete_object(obj, words)
397 399 except TryNext:
398 400 pass
399 401 except Exception:
400 402 # Silence errors from completion function
401 403 #raise # dbg
402 404 pass
403 405 # Build match list to return
404 406 n = len(attr)
405 407 res = ["%s.%s" % (expr, w) for w in words if w[:n] == attr ]
406 408 return res
407 409
408 410
409 411 def get__all__entries(obj):
410 412 """returns the strings in the __all__ attribute"""
411 413 try:
412 414 words = getattr(obj, '__all__')
413 415 except:
414 416 return []
415 417
416 418 return [w for w in words if isinstance(w, string_types)]
417 419
418 420
419 421 def match_dict_keys(keys, prefix):
420 422 """Used by dict_key_matches, matching the prefix to a list of keys"""
421 423 if not prefix:
422 424 return None, 0, [repr(k) for k in keys
423 425 if isinstance(k, (string_types, bytes))]
424 426 quote_match = re.search('["\']', prefix)
425 427 quote = quote_match.group()
426 428 try:
427 429 prefix_str = eval(prefix + quote, {})
428 430 except Exception:
429 431 return None, 0, []
430 432
431 433 token_match = re.search(r'\w*$', prefix, re.UNICODE)
432 434 token_start = token_match.start()
433 435 token_prefix = token_match.group()
434 436
435 437 # TODO: support bytes in Py3k
436 438 matched = []
437 439 for key in keys:
438 440 try:
439 441 if not key.startswith(prefix_str):
440 442 continue
441 443 except (AttributeError, TypeError, UnicodeError):
442 444 # Python 3+ TypeError on b'a'.startswith('a') or vice-versa
443 445 continue
444 446
445 447 # reformat remainder of key to begin with prefix
446 448 rem = key[len(prefix_str):]
447 449 # force repr wrapped in '
448 450 rem_repr = repr(rem + '"')
449 451 if rem_repr.startswith('u') and prefix[0] not in 'uU':
450 452 # Found key is unicode, but prefix is Py2 string.
451 453 # Therefore attempt to interpret key as string.
452 454 try:
453 455 rem_repr = repr(rem.encode('ascii') + '"')
454 456 except UnicodeEncodeError:
455 457 continue
456 458
457 459 rem_repr = rem_repr[1 + rem_repr.index("'"):-2]
458 460 if quote == '"':
459 461 # The entered prefix is quoted with ",
460 462 # but the match is quoted with '.
461 463 # A contained " hence needs escaping for comparison:
462 464 rem_repr = rem_repr.replace('"', '\\"')
463 465
464 466 # then reinsert prefix from start of token
465 467 matched.append('%s%s' % (token_prefix, rem_repr))
466 468 return quote, token_start, matched
467 469
468 470
469 471 def _safe_isinstance(obj, module, class_name):
470 472 """Checks if obj is an instance of module.class_name if loaded
471 473 """
472 474 return (module in sys.modules and
473 475 isinstance(obj, getattr(__import__(module), class_name)))
474 476
475 477
476 478
477 479 class IPCompleter(Completer):
478 480 """Extension of the completer class with IPython-specific features"""
479 481
480 482 def _greedy_changed(self, name, old, new):
481 483 """update the splitter and readline delims when greedy is changed"""
482 484 if new:
483 485 self.splitter.delims = GREEDY_DELIMS
484 486 else:
485 487 self.splitter.delims = DELIMS
486 488
487 489 if self.readline:
488 490 self.readline.set_completer_delims(self.splitter.delims)
489 491
490 492 merge_completions = CBool(True, config=True,
491 493 help="""Whether to merge completion results into a single list
492 494
493 495 If False, only the completion results from the first non-empty
494 496 completer will be returned.
495 497 """
496 498 )
497 499 omit__names = Enum((0,1,2), default_value=2, config=True,
498 500 help="""Instruct the completer to omit private method names
499 501
500 502 Specifically, when completing on ``object.<tab>``.
501 503
502 504 When 2 [default]: all names that start with '_' will be excluded.
503 505
504 506 When 1: all 'magic' names (``__foo__``) will be excluded.
505 507
506 508 When 0: nothing will be excluded.
507 509 """
508 510 )
509 511 limit_to__all__ = CBool(default_value=False, config=True,
510 512 help="""Instruct the completer to use __all__ for the completion
511 513
512 514 Specifically, when completing on ``object.<tab>``.
513 515
514 516 When True: only those names in obj.__all__ will be included.
515 517
516 518 When False [default]: the __all__ attribute is ignored
517 519 """
518 520 )
519 521
520 522 def __init__(self, shell=None, namespace=None, global_namespace=None,
521 523 use_readline=True, config=None, **kwargs):
522 524 """IPCompleter() -> completer
523 525
524 526 Return a completer object suitable for use by the readline library
525 527 via readline.set_completer().
526 528
527 529 Inputs:
528 530
529 531 - shell: a pointer to the ipython shell itself. This is needed
530 532 because this completer knows about magic functions, and those can
531 533 only be accessed via the ipython instance.
532 534
533 535 - namespace: an optional dict where completions are performed.
534 536
535 537 - global_namespace: secondary optional dict for completions, to
536 538 handle cases (such as IPython embedded inside functions) where
537 539 both Python scopes are visible.
538 540
539 541 use_readline : bool, optional
540 542 If true, use the readline library. This completer can still function
541 543 without readline, though in that case callers must provide some extra
542 544 information on each call about the current line."""
543 545
544 546 self.magic_escape = ESC_MAGIC
545 547 self.splitter = CompletionSplitter()
546 548
547 549 # Readline configuration, only used by the rlcompleter method.
548 550 if use_readline:
549 551 # We store the right version of readline so that later code
550 552 import IPython.utils.rlineimpl as readline
551 553 self.readline = readline
552 554 else:
553 555 self.readline = None
554 556
555 557 # _greedy_changed() depends on splitter and readline being defined:
556 558 Completer.__init__(self, namespace=namespace, global_namespace=global_namespace,
557 559 config=config, **kwargs)
558 560
559 561 # List where completion matches will be stored
560 562 self.matches = []
561 563 self.shell = shell
562 564 # Regexp to split filenames with spaces in them
563 565 self.space_name_re = re.compile(r'([^\\] )')
564 566 # Hold a local ref. to glob.glob for speed
565 567 self.glob = glob.glob
566 568
567 569 # Determine if we are running on 'dumb' terminals, like (X)Emacs
568 570 # buffers, to avoid completion problems.
569 571 term = os.environ.get('TERM','xterm')
570 572 self.dumb_terminal = term in ['dumb','emacs']
571 573
572 574 # Special handling of backslashes needed in win32 platforms
573 575 if sys.platform == "win32":
574 576 self.clean_glob = self._clean_glob_win32
575 577 else:
576 578 self.clean_glob = self._clean_glob
577 579
578 580 #regexp to parse docstring for function signature
579 581 self.docstring_sig_re = re.compile(r'^[\w|\s.]+\(([^)]*)\).*')
580 582 self.docstring_kwd_re = re.compile(r'[\s|\[]*(\w+)(?:\s*=\s*.*)')
581 583 #use this if positional argument name is also needed
582 584 #= re.compile(r'[\s|\[]*(\w+)(?:\s*=?\s*.*)')
583 585
584 586 # All active matcher routines for completion
585 587 self.matchers = [self.python_matches,
586 588 self.file_matches,
587 589 self.magic_matches,
588 590 self.python_func_kw_matches,
589 591 self.dict_key_matches,
590 592 ]
591 593
592 594 def all_completions(self, text):
593 595 """
594 596 Wrapper around the complete method for the benefit of emacs
595 597 and pydb.
596 598 """
597 599 return self.complete(text)[1]
598 600
599 601 def _clean_glob(self,text):
600 602 return self.glob("%s*" % text)
601 603
602 604 def _clean_glob_win32(self,text):
603 605 return [f.replace("\\","/")
604 606 for f in self.glob("%s*" % text)]
605 607
606 608 def file_matches(self, text):
607 609 """Match filenames, expanding ~USER type strings.
608 610
609 611 Most of the seemingly convoluted logic in this completer is an
610 612 attempt to handle filenames with spaces in them. And yet it's not
611 613 quite perfect, because Python's readline doesn't expose all of the
612 614 GNU readline details needed for this to be done correctly.
613 615
614 616 For a filename with a space in it, the printed completions will be
615 617 only the parts after what's already been typed (instead of the
616 618 full completions, as is normally done). I don't think with the
617 619 current (as of Python 2.3) Python readline it's possible to do
618 620 better."""
619 621
620 622 #io.rprint('Completer->file_matches: <%r>' % text) # dbg
621 623
622 624 # chars that require escaping with backslash - i.e. chars
623 625 # that readline treats incorrectly as delimiters, but we
624 626 # don't want to treat as delimiters in filename matching
625 627 # when escaped with backslash
626 628 if text.startswith('!'):
627 629 text = text[1:]
628 630 text_prefix = '!'
629 631 else:
630 632 text_prefix = ''
631 633
632 634 text_until_cursor = self.text_until_cursor
633 635 # track strings with open quotes
634 636 open_quotes = has_open_quotes(text_until_cursor)
635 637
636 638 if '(' in text_until_cursor or '[' in text_until_cursor:
637 639 lsplit = text
638 640 else:
639 641 try:
640 642 # arg_split ~ shlex.split, but with unicode bugs fixed by us
641 643 lsplit = arg_split(text_until_cursor)[-1]
642 644 except ValueError:
643 645 # typically an unmatched ", or backslash without escaped char.
644 646 if open_quotes:
645 647 lsplit = text_until_cursor.split(open_quotes)[-1]
646 648 else:
647 649 return []
648 650 except IndexError:
649 651 # tab pressed on empty line
650 652 lsplit = ""
651 653
652 654 if not open_quotes and lsplit != protect_filename(lsplit):
653 655 # if protectables are found, do matching on the whole escaped name
654 656 has_protectables = True
655 657 text0,text = text,lsplit
656 658 else:
657 659 has_protectables = False
658 660 text = os.path.expanduser(text)
659 661
660 662 if text == "":
661 663 return [text_prefix + protect_filename(f) for f in self.glob("*")]
662 664
663 665 # Compute the matches from the filesystem
664 666 m0 = self.clean_glob(text.replace('\\',''))
665 667
666 668 if has_protectables:
667 669 # If we had protectables, we need to revert our changes to the
668 670 # beginning of filename so that we don't double-write the part
669 671 # of the filename we have so far
670 672 len_lsplit = len(lsplit)
671 673 matches = [text_prefix + text0 +
672 674 protect_filename(f[len_lsplit:]) for f in m0]
673 675 else:
674 676 if open_quotes:
675 677 # if we have a string with an open quote, we don't need to
676 678 # protect the names at all (and we _shouldn't_, as it
677 679 # would cause bugs when the filesystem call is made).
678 680 matches = m0
679 681 else:
680 682 matches = [text_prefix +
681 683 protect_filename(f) for f in m0]
682 684
683 685 #io.rprint('mm', matches) # dbg
684 686
685 687 # Mark directories in input list by appending '/' to their names.
686 688 matches = [x+'/' if os.path.isdir(x) else x for x in matches]
687 689 return matches
688 690
689 691 def magic_matches(self, text):
690 692 """Match magics"""
691 693 #print 'Completer->magic_matches:',text,'lb',self.text_until_cursor # dbg
692 694 # Get all shell magics now rather than statically, so magics loaded at
693 695 # runtime show up too.
694 696 lsm = self.shell.magics_manager.lsmagic()
695 697 line_magics = lsm['line']
696 698 cell_magics = lsm['cell']
697 699 pre = self.magic_escape
698 700 pre2 = pre+pre
699 701
700 702 # Completion logic:
701 703 # - user gives %%: only do cell magics
702 704 # - user gives %: do both line and cell magics
703 705 # - no prefix: do both
704 706 # In other words, line magics are skipped if the user gives %% explicitly
705 707 bare_text = text.lstrip(pre)
706 708 comp = [ pre2+m for m in cell_magics if m.startswith(bare_text)]
707 709 if not text.startswith(pre2):
708 710 comp += [ pre+m for m in line_magics if m.startswith(bare_text)]
709 711 return comp
710 712
711 713 def python_matches(self,text):
712 714 """Match attributes or global python names"""
713 715
714 716 #io.rprint('Completer->python_matches, txt=%r' % text) # dbg
715 717 if "." in text:
716 718 try:
717 719 matches = self.attr_matches(text)
718 720 if text.endswith('.') and self.omit__names:
719 721 if self.omit__names == 1:
720 722 # true if txt is _not_ a __ name, false otherwise:
721 723 no__name = (lambda txt:
722 724 re.match(r'.*\.__.*?__',txt) is None)
723 725 else:
724 726 # true if txt is _not_ a _ name, false otherwise:
725 727 no__name = (lambda txt:
726 728 re.match(r'\._.*?',txt[txt.rindex('.'):]) is None)
727 729 matches = filter(no__name, matches)
728 730 except NameError:
729 731 # catches <undefined attributes>.<tab>
730 732 matches = []
731 733 else:
732 734 matches = self.global_matches(text)
733 735
734 736 return matches
735 737
736 738 def _default_arguments_from_docstring(self, doc):
737 739 """Parse the first line of docstring for call signature.
738 740
739 741 Docstring should be of the form 'min(iterable[, key=func])\n'.
740 742 It can also parse cython docstring of the form
741 743 'Minuit.migrad(self, int ncall=10000, resume=True, int nsplit=1)'.
742 744 """
743 745 if doc is None:
744 746 return []
745 747
746 748 #care only the firstline
747 749 line = doc.lstrip().splitlines()[0]
748 750
749 751 #p = re.compile(r'^[\w|\s.]+\(([^)]*)\).*')
750 752 #'min(iterable[, key=func])\n' -> 'iterable[, key=func]'
751 753 sig = self.docstring_sig_re.search(line)
752 754 if sig is None:
753 755 return []
754 756 # iterable[, key=func]' -> ['iterable[' ,' key=func]']
755 757 sig = sig.groups()[0].split(',')
756 758 ret = []
757 759 for s in sig:
758 760 #re.compile(r'[\s|\[]*(\w+)(?:\s*=\s*.*)')
759 761 ret += self.docstring_kwd_re.findall(s)
760 762 return ret
761 763
762 764 def _default_arguments(self, obj):
763 765 """Return the list of default arguments of obj if it is callable,
764 766 or empty list otherwise."""
765 767 call_obj = obj
766 768 ret = []
767 769 if inspect.isbuiltin(obj):
768 770 pass
769 771 elif not (inspect.isfunction(obj) or inspect.ismethod(obj)):
770 772 if inspect.isclass(obj):
771 773 #for cython embededsignature=True the constructor docstring
772 774 #belongs to the object itself not __init__
773 775 ret += self._default_arguments_from_docstring(
774 776 getattr(obj, '__doc__', ''))
775 777 # for classes, check for __init__,__new__
776 778 call_obj = (getattr(obj, '__init__', None) or
777 779 getattr(obj, '__new__', None))
778 780 # for all others, check if they are __call__able
779 781 elif hasattr(obj, '__call__'):
780 782 call_obj = obj.__call__
781 783
782 784 ret += self._default_arguments_from_docstring(
783 785 getattr(call_obj, '__doc__', ''))
784 786
785 787 try:
786 788 args,_,_1,defaults = inspect.getargspec(call_obj)
787 789 if defaults:
788 790 ret+=args[-len(defaults):]
789 791 except TypeError:
790 792 pass
791 793
792 794 return list(set(ret))
793 795
794 796 def python_func_kw_matches(self,text):
795 797 """Match named parameters (kwargs) of the last open function"""
796 798
797 799 if "." in text: # a parameter cannot be dotted
798 800 return []
799 801 try: regexp = self.__funcParamsRegex
800 802 except AttributeError:
801 803 regexp = self.__funcParamsRegex = re.compile(r'''
802 804 '.*?(?<!\\)' | # single quoted strings or
803 805 ".*?(?<!\\)" | # double quoted strings or
804 806 \w+ | # identifier
805 807 \S # other characters
806 808 ''', re.VERBOSE | re.DOTALL)
807 809 # 1. find the nearest identifier that comes before an unclosed
808 810 # parenthesis before the cursor
809 811 # e.g. for "foo (1+bar(x), pa<cursor>,a=1)", the candidate is "foo"
810 812 tokens = regexp.findall(self.text_until_cursor)
811 813 tokens.reverse()
812 814 iterTokens = iter(tokens); openPar = 0
813 815
814 816 for token in iterTokens:
815 817 if token == ')':
816 818 openPar -= 1
817 819 elif token == '(':
818 820 openPar += 1
819 821 if openPar > 0:
820 822 # found the last unclosed parenthesis
821 823 break
822 824 else:
823 825 return []
824 826 # 2. Concatenate dotted names ("foo.bar" for "foo.bar(x, pa" )
825 827 ids = []
826 828 isId = re.compile(r'\w+$').match
827 829
828 830 while True:
829 831 try:
830 832 ids.append(next(iterTokens))
831 833 if not isId(ids[-1]):
832 834 ids.pop(); break
833 835 if not next(iterTokens) == '.':
834 836 break
835 837 except StopIteration:
836 838 break
837 839 # lookup the candidate callable matches either using global_matches
838 840 # or attr_matches for dotted names
839 841 if len(ids) == 1:
840 842 callableMatches = self.global_matches(ids[0])
841 843 else:
842 844 callableMatches = self.attr_matches('.'.join(ids[::-1]))
843 845 argMatches = []
844 846 for callableMatch in callableMatches:
845 847 try:
846 848 namedArgs = self._default_arguments(eval(callableMatch,
847 849 self.namespace))
848 850 except:
849 851 continue
850 852
851 853 for namedArg in namedArgs:
852 854 if namedArg.startswith(text):
853 855 argMatches.append("%s=" %namedArg)
854 856 return argMatches
855 857
856 858 def dict_key_matches(self, text):
857 859 "Match string keys in a dictionary, after e.g. 'foo[' "
858 860 def get_keys(obj):
859 861 # Only allow completion for known in-memory dict-like types
860 862 if isinstance(obj, dict) or\
861 863 _safe_isinstance(obj, 'pandas', 'DataFrame'):
862 864 try:
863 865 return list(obj.keys())
864 866 except Exception:
865 867 return []
866 868 elif _safe_isinstance(obj, 'numpy', 'ndarray') or\
867 869 _safe_isinstance(obj, 'numpy', 'void'):
868 870 return obj.dtype.names or []
869 871 return []
870 872
871 873 try:
872 874 regexps = self.__dict_key_regexps
873 875 except AttributeError:
874 876 dict_key_re_fmt = r'''(?x)
875 877 ( # match dict-referring expression wrt greedy setting
876 878 %s
877 879 )
878 880 \[ # open bracket
879 881 \s* # and optional whitespace
880 882 ([uUbB]? # string prefix (r not handled)
881 883 (?: # unclosed string
882 884 '(?:[^']|(?<!\\)\\')*
883 885 |
884 886 "(?:[^"]|(?<!\\)\\")*
885 887 )
886 888 )?
887 889 $
888 890 '''
889 891 regexps = self.__dict_key_regexps = {
890 892 False: re.compile(dict_key_re_fmt % '''
891 893 # identifiers separated by .
892 894 (?!\d)\w+
893 895 (?:\.(?!\d)\w+)*
894 896 '''),
895 897 True: re.compile(dict_key_re_fmt % '''
896 898 .+
897 899 ''')
898 900 }
899 901
900 902 match = regexps[self.greedy].search(self.text_until_cursor)
901 903 if match is None:
902 904 return []
903 905
904 906 expr, prefix = match.groups()
905 907 try:
906 908 obj = eval(expr, self.namespace)
907 909 except Exception:
908 910 try:
909 911 obj = eval(expr, self.global_namespace)
910 912 except Exception:
911 913 return []
912 914
913 915 keys = get_keys(obj)
914 916 if not keys:
915 917 return keys
916 918 closing_quote, token_offset, matches = match_dict_keys(keys, prefix)
917 919 if not matches:
918 920 return matches
919 921
920 922 # get the cursor position of
921 923 # - the text being completed
922 924 # - the start of the key text
923 925 # - the start of the completion
924 926 text_start = len(self.text_until_cursor) - len(text)
925 927 if prefix:
926 928 key_start = match.start(2)
927 929 completion_start = key_start + token_offset
928 930 else:
929 931 key_start = completion_start = match.end()
930 932
931 933 # grab the leading prefix, to make sure all completions start with `text`
932 934 if text_start > key_start:
933 935 leading = ''
934 936 else:
935 937 leading = text[text_start:completion_start]
936 938
937 939 # the index of the `[` character
938 940 bracket_idx = match.end(1)
939 941
940 942 # append closing quote and bracket as appropriate
941 943 # this is *not* appropriate if the opening quote or bracket is outside
942 944 # the text given to this method
943 945 suf = ''
944 946 continuation = self.line_buffer[len(self.text_until_cursor):]
945 947 if key_start > text_start and closing_quote:
946 948 # quotes were opened inside text, maybe close them
947 949 if continuation.startswith(closing_quote):
948 950 continuation = continuation[len(closing_quote):]
949 951 else:
950 952 suf += closing_quote
951 953 if bracket_idx > text_start:
952 954 # brackets were opened inside text, maybe close them
953 955 if not continuation.startswith(']'):
954 956 suf += ']'
955 957
956 958 return [leading + k + suf for k in matches]
957 959
960 def unicode_name_matches(self, text):
961 u"""Match Latex-like syntax for unicode characters base
962 on the name of the character.
963
964 This does \\GREEK SMALL LETTER ETA -> η
965
966 Works only on valid python 3 identifier, or on combining characters that
967 will combine to form a valid identifier.
968
969 Used on Python 3 only.
970 """
971 slashpos = text.rfind('\\')
972 if slashpos > -1:
973 s = text[slashpos+1:]
974 try :
975 unic = unicodedata.lookup(s)
976 # allow combining chars
977 if ('a'+unic).isidentifier():
978 return '\\'+s,[unic]
979 except KeyError as e:
980 pass
981 return u'', []
982
983 def back_unicode_name_matches(self, text):
984 u"""Match unicode characters back to unicode name
985
986 This does ☃ -> \\snowman
987
988 Note that snowman is not a valid python3 combining character but will be expanded.
989 Though it will not recombine back to the snowman character by the completion machinery.
990
991 This will not either back-complete standard sequences like \n, \b ...
992
993 Used on Python 3 only.
994 """
995 if len(text)<2:
996 return u'', ()
997 maybe_slash = text[-2]
998 if maybe_slash != '\\':
999 return u'', ()
1000
1001 char = text[-1]
1002 # no expand on quote for completion in strings.
1003 # nor backcomplete standard ascii keys
1004 if char in string.ascii_letters or char in ['"',"'"]:
1005 return u'', ()
1006 try :
1007 unic = unicodedata.name(char)
1008 return '\\'+char,['\\'+unic]
1009 except KeyError as e:
1010 pass
1011 return u'', ()
1012
1013 def back_latex_name_matches(self, text):
1014 u"""Match latex characters back to unicode name
1015
1016 This does ->\\sqrt
1017
1018 Used on Python 3 only.
1019 """
1020 if len(text)<2:
1021 return u'', ()
1022 maybe_slash = text[-2]
1023 if maybe_slash != '\\':
1024 return u'', ()
1025
1026
1027 char = text[-1]
1028 # no expand on quote for completion in strings.
1029 # nor backcomplete standard ascii keys
1030 if char in string.ascii_letters or char in ['"',"'"]:
1031 return u'', ()
1032 try :
1033 latex = reverse_latex_symbol[char]
1034 # '\\' replace the \ as well
1035 return '\\'+char,[latex]
1036 except KeyError as e:
1037 pass
1038 return u'', ()
1039
1040
1041
958 1042 def latex_matches(self, text):
959 1043 u"""Match Latex syntax for unicode characters.
960 1044
961 1045 This does both \\alp -> \\alpha and \\alpha -> α
962 1046
963 1047 Used on Python 3 only.
964 1048 """
965 1049 slashpos = text.rfind('\\')
966 1050 if slashpos > -1:
967 1051 s = text[slashpos:]
968 1052 if s in latex_symbols:
969 1053 # Try to complete a full latex symbol to unicode
970 1054 # \\alpha -> α
971 1055 return s, [latex_symbols[s]]
972 1056 else:
973 1057 # If a user has partially typed a latex symbol, give them
974 1058 # a full list of options \al -> [\aleph, \alpha]
975 1059 matches = [k for k in latex_symbols if k.startswith(s)]
976 1060 return s, matches
977 1061 return u'', []
978 1062
979 1063 def dispatch_custom_completer(self, text):
980 1064 #io.rprint("Custom! '%s' %s" % (text, self.custom_completers)) # dbg
981 1065 line = self.line_buffer
982 1066 if not line.strip():
983 1067 return None
984 1068
985 1069 # Create a little structure to pass all the relevant information about
986 1070 # the current completion to any custom completer.
987 1071 event = Bunch()
988 1072 event.line = line
989 1073 event.symbol = text
990 1074 cmd = line.split(None,1)[0]
991 1075 event.command = cmd
992 1076 event.text_until_cursor = self.text_until_cursor
993 1077
994 1078 #print "\ncustom:{%s]\n" % event # dbg
995 1079
996 1080 # for foo etc, try also to find completer for %foo
997 1081 if not cmd.startswith(self.magic_escape):
998 1082 try_magic = self.custom_completers.s_matches(
999 1083 self.magic_escape + cmd)
1000 1084 else:
1001 1085 try_magic = []
1002 1086
1003 1087 for c in itertools.chain(self.custom_completers.s_matches(cmd),
1004 1088 try_magic,
1005 1089 self.custom_completers.flat_matches(self.text_until_cursor)):
1006 1090 #print "try",c # dbg
1007 1091 try:
1008 1092 res = c(event)
1009 1093 if res:
1010 1094 # first, try case sensitive match
1011 1095 withcase = [r for r in res if r.startswith(text)]
1012 1096 if withcase:
1013 1097 return withcase
1014 1098 # if none, then case insensitive ones are ok too
1015 1099 text_low = text.lower()
1016 1100 return [r for r in res if r.lower().startswith(text_low)]
1017 1101 except TryNext:
1018 1102 pass
1019 1103
1020 1104 return None
1021 1105
1022 1106 def complete(self, text=None, line_buffer=None, cursor_pos=None):
1023 1107 """Find completions for the given text and line context.
1024 1108
1025 1109 Note that both the text and the line_buffer are optional, but at least
1026 1110 one of them must be given.
1027 1111
1028 1112 Parameters
1029 1113 ----------
1030 1114 text : string, optional
1031 1115 Text to perform the completion on. If not given, the line buffer
1032 1116 is split using the instance's CompletionSplitter object.
1033 1117
1034 1118 line_buffer : string, optional
1035 1119 If not given, the completer attempts to obtain the current line
1036 1120 buffer via readline. This keyword allows clients which are
1037 1121 requesting for text completions in non-readline contexts to inform
1038 1122 the completer of the entire text.
1039 1123
1040 1124 cursor_pos : int, optional
1041 1125 Index of the cursor in the full line buffer. Should be provided by
1042 1126 remote frontends where kernel has no access to frontend state.
1043 1127
1044 1128 Returns
1045 1129 -------
1046 1130 text : str
1047 1131 Text that was actually used in the completion.
1048 1132
1049 1133 matches : list
1050 1134 A list of completion matches.
1051 1135 """
1052 1136 # io.rprint('\nCOMP1 %r %r %r' % (text, line_buffer, cursor_pos)) # dbg
1053 1137
1054 1138 # if the cursor position isn't given, the only sane assumption we can
1055 1139 # make is that it's at the end of the line (the common case)
1056 1140 if cursor_pos is None:
1057 1141 cursor_pos = len(line_buffer) if text is None else len(text)
1058 1142
1059 1143 if PY3:
1060 latex_text = text if not line_buffer else line_buffer[:cursor_pos]
1061 latex_text, latex_matches = self.latex_matches(latex_text)
1062 if latex_matches:
1063 return latex_text, latex_matches
1064 1144
1145 base_text = text if not line_buffer else line_buffer[:cursor_pos]
1146 latex_text, latex_matches = self.latex_matches(base_text)
1147 if latex_matches:
1148 return latex_text, latex_matches
1149 name_text = ''
1150 name_matches = []
1151 for meth in (self.unicode_name_matches, self.back_unicode_name_matches, self.back_latex_name_matches):
1152 _name_text, _name_matches = meth(base_text)
1153 if _name_text:
1154 name_text = _name_text
1155 name_matches.extend(_name_matches)
1156 if name_text:
1157 return name_text, name_matches
1158
1065 1159 # if text is either None or an empty string, rely on the line buffer
1066 1160 if not text:
1067 1161 text = self.splitter.split_line(line_buffer, cursor_pos)
1068 1162
1069 1163 # If no line buffer is given, assume the input text is all there was
1070 1164 if line_buffer is None:
1071 1165 line_buffer = text
1072 1166
1073 1167 self.line_buffer = line_buffer
1074 1168 self.text_until_cursor = self.line_buffer[:cursor_pos]
1075 1169 # io.rprint('COMP2 %r %r %r' % (text, line_buffer, cursor_pos)) # dbg
1076 1170
1077 1171 # Start with a clean slate of completions
1078 1172 self.matches[:] = []
1079 1173 custom_res = self.dispatch_custom_completer(text)
1080 1174 if custom_res is not None:
1081 1175 # did custom completers produce something?
1082 1176 self.matches = custom_res
1083 1177 else:
1084 1178 # Extend the list of completions with the results of each
1085 1179 # matcher, so we return results to the user from all
1086 1180 # namespaces.
1087 1181 if self.merge_completions:
1088 1182 self.matches = []
1089 1183 for matcher in self.matchers:
1090 1184 try:
1091 1185 self.matches.extend(matcher(text))
1092 1186 except:
1093 1187 # Show the ugly traceback if the matcher causes an
1094 1188 # exception, but do NOT crash the kernel!
1095 1189 sys.excepthook(*sys.exc_info())
1096 1190 else:
1097 1191 for matcher in self.matchers:
1098 1192 self.matches = matcher(text)
1099 1193 if self.matches:
1100 1194 break
1101 1195 # FIXME: we should extend our api to return a dict with completions for
1102 1196 # different types of objects. The rlcomplete() method could then
1103 1197 # simply collapse the dict into a list for readline, but we'd have
1104 1198 # richer completion semantics in other evironments.
1105 1199
1106 1200 # use penalize_magics_key to put magics after variables with same name
1107 1201 self.matches = sorted(set(self.matches), key=penalize_magics_key)
1108 1202
1109 1203 #io.rprint('COMP TEXT, MATCHES: %r, %r' % (text, self.matches)) # dbg
1110 1204 return text, self.matches
1111 1205
1112 1206 def rlcomplete(self, text, state):
1113 1207 """Return the state-th possible completion for 'text'.
1114 1208
1115 1209 This is called successively with state == 0, 1, 2, ... until it
1116 1210 returns None. The completion should begin with 'text'.
1117 1211
1118 1212 Parameters
1119 1213 ----------
1120 1214 text : string
1121 1215 Text to perform the completion on.
1122 1216
1123 1217 state : int
1124 1218 Counter used by readline.
1125 1219 """
1126 1220 if state==0:
1127 1221
1128 1222 self.line_buffer = line_buffer = self.readline.get_line_buffer()
1129 1223 cursor_pos = self.readline.get_endidx()
1130 1224
1131 1225 #io.rprint("\nRLCOMPLETE: %r %r %r" %
1132 1226 # (text, line_buffer, cursor_pos) ) # dbg
1133 1227
1134 1228 # if there is only a tab on a line with only whitespace, instead of
1135 1229 # the mostly useless 'do you want to see all million completions'
1136 1230 # message, just do the right thing and give the user his tab!
1137 1231 # Incidentally, this enables pasting of tabbed text from an editor
1138 1232 # (as long as autoindent is off).
1139 1233
1140 1234 # It should be noted that at least pyreadline still shows file
1141 1235 # completions - is there a way around it?
1142 1236
1143 1237 # don't apply this on 'dumb' terminals, such as emacs buffers, so
1144 1238 # we don't interfere with their own tab-completion mechanism.
1145 1239 if not (self.dumb_terminal or line_buffer.strip()):
1146 1240 self.readline.insert_text('\t')
1147 1241 sys.stdout.flush()
1148 1242 return None
1149 1243
1150 1244 # Note: debugging exceptions that may occur in completion is very
1151 1245 # tricky, because readline unconditionally silences them. So if
1152 1246 # during development you suspect a bug in the completion code, turn
1153 1247 # this flag on temporarily by uncommenting the second form (don't
1154 1248 # flip the value in the first line, as the '# dbg' marker can be
1155 1249 # automatically detected and is used elsewhere).
1156 1250 DEBUG = False
1157 1251 #DEBUG = True # dbg
1158 1252 if DEBUG:
1159 1253 try:
1160 1254 self.complete(text, line_buffer, cursor_pos)
1161 1255 except:
1162 1256 import traceback; traceback.print_exc()
1163 1257 else:
1164 1258 # The normal production version is here
1165 1259
1166 1260 # This method computes the self.matches array
1167 1261 self.complete(text, line_buffer, cursor_pos)
1168 1262
1169 1263 try:
1170 1264 return self.matches[state]
1171 1265 except IndexError:
1172 1266 return None
1267
@@ -1,1297 +1,1300 b''
1 1 # encoding: utf-8
2 2
3 3 # DO NOT EDIT THIS FILE BY HAND.
4 4
5 5 # To update this file, run the script /tools/gen_latex_symbols.py using Python 3
6 6
7 7 # This file is autogenerated from the file:
8 8 # https://raw.githubusercontent.com/JuliaLang/julia/master/base/latex_symbols.jl
9 9 # This original list is filtered to remove any unicode characters that are not valid
10 10 # Python identifiers.
11 11
12 12 latex_symbols = {
13 13
14 14 "\\^a" : "ᵃ",
15 15 "\\^b" : "ᵇ",
16 16 "\\^c" : "ᶜ",
17 17 "\\^d" : "ᵈ",
18 18 "\\^e" : "ᵉ",
19 19 "\\^f" : "ᶠ",
20 20 "\\^g" : "ᵍ",
21 21 "\\^h" : "ʰ",
22 22 "\\^i" : "ⁱ",
23 23 "\\^j" : "ʲ",
24 24 "\\^k" : "ᵏ",
25 25 "\\^l" : "ˡ",
26 26 "\\^m" : "ᵐ",
27 27 "\\^n" : "ⁿ",
28 28 "\\^o" : "ᵒ",
29 29 "\\^p" : "ᵖ",
30 30 "\\^r" : "ʳ",
31 31 "\\^s" : "ˢ",
32 32 "\\^t" : "ᵗ",
33 33 "\\^u" : "ᵘ",
34 34 "\\^v" : "ᵛ",
35 35 "\\^w" : "ʷ",
36 36 "\\^x" : "ˣ",
37 37 "\\^y" : "ʸ",
38 38 "\\^z" : "ᶻ",
39 39 "\\^A" : "ᴬ",
40 40 "\\^B" : "ᴮ",
41 41 "\\^D" : "ᴰ",
42 42 "\\^E" : "ᴱ",
43 43 "\\^G" : "ᴳ",
44 44 "\\^H" : "ᴴ",
45 45 "\\^I" : "ᴵ",
46 46 "\\^J" : "ᴶ",
47 47 "\\^K" : "ᴷ",
48 48 "\\^L" : "ᴸ",
49 49 "\\^M" : "ᴹ",
50 50 "\\^N" : "ᴺ",
51 51 "\\^O" : "ᴼ",
52 52 "\\^P" : "ᴾ",
53 53 "\\^R" : "ᴿ",
54 54 "\\^T" : "ᵀ",
55 55 "\\^U" : "ᵁ",
56 56 "\\^V" : "ⱽ",
57 57 "\\^W" : "ᵂ",
58 58 "\\^alpha" : "ᵅ",
59 59 "\\^beta" : "ᵝ",
60 60 "\\^gamma" : "ᵞ",
61 61 "\\^delta" : "ᵟ",
62 62 "\\^epsilon" : "ᵋ",
63 63 "\\^theta" : "ᶿ",
64 64 "\\^iota" : "ᶥ",
65 65 "\\^phi" : "ᵠ",
66 66 "\\^chi" : "ᵡ",
67 67 "\\^Phi" : "ᶲ",
68 68 "\\_a" : "ₐ",
69 69 "\\_e" : "ₑ",
70 70 "\\_h" : "ₕ",
71 71 "\\_i" : "ᵢ",
72 72 "\\_j" : "ⱼ",
73 73 "\\_k" : "ₖ",
74 74 "\\_l" : "ₗ",
75 75 "\\_m" : "ₘ",
76 76 "\\_n" : "ₙ",
77 77 "\\_o" : "ₒ",
78 78 "\\_p" : "ₚ",
79 79 "\\_r" : "ᵣ",
80 80 "\\_s" : "ₛ",
81 81 "\\_t" : "ₜ",
82 82 "\\_u" : "ᵤ",
83 83 "\\_v" : "ᵥ",
84 84 "\\_x" : "ₓ",
85 85 "\\_schwa" : "ₔ",
86 86 "\\_beta" : "ᵦ",
87 87 "\\_gamma" : "ᵧ",
88 88 "\\_rho" : "ᵨ",
89 89 "\\_phi" : "ᵩ",
90 90 "\\_chi" : "ᵪ",
91 91 "\\hbar" : "ħ",
92 92 "\\sout" : "̶",
93 93 "\\textordfeminine" : "ª",
94 94 "\\cdotp" : "·",
95 95 "\\textordmasculine" : "º",
96 96 "\\AA" : "Å",
97 97 "\\AE" : "Æ",
98 98 "\\DH" : "Ð",
99 99 "\\O" : "Ø",
100 100 "\\TH" : "Þ",
101 101 "\\ss" : "ß",
102 102 "\\aa" : "å",
103 103 "\\ae" : "æ",
104 104 "\\eth" : "ð",
105 105 "\\o" : "ø",
106 106 "\\th" : "þ",
107 107 "\\DJ" : "Đ",
108 108 "\\dj" : "đ",
109 109 "\\Elzxh" : "ħ",
110 110 "\\imath" : "ı",
111 111 "\\L" : "Ł",
112 112 "\\l" : "ł",
113 113 "\\NG" : "Ŋ",
114 114 "\\ng" : "ŋ",
115 115 "\\OE" : "Œ",
116 116 "\\oe" : "œ",
117 117 "\\texthvlig" : "ƕ",
118 118 "\\textnrleg" : "ƞ",
119 119 "\\textdoublepipe" : "ǂ",
120 120 "\\Elztrna" : "ɐ",
121 121 "\\Elztrnsa" : "ɒ",
122 122 "\\Elzopeno" : "ɔ",
123 123 "\\Elzrtld" : "ɖ",
124 124 "\\Elzschwa" : "ə",
125 125 "\\varepsilon" : "ɛ",
126 126 "\\Elzpgamma" : "ɣ",
127 127 "\\Elzpbgam" : "ɤ",
128 128 "\\Elztrnh" : "ɥ",
129 129 "\\Elzbtdl" : "ɬ",
130 130 "\\Elzrtll" : "ɭ",
131 131 "\\Elztrnm" : "ɯ",
132 132 "\\Elztrnmlr" : "ɰ",
133 133 "\\Elzltlmr" : "ɱ",
134 134 "\\Elzltln" : "ɲ",
135 135 "\\Elzrtln" : "ɳ",
136 136 "\\Elzclomeg" : "ɷ",
137 137 "\\textphi" : "ɸ",
138 138 "\\Elztrnr" : "ɹ",
139 139 "\\Elztrnrl" : "ɺ",
140 140 "\\Elzrttrnr" : "ɻ",
141 141 "\\Elzrl" : "ɼ",
142 142 "\\Elzrtlr" : "ɽ",
143 143 "\\Elzfhr" : "ɾ",
144 144 "\\Elzrtls" : "ʂ",
145 145 "\\Elzesh" : "ʃ",
146 146 "\\Elztrnt" : "ʇ",
147 147 "\\Elzrtlt" : "ʈ",
148 148 "\\Elzpupsil" : "ʊ",
149 149 "\\Elzpscrv" : "ʋ",
150 150 "\\Elzinvv" : "ʌ",
151 151 "\\Elzinvw" : "ʍ",
152 152 "\\Elztrny" : "ʎ",
153 153 "\\Elzrtlz" : "ʐ",
154 154 "\\Elzyogh" : "ʒ",
155 155 "\\Elzglst" : "ʔ",
156 156 "\\Elzreglst" : "ʕ",
157 157 "\\Elzinglst" : "ʖ",
158 158 "\\textturnk" : "ʞ",
159 159 "\\Elzdyogh" : "ʤ",
160 160 "\\Elztesh" : "ʧ",
161 161 "\\rasp" : "ʼ",
162 162 "\\textasciicaron" : "ˇ",
163 163 "\\Elzverts" : "ˈ",
164 164 "\\Elzverti" : "ˌ",
165 165 "\\Elzlmrk" : "ː",
166 166 "\\Elzhlmrk" : "ˑ",
167 167 "\\grave" : "̀",
168 168 "\\acute" : "́",
169 169 "\\hat" : "̂",
170 170 "\\tilde" : "̃",
171 171 "\\bar" : "̄",
172 172 "\\breve" : "̆",
173 173 "\\dot" : "̇",
174 174 "\\ddot" : "̈",
175 175 "\\ocirc" : "̊",
176 176 "\\H" : "̋",
177 177 "\\check" : "̌",
178 178 "\\Elzpalh" : "̡",
179 179 "\\Elzrh" : "̢",
180 180 "\\c" : "̧",
181 181 "\\k" : "̨",
182 182 "\\Elzsbbrg" : "̪",
183 183 "\\Elzxl" : "̵",
184 184 "\\Elzbar" : "̶",
185 185 "\\Alpha" : "Α",
186 186 "\\Beta" : "Β",
187 187 "\\Gamma" : "Γ",
188 188 "\\Delta" : "Δ",
189 189 "\\Epsilon" : "Ε",
190 190 "\\Zeta" : "Ζ",
191 191 "\\Eta" : "Η",
192 192 "\\Theta" : "Θ",
193 193 "\\Iota" : "Ι",
194 194 "\\Kappa" : "Κ",
195 195 "\\Lambda" : "Λ",
196 196 "\\Xi" : "Ξ",
197 197 "\\Pi" : "Π",
198 198 "\\Rho" : "Ρ",
199 199 "\\Sigma" : "Σ",
200 200 "\\Tau" : "Τ",
201 201 "\\Upsilon" : "Υ",
202 202 "\\Phi" : "Φ",
203 203 "\\Chi" : "Χ",
204 204 "\\Psi" : "Ψ",
205 205 "\\Omega" : "Ω",
206 206 "\\alpha" : "α",
207 207 "\\beta" : "β",
208 208 "\\gamma" : "γ",
209 209 "\\delta" : "δ",
210 210 "\\zeta" : "ζ",
211 211 "\\eta" : "η",
212 212 "\\theta" : "θ",
213 213 "\\iota" : "ι",
214 214 "\\kappa" : "κ",
215 215 "\\lambda" : "λ",
216 216 "\\mu" : "μ",
217 217 "\\nu" : "ν",
218 218 "\\xi" : "ξ",
219 219 "\\pi" : "π",
220 220 "\\rho" : "ρ",
221 221 "\\varsigma" : "ς",
222 222 "\\sigma" : "σ",
223 223 "\\tau" : "τ",
224 224 "\\upsilon" : "υ",
225 225 "\\varphi" : "φ",
226 226 "\\chi" : "χ",
227 227 "\\psi" : "ψ",
228 228 "\\omega" : "ω",
229 229 "\\vartheta" : "ϑ",
230 230 "\\phi" : "ϕ",
231 231 "\\varpi" : "ϖ",
232 232 "\\Stigma" : "Ϛ",
233 233 "\\Digamma" : "Ϝ",
234 234 "\\digamma" : "ϝ",
235 235 "\\Koppa" : "Ϟ",
236 236 "\\Sampi" : "Ϡ",
237 237 "\\varkappa" : "ϰ",
238 238 "\\varrho" : "ϱ",
239 239 "\\textTheta" : "ϴ",
240 240 "\\epsilon" : "ϵ",
241 241 "\\dddot" : "⃛",
242 242 "\\ddddot" : "⃜",
243 243 "\\hslash" : "ℏ",
244 244 "\\Im" : "ℑ",
245 245 "\\ell" : "ℓ",
246 246 "\\wp" : "℘",
247 247 "\\Re" : "ℜ",
248 248 "\\aleph" : "ℵ",
249 249 "\\beth" : "ℶ",
250 250 "\\gimel" : "ℷ",
251 251 "\\daleth" : "ℸ",
252 252 "\\BbbPi" : "ℿ",
253 253 "\\Zbar" : "Ƶ",
254 254 "\\overbar" : "̅",
255 255 "\\ovhook" : "̉",
256 256 "\\candra" : "̐",
257 257 "\\oturnedcomma" : "̒",
258 258 "\\ocommatopright" : "̕",
259 259 "\\droang" : "̚",
260 260 "\\wideutilde" : "̰",
261 261 "\\underbar" : "̱",
262 262 "\\not" : "̸",
263 263 "\\upMu" : "Μ",
264 264 "\\upNu" : "Ν",
265 265 "\\upOmicron" : "Ο",
266 266 "\\upepsilon" : "ε",
267 267 "\\upomicron" : "ο",
268 268 "\\upvarbeta" : "ϐ",
269 269 "\\upoldKoppa" : "Ϙ",
270 270 "\\upoldkoppa" : "ϙ",
271 271 "\\upstigma" : "ϛ",
272 272 "\\upkoppa" : "ϟ",
273 273 "\\upsampi" : "ϡ",
274 274 "\\tieconcat" : "⁀",
275 275 "\\leftharpoonaccent" : "⃐",
276 276 "\\rightharpoonaccent" : "⃑",
277 277 "\\vertoverlay" : "⃒",
278 278 "\\overleftarrow" : "⃖",
279 279 "\\vec" : "⃗",
280 280 "\\overleftrightarrow" : "⃡",
281 281 "\\annuity" : "⃧",
282 282 "\\threeunderdot" : "⃨",
283 283 "\\widebridgeabove" : "⃩",
284 284 "\\BbbC" : "ℂ",
285 285 "\\Eulerconst" : "ℇ",
286 286 "\\mscrg" : "ℊ",
287 287 "\\mscrH" : "ℋ",
288 288 "\\mfrakH" : "ℌ",
289 289 "\\BbbH" : "ℍ",
290 290 "\\Planckconst" : "ℎ",
291 291 "\\mscrI" : "ℐ",
292 292 "\\mscrL" : "ℒ",
293 293 "\\BbbN" : "ℕ",
294 294 "\\BbbP" : "ℙ",
295 295 "\\BbbQ" : "ℚ",
296 296 "\\mscrR" : "ℛ",
297 297 "\\BbbR" : "ℝ",
298 298 "\\BbbZ" : "ℤ",
299 299 "\\mfrakZ" : "ℨ",
300 300 "\\Angstrom" : "Å",
301 301 "\\mscrB" : "ℬ",
302 302 "\\mfrakC" : "ℭ",
303 303 "\\mscre" : "ℯ",
304 304 "\\mscrE" : "ℰ",
305 305 "\\mscrF" : "ℱ",
306 306 "\\Finv" : "Ⅎ",
307 307 "\\mscrM" : "ℳ",
308 308 "\\mscro" : "ℴ",
309 309 "\\Bbbgamma" : "ℽ",
310 310 "\\BbbGamma" : "ℾ",
311 311 "\\mitBbbD" : "ⅅ",
312 312 "\\mitBbbd" : "ⅆ",
313 313 "\\mitBbbe" : "ⅇ",
314 314 "\\mitBbbi" : "ⅈ",
315 315 "\\mitBbbj" : "ⅉ",
316 316 "\\mbfA" : "𝐀",
317 317 "\\mbfB" : "𝐁",
318 318 "\\mbfC" : "𝐂",
319 319 "\\mbfD" : "𝐃",
320 320 "\\mbfE" : "𝐄",
321 321 "\\mbfF" : "𝐅",
322 322 "\\mbfG" : "𝐆",
323 323 "\\mbfH" : "𝐇",
324 324 "\\mbfI" : "𝐈",
325 325 "\\mbfJ" : "𝐉",
326 326 "\\mbfK" : "𝐊",
327 327 "\\mbfL" : "𝐋",
328 328 "\\mbfM" : "𝐌",
329 329 "\\mbfN" : "𝐍",
330 330 "\\mbfO" : "𝐎",
331 331 "\\mbfP" : "𝐏",
332 332 "\\mbfQ" : "𝐐",
333 333 "\\mbfR" : "𝐑",
334 334 "\\mbfS" : "𝐒",
335 335 "\\mbfT" : "𝐓",
336 336 "\\mbfU" : "𝐔",
337 337 "\\mbfV" : "𝐕",
338 338 "\\mbfW" : "𝐖",
339 339 "\\mbfX" : "𝐗",
340 340 "\\mbfY" : "𝐘",
341 341 "\\mbfZ" : "𝐙",
342 342 "\\mbfa" : "𝐚",
343 343 "\\mbfb" : "𝐛",
344 344 "\\mbfc" : "𝐜",
345 345 "\\mbfd" : "𝐝",
346 346 "\\mbfe" : "𝐞",
347 347 "\\mbff" : "𝐟",
348 348 "\\mbfg" : "𝐠",
349 349 "\\mbfh" : "𝐡",
350 350 "\\mbfi" : "𝐢",
351 351 "\\mbfj" : "𝐣",
352 352 "\\mbfk" : "𝐤",
353 353 "\\mbfl" : "𝐥",
354 354 "\\mbfm" : "𝐦",
355 355 "\\mbfn" : "𝐧",
356 356 "\\mbfo" : "𝐨",
357 357 "\\mbfp" : "𝐩",
358 358 "\\mbfq" : "𝐪",
359 359 "\\mbfr" : "𝐫",
360 360 "\\mbfs" : "𝐬",
361 361 "\\mbft" : "𝐭",
362 362 "\\mbfu" : "𝐮",
363 363 "\\mbfv" : "𝐯",
364 364 "\\mbfw" : "𝐰",
365 365 "\\mbfx" : "𝐱",
366 366 "\\mbfy" : "𝐲",
367 367 "\\mbfz" : "𝐳",
368 368 "\\mitA" : "𝐴",
369 369 "\\mitB" : "𝐵",
370 370 "\\mitC" : "𝐶",
371 371 "\\mitD" : "𝐷",
372 372 "\\mitE" : "𝐸",
373 373 "\\mitF" : "𝐹",
374 374 "\\mitG" : "𝐺",
375 375 "\\mitH" : "𝐻",
376 376 "\\mitI" : "𝐼",
377 377 "\\mitJ" : "𝐽",
378 378 "\\mitK" : "𝐾",
379 379 "\\mitL" : "𝐿",
380 380 "\\mitM" : "𝑀",
381 381 "\\mitN" : "𝑁",
382 382 "\\mitO" : "𝑂",
383 383 "\\mitP" : "𝑃",
384 384 "\\mitQ" : "𝑄",
385 385 "\\mitR" : "𝑅",
386 386 "\\mitS" : "𝑆",
387 387 "\\mitT" : "𝑇",
388 388 "\\mitU" : "𝑈",
389 389 "\\mitV" : "𝑉",
390 390 "\\mitW" : "𝑊",
391 391 "\\mitX" : "𝑋",
392 392 "\\mitY" : "𝑌",
393 393 "\\mitZ" : "𝑍",
394 394 "\\mita" : "𝑎",
395 395 "\\mitb" : "𝑏",
396 396 "\\mitc" : "𝑐",
397 397 "\\mitd" : "𝑑",
398 398 "\\mite" : "𝑒",
399 399 "\\mitf" : "𝑓",
400 400 "\\mitg" : "𝑔",
401 401 "\\miti" : "𝑖",
402 402 "\\mitj" : "𝑗",
403 403 "\\mitk" : "𝑘",
404 404 "\\mitl" : "𝑙",
405 405 "\\mitm" : "𝑚",
406 406 "\\mitn" : "𝑛",
407 407 "\\mito" : "𝑜",
408 408 "\\mitp" : "𝑝",
409 409 "\\mitq" : "𝑞",
410 410 "\\mitr" : "𝑟",
411 411 "\\mits" : "𝑠",
412 412 "\\mitt" : "𝑡",
413 413 "\\mitu" : "𝑢",
414 414 "\\mitv" : "𝑣",
415 415 "\\mitw" : "𝑤",
416 416 "\\mitx" : "𝑥",
417 417 "\\mity" : "𝑦",
418 418 "\\mitz" : "𝑧",
419 419 "\\mbfitA" : "𝑨",
420 420 "\\mbfitB" : "𝑩",
421 421 "\\mbfitC" : "𝑪",
422 422 "\\mbfitD" : "𝑫",
423 423 "\\mbfitE" : "𝑬",
424 424 "\\mbfitF" : "𝑭",
425 425 "\\mbfitG" : "𝑮",
426 426 "\\mbfitH" : "𝑯",
427 427 "\\mbfitI" : "𝑰",
428 428 "\\mbfitJ" : "𝑱",
429 429 "\\mbfitK" : "𝑲",
430 430 "\\mbfitL" : "𝑳",
431 431 "\\mbfitM" : "𝑴",
432 432 "\\mbfitN" : "𝑵",
433 433 "\\mbfitO" : "𝑶",
434 434 "\\mbfitP" : "𝑷",
435 435 "\\mbfitQ" : "𝑸",
436 436 "\\mbfitR" : "𝑹",
437 437 "\\mbfitS" : "𝑺",
438 438 "\\mbfitT" : "𝑻",
439 439 "\\mbfitU" : "𝑼",
440 440 "\\mbfitV" : "𝑽",
441 441 "\\mbfitW" : "𝑾",
442 442 "\\mbfitX" : "𝑿",
443 443 "\\mbfitY" : "𝒀",
444 444 "\\mbfitZ" : "𝒁",
445 445 "\\mbfita" : "𝒂",
446 446 "\\mbfitb" : "𝒃",
447 447 "\\mbfitc" : "𝒄",
448 448 "\\mbfitd" : "𝒅",
449 449 "\\mbfite" : "𝒆",
450 450 "\\mbfitf" : "𝒇",
451 451 "\\mbfitg" : "𝒈",
452 452 "\\mbfith" : "𝒉",
453 453 "\\mbfiti" : "𝒊",
454 454 "\\mbfitj" : "𝒋",
455 455 "\\mbfitk" : "𝒌",
456 456 "\\mbfitl" : "𝒍",
457 457 "\\mbfitm" : "𝒎",
458 458 "\\mbfitn" : "𝒏",
459 459 "\\mbfito" : "𝒐",
460 460 "\\mbfitp" : "𝒑",
461 461 "\\mbfitq" : "𝒒",
462 462 "\\mbfitr" : "𝒓",
463 463 "\\mbfits" : "𝒔",
464 464 "\\mbfitt" : "𝒕",
465 465 "\\mbfitu" : "𝒖",
466 466 "\\mbfitv" : "𝒗",
467 467 "\\mbfitw" : "𝒘",
468 468 "\\mbfitx" : "𝒙",
469 469 "\\mbfity" : "𝒚",
470 470 "\\mbfitz" : "𝒛",
471 471 "\\mscrA" : "𝒜",
472 472 "\\mscrC" : "𝒞",
473 473 "\\mscrD" : "𝒟",
474 474 "\\mscrG" : "𝒢",
475 475 "\\mscrJ" : "𝒥",
476 476 "\\mscrK" : "𝒦",
477 477 "\\mscrN" : "𝒩",
478 478 "\\mscrO" : "𝒪",
479 479 "\\mscrP" : "𝒫",
480 480 "\\mscrQ" : "𝒬",
481 481 "\\mscrS" : "𝒮",
482 482 "\\mscrT" : "𝒯",
483 483 "\\mscrU" : "𝒰",
484 484 "\\mscrV" : "𝒱",
485 485 "\\mscrW" : "𝒲",
486 486 "\\mscrX" : "𝒳",
487 487 "\\mscrY" : "𝒴",
488 488 "\\mscrZ" : "𝒵",
489 489 "\\mscra" : "𝒶",
490 490 "\\mscrb" : "𝒷",
491 491 "\\mscrc" : "𝒸",
492 492 "\\mscrd" : "𝒹",
493 493 "\\mscrf" : "𝒻",
494 494 "\\mscrh" : "𝒽",
495 495 "\\mscri" : "𝒾",
496 496 "\\mscrj" : "𝒿",
497 497 "\\mscrk" : "𝓀",
498 498 "\\mscrm" : "𝓂",
499 499 "\\mscrn" : "𝓃",
500 500 "\\mscrp" : "𝓅",
501 501 "\\mscrq" : "𝓆",
502 502 "\\mscrr" : "𝓇",
503 503 "\\mscrs" : "𝓈",
504 504 "\\mscrt" : "𝓉",
505 505 "\\mscru" : "𝓊",
506 506 "\\mscrv" : "𝓋",
507 507 "\\mscrw" : "𝓌",
508 508 "\\mscrx" : "𝓍",
509 509 "\\mscry" : "𝓎",
510 510 "\\mscrz" : "𝓏",
511 511 "\\mbfscrA" : "𝓐",
512 512 "\\mbfscrB" : "𝓑",
513 513 "\\mbfscrC" : "𝓒",
514 514 "\\mbfscrD" : "𝓓",
515 515 "\\mbfscrE" : "𝓔",
516 516 "\\mbfscrF" : "𝓕",
517 517 "\\mbfscrG" : "𝓖",
518 518 "\\mbfscrH" : "𝓗",
519 519 "\\mbfscrI" : "𝓘",
520 520 "\\mbfscrJ" : "𝓙",
521 521 "\\mbfscrK" : "𝓚",
522 522 "\\mbfscrL" : "𝓛",
523 523 "\\mbfscrM" : "𝓜",
524 524 "\\mbfscrN" : "𝓝",
525 525 "\\mbfscrO" : "𝓞",
526 526 "\\mbfscrP" : "𝓟",
527 527 "\\mbfscrQ" : "𝓠",
528 528 "\\mbfscrR" : "𝓡",
529 529 "\\mbfscrS" : "𝓢",
530 530 "\\mbfscrT" : "𝓣",
531 531 "\\mbfscrU" : "𝓤",
532 532 "\\mbfscrV" : "𝓥",
533 533 "\\mbfscrW" : "𝓦",
534 534 "\\mbfscrX" : "𝓧",
535 535 "\\mbfscrY" : "𝓨",
536 536 "\\mbfscrZ" : "𝓩",
537 537 "\\mbfscra" : "𝓪",
538 538 "\\mbfscrb" : "𝓫",
539 539 "\\mbfscrc" : "𝓬",
540 540 "\\mbfscrd" : "𝓭",
541 541 "\\mbfscre" : "𝓮",
542 542 "\\mbfscrf" : "𝓯",
543 543 "\\mbfscrg" : "𝓰",
544 544 "\\mbfscrh" : "𝓱",
545 545 "\\mbfscri" : "𝓲",
546 546 "\\mbfscrj" : "𝓳",
547 547 "\\mbfscrk" : "𝓴",
548 548 "\\mbfscrl" : "𝓵",
549 549 "\\mbfscrm" : "𝓶",
550 550 "\\mbfscrn" : "𝓷",
551 551 "\\mbfscro" : "𝓸",
552 552 "\\mbfscrp" : "𝓹",
553 553 "\\mbfscrq" : "𝓺",
554 554 "\\mbfscrr" : "𝓻",
555 555 "\\mbfscrs" : "𝓼",
556 556 "\\mbfscrt" : "𝓽",
557 557 "\\mbfscru" : "𝓾",
558 558 "\\mbfscrv" : "𝓿",
559 559 "\\mbfscrw" : "𝔀",
560 560 "\\mbfscrx" : "𝔁",
561 561 "\\mbfscry" : "𝔂",
562 562 "\\mbfscrz" : "𝔃",
563 563 "\\mfrakA" : "𝔄",
564 564 "\\mfrakB" : "𝔅",
565 565 "\\mfrakD" : "𝔇",
566 566 "\\mfrakE" : "𝔈",
567 567 "\\mfrakF" : "𝔉",
568 568 "\\mfrakG" : "𝔊",
569 569 "\\mfrakJ" : "𝔍",
570 570 "\\mfrakK" : "𝔎",
571 571 "\\mfrakL" : "𝔏",
572 572 "\\mfrakM" : "𝔐",
573 573 "\\mfrakN" : "𝔑",
574 574 "\\mfrakO" : "𝔒",
575 575 "\\mfrakP" : "𝔓",
576 576 "\\mfrakQ" : "𝔔",
577 577 "\\mfrakS" : "𝔖",
578 578 "\\mfrakT" : "𝔗",
579 579 "\\mfrakU" : "𝔘",
580 580 "\\mfrakV" : "𝔙",
581 581 "\\mfrakW" : "𝔚",
582 582 "\\mfrakX" : "𝔛",
583 583 "\\mfrakY" : "𝔜",
584 584 "\\mfraka" : "𝔞",
585 585 "\\mfrakb" : "𝔟",
586 586 "\\mfrakc" : "𝔠",
587 587 "\\mfrakd" : "𝔡",
588 588 "\\mfrake" : "𝔢",
589 589 "\\mfrakf" : "𝔣",
590 590 "\\mfrakg" : "𝔤",
591 591 "\\mfrakh" : "𝔥",
592 592 "\\mfraki" : "𝔦",
593 593 "\\mfrakj" : "𝔧",
594 594 "\\mfrakk" : "𝔨",
595 595 "\\mfrakl" : "𝔩",
596 596 "\\mfrakm" : "𝔪",
597 597 "\\mfrakn" : "𝔫",
598 598 "\\mfrako" : "𝔬",
599 599 "\\mfrakp" : "𝔭",
600 600 "\\mfrakq" : "𝔮",
601 601 "\\mfrakr" : "𝔯",
602 602 "\\mfraks" : "𝔰",
603 603 "\\mfrakt" : "𝔱",
604 604 "\\mfraku" : "𝔲",
605 605 "\\mfrakv" : "𝔳",
606 606 "\\mfrakw" : "𝔴",
607 607 "\\mfrakx" : "𝔵",
608 608 "\\mfraky" : "𝔶",
609 609 "\\mfrakz" : "𝔷",
610 610 "\\BbbA" : "𝔸",
611 611 "\\BbbB" : "𝔹",
612 612 "\\BbbD" : "𝔻",
613 613 "\\BbbE" : "𝔼",
614 614 "\\BbbF" : "𝔽",
615 615 "\\BbbG" : "𝔾",
616 616 "\\BbbI" : "𝕀",
617 617 "\\BbbJ" : "𝕁",
618 618 "\\BbbK" : "𝕂",
619 619 "\\BbbL" : "𝕃",
620 620 "\\BbbM" : "𝕄",
621 621 "\\BbbO" : "𝕆",
622 622 "\\BbbS" : "𝕊",
623 623 "\\BbbT" : "𝕋",
624 624 "\\BbbU" : "𝕌",
625 625 "\\BbbV" : "𝕍",
626 626 "\\BbbW" : "𝕎",
627 627 "\\BbbX" : "𝕏",
628 628 "\\BbbY" : "𝕐",
629 629 "\\Bbba" : "𝕒",
630 630 "\\Bbbb" : "𝕓",
631 631 "\\Bbbc" : "𝕔",
632 632 "\\Bbbd" : "𝕕",
633 633 "\\Bbbe" : "𝕖",
634 634 "\\Bbbf" : "𝕗",
635 635 "\\Bbbg" : "𝕘",
636 636 "\\Bbbh" : "𝕙",
637 637 "\\Bbbi" : "𝕚",
638 638 "\\Bbbj" : "𝕛",
639 639 "\\Bbbk" : "𝕜",
640 640 "\\Bbbl" : "𝕝",
641 641 "\\Bbbm" : "𝕞",
642 642 "\\Bbbn" : "𝕟",
643 643 "\\Bbbo" : "𝕠",
644 644 "\\Bbbp" : "𝕡",
645 645 "\\Bbbq" : "𝕢",
646 646 "\\Bbbr" : "𝕣",
647 647 "\\Bbbs" : "𝕤",
648 648 "\\Bbbt" : "𝕥",
649 649 "\\Bbbu" : "𝕦",
650 650 "\\Bbbv" : "𝕧",
651 651 "\\Bbbw" : "𝕨",
652 652 "\\Bbbx" : "𝕩",
653 653 "\\Bbby" : "𝕪",
654 654 "\\Bbbz" : "𝕫",
655 655 "\\mbffrakA" : "𝕬",
656 656 "\\mbffrakB" : "𝕭",
657 657 "\\mbffrakC" : "𝕮",
658 658 "\\mbffrakD" : "𝕯",
659 659 "\\mbffrakE" : "𝕰",
660 660 "\\mbffrakF" : "𝕱",
661 661 "\\mbffrakG" : "𝕲",
662 662 "\\mbffrakH" : "𝕳",
663 663 "\\mbffrakI" : "𝕴",
664 664 "\\mbffrakJ" : "𝕵",
665 665 "\\mbffrakK" : "𝕶",
666 666 "\\mbffrakL" : "𝕷",
667 667 "\\mbffrakM" : "𝕸",
668 668 "\\mbffrakN" : "𝕹",
669 669 "\\mbffrakO" : "𝕺",
670 670 "\\mbffrakP" : "𝕻",
671 671 "\\mbffrakQ" : "𝕼",
672 672 "\\mbffrakR" : "𝕽",
673 673 "\\mbffrakS" : "𝕾",
674 674 "\\mbffrakT" : "𝕿",
675 675 "\\mbffrakU" : "𝖀",
676 676 "\\mbffrakV" : "𝖁",
677 677 "\\mbffrakW" : "𝖂",
678 678 "\\mbffrakX" : "𝖃",
679 679 "\\mbffrakY" : "𝖄",
680 680 "\\mbffrakZ" : "𝖅",
681 681 "\\mbffraka" : "𝖆",
682 682 "\\mbffrakb" : "𝖇",
683 683 "\\mbffrakc" : "𝖈",
684 684 "\\mbffrakd" : "𝖉",
685 685 "\\mbffrake" : "𝖊",
686 686 "\\mbffrakf" : "𝖋",
687 687 "\\mbffrakg" : "𝖌",
688 688 "\\mbffrakh" : "𝖍",
689 689 "\\mbffraki" : "𝖎",
690 690 "\\mbffrakj" : "𝖏",
691 691 "\\mbffrakk" : "𝖐",
692 692 "\\mbffrakl" : "𝖑",
693 693 "\\mbffrakm" : "𝖒",
694 694 "\\mbffrakn" : "𝖓",
695 695 "\\mbffrako" : "𝖔",
696 696 "\\mbffrakp" : "𝖕",
697 697 "\\mbffrakq" : "𝖖",
698 698 "\\mbffrakr" : "𝖗",
699 699 "\\mbffraks" : "𝖘",
700 700 "\\mbffrakt" : "𝖙",
701 701 "\\mbffraku" : "𝖚",
702 702 "\\mbffrakv" : "𝖛",
703 703 "\\mbffrakw" : "𝖜",
704 704 "\\mbffrakx" : "𝖝",
705 705 "\\mbffraky" : "𝖞",
706 706 "\\mbffrakz" : "𝖟",
707 707 "\\msansA" : "𝖠",
708 708 "\\msansB" : "𝖡",
709 709 "\\msansC" : "𝖢",
710 710 "\\msansD" : "𝖣",
711 711 "\\msansE" : "𝖤",
712 712 "\\msansF" : "𝖥",
713 713 "\\msansG" : "𝖦",
714 714 "\\msansH" : "𝖧",
715 715 "\\msansI" : "𝖨",
716 716 "\\msansJ" : "𝖩",
717 717 "\\msansK" : "𝖪",
718 718 "\\msansL" : "𝖫",
719 719 "\\msansM" : "𝖬",
720 720 "\\msansN" : "𝖭",
721 721 "\\msansO" : "𝖮",
722 722 "\\msansP" : "𝖯",
723 723 "\\msansQ" : "𝖰",
724 724 "\\msansR" : "𝖱",
725 725 "\\msansS" : "𝖲",
726 726 "\\msansT" : "𝖳",
727 727 "\\msansU" : "𝖴",
728 728 "\\msansV" : "𝖵",
729 729 "\\msansW" : "𝖶",
730 730 "\\msansX" : "𝖷",
731 731 "\\msansY" : "𝖸",
732 732 "\\msansZ" : "𝖹",
733 733 "\\msansa" : "𝖺",
734 734 "\\msansb" : "𝖻",
735 735 "\\msansc" : "𝖼",
736 736 "\\msansd" : "𝖽",
737 737 "\\msanse" : "𝖾",
738 738 "\\msansf" : "𝖿",
739 739 "\\msansg" : "𝗀",
740 740 "\\msansh" : "𝗁",
741 741 "\\msansi" : "𝗂",
742 742 "\\msansj" : "𝗃",
743 743 "\\msansk" : "𝗄",
744 744 "\\msansl" : "𝗅",
745 745 "\\msansm" : "𝗆",
746 746 "\\msansn" : "𝗇",
747 747 "\\msanso" : "𝗈",
748 748 "\\msansp" : "𝗉",
749 749 "\\msansq" : "𝗊",
750 750 "\\msansr" : "𝗋",
751 751 "\\msanss" : "𝗌",
752 752 "\\msanst" : "𝗍",
753 753 "\\msansu" : "𝗎",
754 754 "\\msansv" : "𝗏",
755 755 "\\msansw" : "𝗐",
756 756 "\\msansx" : "𝗑",
757 757 "\\msansy" : "𝗒",
758 758 "\\msansz" : "𝗓",
759 759 "\\mbfsansA" : "𝗔",
760 760 "\\mbfsansB" : "𝗕",
761 761 "\\mbfsansC" : "𝗖",
762 762 "\\mbfsansD" : "𝗗",
763 763 "\\mbfsansE" : "𝗘",
764 764 "\\mbfsansF" : "𝗙",
765 765 "\\mbfsansG" : "𝗚",
766 766 "\\mbfsansH" : "𝗛",
767 767 "\\mbfsansI" : "𝗜",
768 768 "\\mbfsansJ" : "𝗝",
769 769 "\\mbfsansK" : "𝗞",
770 770 "\\mbfsansL" : "𝗟",
771 771 "\\mbfsansM" : "𝗠",
772 772 "\\mbfsansN" : "𝗡",
773 773 "\\mbfsansO" : "𝗢",
774 774 "\\mbfsansP" : "𝗣",
775 775 "\\mbfsansQ" : "𝗤",
776 776 "\\mbfsansR" : "𝗥",
777 777 "\\mbfsansS" : "𝗦",
778 778 "\\mbfsansT" : "𝗧",
779 779 "\\mbfsansU" : "𝗨",
780 780 "\\mbfsansV" : "𝗩",
781 781 "\\mbfsansW" : "𝗪",
782 782 "\\mbfsansX" : "𝗫",
783 783 "\\mbfsansY" : "𝗬",
784 784 "\\mbfsansZ" : "𝗭",
785 785 "\\mbfsansa" : "𝗮",
786 786 "\\mbfsansb" : "𝗯",
787 787 "\\mbfsansc" : "𝗰",
788 788 "\\mbfsansd" : "𝗱",
789 789 "\\mbfsanse" : "𝗲",
790 790 "\\mbfsansf" : "𝗳",
791 791 "\\mbfsansg" : "𝗴",
792 792 "\\mbfsansh" : "𝗵",
793 793 "\\mbfsansi" : "𝗶",
794 794 "\\mbfsansj" : "𝗷",
795 795 "\\mbfsansk" : "𝗸",
796 796 "\\mbfsansl" : "𝗹",
797 797 "\\mbfsansm" : "𝗺",
798 798 "\\mbfsansn" : "𝗻",
799 799 "\\mbfsanso" : "𝗼",
800 800 "\\mbfsansp" : "𝗽",
801 801 "\\mbfsansq" : "𝗾",
802 802 "\\mbfsansr" : "𝗿",
803 803 "\\mbfsanss" : "𝘀",
804 804 "\\mbfsanst" : "𝘁",
805 805 "\\mbfsansu" : "𝘂",
806 806 "\\mbfsansv" : "𝘃",
807 807 "\\mbfsansw" : "𝘄",
808 808 "\\mbfsansx" : "𝘅",
809 809 "\\mbfsansy" : "𝘆",
810 810 "\\mbfsansz" : "𝘇",
811 811 "\\mitsansA" : "𝘈",
812 812 "\\mitsansB" : "𝘉",
813 813 "\\mitsansC" : "𝘊",
814 814 "\\mitsansD" : "𝘋",
815 815 "\\mitsansE" : "𝘌",
816 816 "\\mitsansF" : "𝘍",
817 817 "\\mitsansG" : "𝘎",
818 818 "\\mitsansH" : "𝘏",
819 819 "\\mitsansI" : "𝘐",
820 820 "\\mitsansJ" : "𝘑",
821 821 "\\mitsansK" : "𝘒",
822 822 "\\mitsansL" : "𝘓",
823 823 "\\mitsansM" : "𝘔",
824 824 "\\mitsansN" : "𝘕",
825 825 "\\mitsansO" : "𝘖",
826 826 "\\mitsansP" : "𝘗",
827 827 "\\mitsansQ" : "𝘘",
828 828 "\\mitsansR" : "𝘙",
829 829 "\\mitsansS" : "𝘚",
830 830 "\\mitsansT" : "𝘛",
831 831 "\\mitsansU" : "𝘜",
832 832 "\\mitsansV" : "𝘝",
833 833 "\\mitsansW" : "𝘞",
834 834 "\\mitsansX" : "𝘟",
835 835 "\\mitsansY" : "𝘠",
836 836 "\\mitsansZ" : "𝘡",
837 837 "\\mitsansa" : "𝘢",
838 838 "\\mitsansb" : "𝘣",
839 839 "\\mitsansc" : "𝘤",
840 840 "\\mitsansd" : "𝘥",
841 841 "\\mitsanse" : "𝘦",
842 842 "\\mitsansf" : "𝘧",
843 843 "\\mitsansg" : "𝘨",
844 844 "\\mitsansh" : "𝘩",
845 845 "\\mitsansi" : "𝘪",
846 846 "\\mitsansj" : "𝘫",
847 847 "\\mitsansk" : "𝘬",
848 848 "\\mitsansl" : "𝘭",
849 849 "\\mitsansm" : "𝘮",
850 850 "\\mitsansn" : "𝘯",
851 851 "\\mitsanso" : "𝘰",
852 852 "\\mitsansp" : "𝘱",
853 853 "\\mitsansq" : "𝘲",
854 854 "\\mitsansr" : "𝘳",
855 855 "\\mitsanss" : "𝘴",
856 856 "\\mitsanst" : "𝘵",
857 857 "\\mitsansu" : "𝘶",
858 858 "\\mitsansv" : "𝘷",
859 859 "\\mitsansw" : "𝘸",
860 860 "\\mitsansx" : "𝘹",
861 861 "\\mitsansy" : "𝘺",
862 862 "\\mitsansz" : "𝘻",
863 863 "\\mbfitsansA" : "𝘼",
864 864 "\\mbfitsansB" : "𝘽",
865 865 "\\mbfitsansC" : "𝘾",
866 866 "\\mbfitsansD" : "𝘿",
867 867 "\\mbfitsansE" : "𝙀",
868 868 "\\mbfitsansF" : "𝙁",
869 869 "\\mbfitsansG" : "𝙂",
870 870 "\\mbfitsansH" : "𝙃",
871 871 "\\mbfitsansI" : "𝙄",
872 872 "\\mbfitsansJ" : "𝙅",
873 873 "\\mbfitsansK" : "𝙆",
874 874 "\\mbfitsansL" : "𝙇",
875 875 "\\mbfitsansM" : "𝙈",
876 876 "\\mbfitsansN" : "𝙉",
877 877 "\\mbfitsansO" : "𝙊",
878 878 "\\mbfitsansP" : "𝙋",
879 879 "\\mbfitsansQ" : "𝙌",
880 880 "\\mbfitsansR" : "𝙍",
881 881 "\\mbfitsansS" : "𝙎",
882 882 "\\mbfitsansT" : "𝙏",
883 883 "\\mbfitsansU" : "𝙐",
884 884 "\\mbfitsansV" : "𝙑",
885 885 "\\mbfitsansW" : "𝙒",
886 886 "\\mbfitsansX" : "𝙓",
887 887 "\\mbfitsansY" : "𝙔",
888 888 "\\mbfitsansZ" : "𝙕",
889 889 "\\mbfitsansa" : "𝙖",
890 890 "\\mbfitsansb" : "𝙗",
891 891 "\\mbfitsansc" : "𝙘",
892 892 "\\mbfitsansd" : "𝙙",
893 893 "\\mbfitsanse" : "𝙚",
894 894 "\\mbfitsansf" : "𝙛",
895 895 "\\mbfitsansg" : "𝙜",
896 896 "\\mbfitsansh" : "𝙝",
897 897 "\\mbfitsansi" : "𝙞",
898 898 "\\mbfitsansj" : "𝙟",
899 899 "\\mbfitsansk" : "𝙠",
900 900 "\\mbfitsansl" : "𝙡",
901 901 "\\mbfitsansm" : "𝙢",
902 902 "\\mbfitsansn" : "𝙣",
903 903 "\\mbfitsanso" : "𝙤",
904 904 "\\mbfitsansp" : "𝙥",
905 905 "\\mbfitsansq" : "𝙦",
906 906 "\\mbfitsansr" : "𝙧",
907 907 "\\mbfitsanss" : "𝙨",
908 908 "\\mbfitsanst" : "𝙩",
909 909 "\\mbfitsansu" : "𝙪",
910 910 "\\mbfitsansv" : "𝙫",
911 911 "\\mbfitsansw" : "𝙬",
912 912 "\\mbfitsansx" : "𝙭",
913 913 "\\mbfitsansy" : "𝙮",
914 914 "\\mbfitsansz" : "𝙯",
915 915 "\\mttA" : "𝙰",
916 916 "\\mttB" : "𝙱",
917 917 "\\mttC" : "𝙲",
918 918 "\\mttD" : "𝙳",
919 919 "\\mttE" : "𝙴",
920 920 "\\mttF" : "𝙵",
921 921 "\\mttG" : "𝙶",
922 922 "\\mttH" : "𝙷",
923 923 "\\mttI" : "𝙸",
924 924 "\\mttJ" : "𝙹",
925 925 "\\mttK" : "𝙺",
926 926 "\\mttL" : "𝙻",
927 927 "\\mttM" : "𝙼",
928 928 "\\mttN" : "𝙽",
929 929 "\\mttO" : "𝙾",
930 930 "\\mttP" : "𝙿",
931 931 "\\mttQ" : "𝚀",
932 932 "\\mttR" : "𝚁",
933 933 "\\mttS" : "𝚂",
934 934 "\\mttT" : "𝚃",
935 935 "\\mttU" : "𝚄",
936 936 "\\mttV" : "𝚅",
937 937 "\\mttW" : "𝚆",
938 938 "\\mttX" : "𝚇",
939 939 "\\mttY" : "𝚈",
940 940 "\\mttZ" : "𝚉",
941 941 "\\mtta" : "𝚊",
942 942 "\\mttb" : "𝚋",
943 943 "\\mttc" : "𝚌",
944 944 "\\mttd" : "𝚍",
945 945 "\\mtte" : "𝚎",
946 946 "\\mttf" : "𝚏",
947 947 "\\mttg" : "𝚐",
948 948 "\\mtth" : "𝚑",
949 949 "\\mtti" : "𝚒",
950 950 "\\mttj" : "𝚓",
951 951 "\\mttk" : "𝚔",
952 952 "\\mttl" : "𝚕",
953 953 "\\mttm" : "𝚖",
954 954 "\\mttn" : "𝚗",
955 955 "\\mtto" : "𝚘",
956 956 "\\mttp" : "𝚙",
957 957 "\\mttq" : "𝚚",
958 958 "\\mttr" : "𝚛",
959 959 "\\mtts" : "𝚜",
960 960 "\\mttt" : "𝚝",
961 961 "\\mttu" : "𝚞",
962 962 "\\mttv" : "𝚟",
963 963 "\\mttw" : "𝚠",
964 964 "\\mttx" : "𝚡",
965 965 "\\mtty" : "𝚢",
966 966 "\\mttz" : "𝚣",
967 967 "\\mbfAlpha" : "𝚨",
968 968 "\\mbfBeta" : "𝚩",
969 969 "\\mbfGamma" : "𝚪",
970 970 "\\mbfDelta" : "𝚫",
971 971 "\\mbfEpsilon" : "𝚬",
972 972 "\\mbfZeta" : "𝚭",
973 973 "\\mbfEta" : "𝚮",
974 974 "\\mbfTheta" : "𝚯",
975 975 "\\mbfIota" : "𝚰",
976 976 "\\mbfKappa" : "𝚱",
977 977 "\\mbfLambda" : "𝚲",
978 978 "\\mbfMu" : "𝚳",
979 979 "\\mbfNu" : "𝚴",
980 980 "\\mbfXi" : "𝚵",
981 981 "\\mbfOmicron" : "𝚶",
982 982 "\\mbfPi" : "𝚷",
983 983 "\\mbfRho" : "𝚸",
984 984 "\\mbfvarTheta" : "𝚹",
985 985 "\\mbfSigma" : "𝚺",
986 986 "\\mbfTau" : "𝚻",
987 987 "\\mbfUpsilon" : "𝚼",
988 988 "\\mbfPhi" : "𝚽",
989 989 "\\mbfChi" : "𝚾",
990 990 "\\mbfPsi" : "𝚿",
991 991 "\\mbfOmega" : "𝛀",
992 992 "\\mbfalpha" : "𝛂",
993 993 "\\mbfbeta" : "𝛃",
994 994 "\\mbfgamma" : "𝛄",
995 995 "\\mbfdelta" : "𝛅",
996 996 "\\mbfepsilon" : "𝛆",
997 997 "\\mbfzeta" : "𝛇",
998 998 "\\mbfeta" : "𝛈",
999 999 "\\mbftheta" : "𝛉",
1000 1000 "\\mbfiota" : "𝛊",
1001 1001 "\\mbfkappa" : "𝛋",
1002 1002 "\\mbflambda" : "𝛌",
1003 1003 "\\mbfmu" : "𝛍",
1004 1004 "\\mbfnu" : "𝛎",
1005 1005 "\\mbfxi" : "𝛏",
1006 1006 "\\mbfomicron" : "𝛐",
1007 1007 "\\mbfpi" : "𝛑",
1008 1008 "\\mbfrho" : "𝛒",
1009 1009 "\\mbfvarsigma" : "𝛓",
1010 1010 "\\mbfsigma" : "𝛔",
1011 1011 "\\mbftau" : "𝛕",
1012 1012 "\\mbfupsilon" : "𝛖",
1013 1013 "\\mbfvarphi" : "𝛗",
1014 1014 "\\mbfchi" : "𝛘",
1015 1015 "\\mbfpsi" : "𝛙",
1016 1016 "\\mbfomega" : "𝛚",
1017 1017 "\\mbfvarepsilon" : "𝛜",
1018 1018 "\\mbfvartheta" : "𝛝",
1019 1019 "\\mbfvarkappa" : "𝛞",
1020 1020 "\\mbfphi" : "𝛟",
1021 1021 "\\mbfvarrho" : "𝛠",
1022 1022 "\\mbfvarpi" : "𝛡",
1023 1023 "\\mitAlpha" : "𝛢",
1024 1024 "\\mitBeta" : "𝛣",
1025 1025 "\\mitGamma" : "𝛤",
1026 1026 "\\mitDelta" : "𝛥",
1027 1027 "\\mitEpsilon" : "𝛦",
1028 1028 "\\mitZeta" : "𝛧",
1029 1029 "\\mitEta" : "𝛨",
1030 1030 "\\mitTheta" : "𝛩",
1031 1031 "\\mitIota" : "𝛪",
1032 1032 "\\mitKappa" : "𝛫",
1033 1033 "\\mitLambda" : "𝛬",
1034 1034 "\\mitMu" : "𝛭",
1035 1035 "\\mitNu" : "𝛮",
1036 1036 "\\mitXi" : "𝛯",
1037 1037 "\\mitOmicron" : "𝛰",
1038 1038 "\\mitPi" : "𝛱",
1039 1039 "\\mitRho" : "𝛲",
1040 1040 "\\mitvarTheta" : "𝛳",
1041 1041 "\\mitSigma" : "𝛴",
1042 1042 "\\mitTau" : "𝛵",
1043 1043 "\\mitUpsilon" : "𝛶",
1044 1044 "\\mitPhi" : "𝛷",
1045 1045 "\\mitChi" : "𝛸",
1046 1046 "\\mitPsi" : "𝛹",
1047 1047 "\\mitOmega" : "𝛺",
1048 1048 "\\mitalpha" : "𝛼",
1049 1049 "\\mitbeta" : "𝛽",
1050 1050 "\\mitgamma" : "𝛾",
1051 1051 "\\mitdelta" : "𝛿",
1052 1052 "\\mitepsilon" : "𝜀",
1053 1053 "\\mitzeta" : "𝜁",
1054 1054 "\\miteta" : "𝜂",
1055 1055 "\\mittheta" : "𝜃",
1056 1056 "\\mitiota" : "𝜄",
1057 1057 "\\mitkappa" : "𝜅",
1058 1058 "\\mitlambda" : "𝜆",
1059 1059 "\\mitmu" : "𝜇",
1060 1060 "\\mitnu" : "𝜈",
1061 1061 "\\mitxi" : "𝜉",
1062 1062 "\\mitomicron" : "𝜊",
1063 1063 "\\mitpi" : "𝜋",
1064 1064 "\\mitrho" : "𝜌",
1065 1065 "\\mitvarsigma" : "𝜍",
1066 1066 "\\mitsigma" : "𝜎",
1067 1067 "\\mittau" : "𝜏",
1068 1068 "\\mitupsilon" : "𝜐",
1069 1069 "\\mitphi" : "𝜑",
1070 1070 "\\mitchi" : "𝜒",
1071 1071 "\\mitpsi" : "𝜓",
1072 1072 "\\mitomega" : "𝜔",
1073 1073 "\\mitvarepsilon" : "𝜖",
1074 1074 "\\mitvartheta" : "𝜗",
1075 1075 "\\mitvarkappa" : "𝜘",
1076 1076 "\\mitvarphi" : "𝜙",
1077 1077 "\\mitvarrho" : "𝜚",
1078 1078 "\\mitvarpi" : "𝜛",
1079 1079 "\\mbfitAlpha" : "𝜜",
1080 1080 "\\mbfitBeta" : "𝜝",
1081 1081 "\\mbfitGamma" : "𝜞",
1082 1082 "\\mbfitDelta" : "𝜟",
1083 1083 "\\mbfitEpsilon" : "𝜠",
1084 1084 "\\mbfitZeta" : "𝜡",
1085 1085 "\\mbfitEta" : "𝜢",
1086 1086 "\\mbfitTheta" : "𝜣",
1087 1087 "\\mbfitIota" : "𝜤",
1088 1088 "\\mbfitKappa" : "𝜥",
1089 1089 "\\mbfitLambda" : "𝜦",
1090 1090 "\\mbfitMu" : "𝜧",
1091 1091 "\\mbfitNu" : "𝜨",
1092 1092 "\\mbfitXi" : "𝜩",
1093 1093 "\\mbfitOmicron" : "𝜪",
1094 1094 "\\mbfitPi" : "𝜫",
1095 1095 "\\mbfitRho" : "𝜬",
1096 1096 "\\mbfitvarTheta" : "𝜭",
1097 1097 "\\mbfitSigma" : "𝜮",
1098 1098 "\\mbfitTau" : "𝜯",
1099 1099 "\\mbfitUpsilon" : "𝜰",
1100 1100 "\\mbfitPhi" : "𝜱",
1101 1101 "\\mbfitChi" : "𝜲",
1102 1102 "\\mbfitPsi" : "𝜳",
1103 1103 "\\mbfitOmega" : "𝜴",
1104 1104 "\\mbfitalpha" : "𝜶",
1105 1105 "\\mbfitbeta" : "𝜷",
1106 1106 "\\mbfitgamma" : "𝜸",
1107 1107 "\\mbfitdelta" : "𝜹",
1108 1108 "\\mbfitepsilon" : "𝜺",
1109 1109 "\\mbfitzeta" : "𝜻",
1110 1110 "\\mbfiteta" : "𝜼",
1111 1111 "\\mbfittheta" : "𝜽",
1112 1112 "\\mbfitiota" : "𝜾",
1113 1113 "\\mbfitkappa" : "𝜿",
1114 1114 "\\mbfitlambda" : "𝝀",
1115 1115 "\\mbfitmu" : "𝝁",
1116 1116 "\\mbfitnu" : "𝝂",
1117 1117 "\\mbfitxi" : "𝝃",
1118 1118 "\\mbfitomicron" : "𝝄",
1119 1119 "\\mbfitpi" : "𝝅",
1120 1120 "\\mbfitrho" : "𝝆",
1121 1121 "\\mbfitvarsigma" : "𝝇",
1122 1122 "\\mbfitsigma" : "𝝈",
1123 1123 "\\mbfittau" : "𝝉",
1124 1124 "\\mbfitupsilon" : "𝝊",
1125 1125 "\\mbfitphi" : "𝝋",
1126 1126 "\\mbfitchi" : "𝝌",
1127 1127 "\\mbfitpsi" : "𝝍",
1128 1128 "\\mbfitomega" : "𝝎",
1129 1129 "\\mbfitvarepsilon" : "𝝐",
1130 1130 "\\mbfitvartheta" : "𝝑",
1131 1131 "\\mbfitvarkappa" : "𝝒",
1132 1132 "\\mbfitvarphi" : "𝝓",
1133 1133 "\\mbfitvarrho" : "𝝔",
1134 1134 "\\mbfitvarpi" : "𝝕",
1135 1135 "\\mbfsansAlpha" : "𝝖",
1136 1136 "\\mbfsansBeta" : "𝝗",
1137 1137 "\\mbfsansGamma" : "𝝘",
1138 1138 "\\mbfsansDelta" : "𝝙",
1139 1139 "\\mbfsansEpsilon" : "𝝚",
1140 1140 "\\mbfsansZeta" : "𝝛",
1141 1141 "\\mbfsansEta" : "𝝜",
1142 1142 "\\mbfsansTheta" : "𝝝",
1143 1143 "\\mbfsansIota" : "𝝞",
1144 1144 "\\mbfsansKappa" : "𝝟",
1145 1145 "\\mbfsansLambda" : "𝝠",
1146 1146 "\\mbfsansMu" : "𝝡",
1147 1147 "\\mbfsansNu" : "𝝢",
1148 1148 "\\mbfsansXi" : "𝝣",
1149 1149 "\\mbfsansOmicron" : "𝝤",
1150 1150 "\\mbfsansPi" : "𝝥",
1151 1151 "\\mbfsansRho" : "𝝦",
1152 1152 "\\mbfsansvarTheta" : "𝝧",
1153 1153 "\\mbfsansSigma" : "𝝨",
1154 1154 "\\mbfsansTau" : "𝝩",
1155 1155 "\\mbfsansUpsilon" : "𝝪",
1156 1156 "\\mbfsansPhi" : "𝝫",
1157 1157 "\\mbfsansChi" : "𝝬",
1158 1158 "\\mbfsansPsi" : "𝝭",
1159 1159 "\\mbfsansOmega" : "𝝮",
1160 1160 "\\mbfsansalpha" : "𝝰",
1161 1161 "\\mbfsansbeta" : "𝝱",
1162 1162 "\\mbfsansgamma" : "𝝲",
1163 1163 "\\mbfsansdelta" : "𝝳",
1164 1164 "\\mbfsansepsilon" : "𝝴",
1165 1165 "\\mbfsanszeta" : "𝝵",
1166 1166 "\\mbfsanseta" : "𝝶",
1167 1167 "\\mbfsanstheta" : "𝝷",
1168 1168 "\\mbfsansiota" : "𝝸",
1169 1169 "\\mbfsanskappa" : "𝝹",
1170 1170 "\\mbfsanslambda" : "𝝺",
1171 1171 "\\mbfsansmu" : "𝝻",
1172 1172 "\\mbfsansnu" : "𝝼",
1173 1173 "\\mbfsansxi" : "𝝽",
1174 1174 "\\mbfsansomicron" : "𝝾",
1175 1175 "\\mbfsanspi" : "𝝿",
1176 1176 "\\mbfsansrho" : "𝞀",
1177 1177 "\\mbfsansvarsigma" : "𝞁",
1178 1178 "\\mbfsanssigma" : "𝞂",
1179 1179 "\\mbfsanstau" : "𝞃",
1180 1180 "\\mbfsansupsilon" : "𝞄",
1181 1181 "\\mbfsansphi" : "𝞅",
1182 1182 "\\mbfsanschi" : "𝞆",
1183 1183 "\\mbfsanspsi" : "𝞇",
1184 1184 "\\mbfsansomega" : "𝞈",
1185 1185 "\\mbfsansvarepsilon" : "𝞊",
1186 1186 "\\mbfsansvartheta" : "𝞋",
1187 1187 "\\mbfsansvarkappa" : "𝞌",
1188 1188 "\\mbfsansvarphi" : "𝞍",
1189 1189 "\\mbfsansvarrho" : "𝞎",
1190 1190 "\\mbfsansvarpi" : "𝞏",
1191 1191 "\\mbfitsansAlpha" : "𝞐",
1192 1192 "\\mbfitsansBeta" : "𝞑",
1193 1193 "\\mbfitsansGamma" : "𝞒",
1194 1194 "\\mbfitsansDelta" : "𝞓",
1195 1195 "\\mbfitsansEpsilon" : "𝞔",
1196 1196 "\\mbfitsansZeta" : "𝞕",
1197 1197 "\\mbfitsansEta" : "𝞖",
1198 1198 "\\mbfitsansTheta" : "𝞗",
1199 1199 "\\mbfitsansIota" : "𝞘",
1200 1200 "\\mbfitsansKappa" : "𝞙",
1201 1201 "\\mbfitsansLambda" : "𝞚",
1202 1202 "\\mbfitsansMu" : "𝞛",
1203 1203 "\\mbfitsansNu" : "𝞜",
1204 1204 "\\mbfitsansXi" : "𝞝",
1205 1205 "\\mbfitsansOmicron" : "𝞞",
1206 1206 "\\mbfitsansPi" : "𝞟",
1207 1207 "\\mbfitsansRho" : "𝞠",
1208 1208 "\\mbfitsansvarTheta" : "𝞡",
1209 1209 "\\mbfitsansSigma" : "𝞢",
1210 1210 "\\mbfitsansTau" : "𝞣",
1211 1211 "\\mbfitsansUpsilon" : "𝞤",
1212 1212 "\\mbfitsansPhi" : "𝞥",
1213 1213 "\\mbfitsansChi" : "𝞦",
1214 1214 "\\mbfitsansPsi" : "𝞧",
1215 1215 "\\mbfitsansOmega" : "𝞨",
1216 1216 "\\mbfitsansalpha" : "𝞪",
1217 1217 "\\mbfitsansbeta" : "𝞫",
1218 1218 "\\mbfitsansgamma" : "𝞬",
1219 1219 "\\mbfitsansdelta" : "𝞭",
1220 1220 "\\mbfitsansepsilon" : "𝞮",
1221 1221 "\\mbfitsanszeta" : "𝞯",
1222 1222 "\\mbfitsanseta" : "𝞰",
1223 1223 "\\mbfitsanstheta" : "𝞱",
1224 1224 "\\mbfitsansiota" : "𝞲",
1225 1225 "\\mbfitsanskappa" : "𝞳",
1226 1226 "\\mbfitsanslambda" : "𝞴",
1227 1227 "\\mbfitsansmu" : "𝞵",
1228 1228 "\\mbfitsansnu" : "𝞶",
1229 1229 "\\mbfitsansxi" : "𝞷",
1230 1230 "\\mbfitsansomicron" : "𝞸",
1231 1231 "\\mbfitsanspi" : "𝞹",
1232 1232 "\\mbfitsansrho" : "𝞺",
1233 1233 "\\mbfitsansvarsigma" : "𝞻",
1234 1234 "\\mbfitsanssigma" : "𝞼",
1235 1235 "\\mbfitsanstau" : "𝞽",
1236 1236 "\\mbfitsansupsilon" : "𝞾",
1237 1237 "\\mbfitsansphi" : "𝞿",
1238 1238 "\\mbfitsanschi" : "𝟀",
1239 1239 "\\mbfitsanspsi" : "𝟁",
1240 1240 "\\mbfitsansomega" : "𝟂",
1241 1241 "\\mbfitsansvarepsilon" : "𝟄",
1242 1242 "\\mbfitsansvartheta" : "𝟅",
1243 1243 "\\mbfitsansvarkappa" : "𝟆",
1244 1244 "\\mbfitsansvarphi" : "𝟇",
1245 1245 "\\mbfitsansvarrho" : "𝟈",
1246 1246 "\\mbfitsansvarpi" : "𝟉",
1247 1247 "\\mbfzero" : "𝟎",
1248 1248 "\\mbfone" : "𝟏",
1249 1249 "\\mbftwo" : "𝟐",
1250 1250 "\\mbfthree" : "𝟑",
1251 1251 "\\mbffour" : "𝟒",
1252 1252 "\\mbffive" : "𝟓",
1253 1253 "\\mbfsix" : "𝟔",
1254 1254 "\\mbfseven" : "𝟕",
1255 1255 "\\mbfeight" : "𝟖",
1256 1256 "\\mbfnine" : "𝟗",
1257 1257 "\\Bbbzero" : "𝟘",
1258 1258 "\\Bbbone" : "𝟙",
1259 1259 "\\Bbbtwo" : "𝟚",
1260 1260 "\\Bbbthree" : "𝟛",
1261 1261 "\\Bbbfour" : "𝟜",
1262 1262 "\\Bbbfive" : "𝟝",
1263 1263 "\\Bbbsix" : "𝟞",
1264 1264 "\\Bbbseven" : "𝟟",
1265 1265 "\\Bbbeight" : "𝟠",
1266 1266 "\\Bbbnine" : "𝟡",
1267 1267 "\\msanszero" : "𝟢",
1268 1268 "\\msansone" : "𝟣",
1269 1269 "\\msanstwo" : "𝟤",
1270 1270 "\\msansthree" : "𝟥",
1271 1271 "\\msansfour" : "𝟦",
1272 1272 "\\msansfive" : "𝟧",
1273 1273 "\\msanssix" : "𝟨",
1274 1274 "\\msansseven" : "𝟩",
1275 1275 "\\msanseight" : "𝟪",
1276 1276 "\\msansnine" : "𝟫",
1277 1277 "\\mbfsanszero" : "𝟬",
1278 1278 "\\mbfsansone" : "𝟭",
1279 1279 "\\mbfsanstwo" : "𝟮",
1280 1280 "\\mbfsansthree" : "𝟯",
1281 1281 "\\mbfsansfour" : "𝟰",
1282 1282 "\\mbfsansfive" : "𝟱",
1283 1283 "\\mbfsanssix" : "𝟲",
1284 1284 "\\mbfsansseven" : "𝟳",
1285 1285 "\\mbfsanseight" : "𝟴",
1286 1286 "\\mbfsansnine" : "𝟵",
1287 1287 "\\mttzero" : "𝟶",
1288 1288 "\\mttone" : "𝟷",
1289 1289 "\\mtttwo" : "𝟸",
1290 1290 "\\mttthree" : "𝟹",
1291 1291 "\\mttfour" : "𝟺",
1292 1292 "\\mttfive" : "𝟻",
1293 1293 "\\mttsix" : "𝟼",
1294 1294 "\\mttseven" : "𝟽",
1295 1295 "\\mtteight" : "𝟾",
1296 1296 "\\mttnine" : "𝟿",
1297 1297 }
1298
1299
1300 reverse_latex_symbol = { v:k for k,v in latex_symbols.items()}
@@ -1,84 +1,89 b''
1 1 # coding: utf-8
2 2
3 3 # This script autogenerates `IPython.core.latex_symbols.py`, which contains a
4 4 # single dict , named `latex_symbols`. The keys in this dict are latex symbols,
5 5 # such as `\\alpha` and the values in the dict are the unicode equivalents for
6 6 # those. Most importantly, only unicode symbols that are valid identifers in
7 7 # Python 3 are included.
8 8
9 9 #
10 10 # The original mapping of latex symbols to unicode comes from the `latex_symbols.jl` files from Julia.
11 11
12 12 from __future__ import print_function
13 13 import os, sys
14 14
15 15 if not sys.version_info[0] == 3:
16 16 print("This script must be run with Python 3, exiting...")
17 17 sys.exit(1)
18 18
19 19 # Import the Julia LaTeX symbols
20 20 print('Importing latex_symbols.js from Julia...')
21 21 import requests
22 22 url = 'https://raw.githubusercontent.com/JuliaLang/julia/master/base/latex_symbols.jl'
23 23 r = requests.get(url)
24 24
25 25
26 26 # Build a list of key, value pairs
27 27 print('Building a list of (latex, unicode) key-vaule pairs...')
28 28 lines = r.text.splitlines()[60:]
29 29 lines = [line for line in lines if '=>' in line]
30 30 lines = [line.replace('=>',':') for line in lines]
31 31
32 32 def line_to_tuple(line):
33 33 """Convert a single line of the .jl file to a 2-tuple of strings like ("\\alpha", "α")"""
34 34 kv = line.split(',')[0].split(':')
35 35 # kv = tuple(line.strip(', ').split(':'))
36 36 k, v = kv[0].strip(' "'), kv[1].strip(' "')
37 37 # if not test_ident(v):
38 38 # print(line)
39 39 return k, v
40 40
41 41 assert line_to_tuple(' "\\sqrt" : "\u221A",') == ('\\sqrt', '\u221A')
42 42 lines = [line_to_tuple(line) for line in lines]
43 43
44 44
45 45 # Filter out non-valid identifiers
46 46 print('Filtering out characters that are not valid Python 3 identifiers')
47 47
48 48 def test_ident(i):
49 49 """Is the unicode string valid in a Python 3 identifer."""
50 50 # Some characters are not valid at the start of a name, but we still want to
51 51 # include them. So prefix with 'a', which is valid at the start.
52 52 return ('a' + i).isidentifier()
53 53
54 54 assert test_ident("α")
55 55 assert not test_ident('‴')
56 56
57 57 valid_idents = [line for line in lines if test_ident(line[1])]
58 58
59 59
60 60 # Write the `latex_symbols.py` module in the cwd
61 61
62 62 s = """# encoding: utf-8
63 63
64 64 # DO NOT EDIT THIS FILE BY HAND.
65 65
66 66 # To update this file, run the script /tools/gen_latex_symbols.py using Python 3
67 67
68 68 # This file is autogenerated from the file:
69 69 # https://raw.githubusercontent.com/JuliaLang/julia/master/base/latex_symbols.jl
70 70 # This original list is filtered to remove any unicode characters that are not valid
71 71 # Python identifiers.
72 72
73 73 latex_symbols = {\n
74 74 """
75 75 for line in valid_idents:
76 76 s += ' "%s" : "%s",\n' % (line[0], line[1])
77 77 s += "}\n"
78 78
79 s += """
80
81 reverse_latex_symbol = { v:k for k,v in latex_symbols.items()}
82 """
83
79 84 fn = os.path.join('..','IPython','core','latex_symbols.py')
80 85 print("Writing the file: %s" % fn)
81 86 with open(fn, 'w', encoding='utf-8') as f:
82 87 f.write(s)
83 88
84 89
General Comments 0
You need to be logged in to leave comments. Login now