From 3b47a9b46a76fdf3932912062e91f795c0971711 2014-09-09 21:27:44 From: Thomas Kluyver Date: 2014-09-09 21:27:44 Subject: [PATCH] Merge pull request #6380 from ellisonbg/latex-complete Adds Julia-style latex->unicode tab completion --- diff --git a/IPython/core/completer.py b/IPython/core/completer.py index 125590f..c0c0c39 100644 --- a/IPython/core/completer.py +++ b/IPython/core/completer.py @@ -1,3 +1,4 @@ +# encoding: utf-8 """Word completion for IPython. This module is a fork of the rlcompleter module in the Python standard @@ -64,12 +65,13 @@ import sys from IPython.config.configurable import Configurable from IPython.core.error import TryNext from IPython.core.inputsplitter import ESC_MAGIC +from IPython.core.latex_symbols import latex_symbols from IPython.utils import generics from IPython.utils import io from IPython.utils.decorators import undoc from IPython.utils.dir2 import dir2 from IPython.utils.process import arg_split -from IPython.utils.py3compat import builtin_mod, string_types +from IPython.utils.py3compat import builtin_mod, string_types, PY3 from IPython.utils.traitlets import CBool, Enum #----------------------------------------------------------------------------- @@ -952,6 +954,27 @@ class IPCompleter(Completer): return [leading + k + suf for k in matches] + def latex_matches(self, text): + u"""Match Latex syntax for unicode characters. + + This does both \\alp -> \\alpha and \\alpha -> α + + Used on Python 3 only. + """ + slashpos = text.rfind('\\') + if slashpos > -1: + s = text[slashpos:] + if s in latex_symbols: + # Try to complete a full latex symbol to unicode + # \\alpha -> α + return s, [latex_symbols[s]] + else: + # If a user has partially typed a latex symbol, give them + # a full list of options \al -> [\aleph, \alpha] + matches = [k for k in latex_symbols if k.startswith(s)] + return s, matches + return u'', [] + def dispatch_custom_completer(self, text): #io.rprint("Custom! '%s' %s" % (text, self.custom_completers)) # dbg line = self.line_buffer @@ -1025,13 +1048,19 @@ class IPCompleter(Completer): matches : list A list of completion matches. """ - #io.rprint('\nCOMP1 %r %r %r' % (text, line_buffer, cursor_pos)) # dbg + # io.rprint('\nCOMP1 %r %r %r' % (text, line_buffer, cursor_pos)) # dbg # if the cursor position isn't given, the only sane assumption we can # make is that it's at the end of the line (the common case) if cursor_pos is None: cursor_pos = len(line_buffer) if text is None else len(text) + if PY3: + latex_text = text if not line_buffer else line_buffer[:cursor_pos] + latex_text, latex_matches = self.latex_matches(latex_text) + if latex_matches: + return latex_text, latex_matches + # if text is either None or an empty string, rely on the line buffer if not text: text = self.splitter.split_line(line_buffer, cursor_pos) @@ -1042,7 +1071,7 @@ class IPCompleter(Completer): self.line_buffer = line_buffer self.text_until_cursor = self.line_buffer[:cursor_pos] - #io.rprint('COMP2 %r %r %r' % (text, line_buffer, cursor_pos)) # dbg + # io.rprint('COMP2 %r %r %r' % (text, line_buffer, cursor_pos)) # dbg # Start with a clean slate of completions self.matches[:] = [] diff --git a/IPython/core/completerlib.py b/IPython/core/completerlib.py index 9b0038d..f76ea85 100644 --- a/IPython/core/completerlib.py +++ b/IPython/core/completerlib.py @@ -1,3 +1,4 @@ +# encoding: utf-8 """Implementations for various useful completers. These are all loaded by default by IPython. diff --git a/IPython/core/latex_symbols.py b/IPython/core/latex_symbols.py new file mode 100644 index 0000000..2a920e8 --- /dev/null +++ b/IPython/core/latex_symbols.py @@ -0,0 +1,1297 @@ +# encoding: utf-8 + +# DO NOT EDIT THIS FILE BY HAND. + +# To update this file, run the script /tools/gen_latex_symbols.py using Python 3 + +# This file is autogenerated from the file: +# https://raw.githubusercontent.com/JuliaLang/julia/master/base/latex_symbols.jl +# This original list is filtered to remove any unicode characters that are not valid +# Python identifiers. + +latex_symbols = { + + "\\^a" : "ᵃ", + "\\^b" : "ᵇ", + "\\^c" : "ᶜ", + "\\^d" : "ᵈ", + "\\^e" : "ᵉ", + "\\^f" : "ᶠ", + "\\^g" : "ᵍ", + "\\^h" : "ʰ", + "\\^i" : "ⁱ", + "\\^j" : "ʲ", + "\\^k" : "ᵏ", + "\\^l" : "ˡ", + "\\^m" : "ᵐ", + "\\^n" : "ⁿ", + "\\^o" : "ᵒ", + "\\^p" : "ᵖ", + "\\^r" : "ʳ", + "\\^s" : "ˢ", + "\\^t" : "ᵗ", + "\\^u" : "ᵘ", + "\\^v" : "ᵛ", + "\\^w" : "ʷ", + "\\^x" : "ˣ", + "\\^y" : "ʸ", + "\\^z" : "ᶻ", + "\\^A" : "ᴬ", + "\\^B" : "ᴮ", + "\\^D" : "ᴰ", + "\\^E" : "ᴱ", + "\\^G" : "ᴳ", + "\\^H" : "ᴴ", + "\\^I" : "ᴵ", + "\\^J" : "ᴶ", + "\\^K" : "ᴷ", + "\\^L" : "ᴸ", + "\\^M" : "ᴹ", + "\\^N" : "ᴺ", + "\\^O" : "ᴼ", + "\\^P" : "ᴾ", + "\\^R" : "ᴿ", + "\\^T" : "ᵀ", + "\\^U" : "ᵁ", + "\\^V" : "ⱽ", + "\\^W" : "ᵂ", + "\\^alpha" : "ᵅ", + "\\^beta" : "ᵝ", + "\\^gamma" : "ᵞ", + "\\^delta" : "ᵟ", + "\\^epsilon" : "ᵋ", + "\\^theta" : "ᶿ", + "\\^iota" : "ᶥ", + "\\^phi" : "ᵠ", + "\\^chi" : "ᵡ", + "\\^Phi" : "ᶲ", + "\\_a" : "ₐ", + "\\_e" : "ₑ", + "\\_h" : "ₕ", + "\\_i" : "ᵢ", + "\\_j" : "ⱼ", + "\\_k" : "ₖ", + "\\_l" : "ₗ", + "\\_m" : "ₘ", + "\\_n" : "ₙ", + "\\_o" : "ₒ", + "\\_p" : "ₚ", + "\\_r" : "ᵣ", + "\\_s" : "ₛ", + "\\_t" : "ₜ", + "\\_u" : "ᵤ", + "\\_v" : "ᵥ", + "\\_x" : "ₓ", + "\\_schwa" : "ₔ", + "\\_beta" : "ᵦ", + "\\_gamma" : "ᵧ", + "\\_rho" : "ᵨ", + "\\_phi" : "ᵩ", + "\\_chi" : "ᵪ", + "\\hbar" : "ħ", + "\\sout" : "̶", + "\\textordfeminine" : "ª", + "\\cdotp" : "·", + "\\textordmasculine" : "º", + "\\AA" : "Å", + "\\AE" : "Æ", + "\\DH" : "Ð", + "\\O" : "Ø", + "\\TH" : "Þ", + "\\ss" : "ß", + "\\aa" : "å", + "\\ae" : "æ", + "\\eth" : "ð", + "\\o" : "ø", + "\\th" : "þ", + "\\DJ" : "Đ", + "\\dj" : "đ", + "\\Elzxh" : "ħ", + "\\imath" : "ı", + "\\L" : "Ł", + "\\l" : "ł", + "\\NG" : "Ŋ", + "\\ng" : "ŋ", + "\\OE" : "Œ", + "\\oe" : "œ", + "\\texthvlig" : "ƕ", + "\\textnrleg" : "ƞ", + "\\textdoublepipe" : "ǂ", + "\\Elztrna" : "ɐ", + "\\Elztrnsa" : "ɒ", + "\\Elzopeno" : "ɔ", + "\\Elzrtld" : "ɖ", + "\\Elzschwa" : "ə", + "\\varepsilon" : "ɛ", + "\\Elzpgamma" : "ɣ", + "\\Elzpbgam" : "ɤ", + "\\Elztrnh" : "ɥ", + "\\Elzbtdl" : "ɬ", + "\\Elzrtll" : "ɭ", + "\\Elztrnm" : "ɯ", + "\\Elztrnmlr" : "ɰ", + "\\Elzltlmr" : "ɱ", + "\\Elzltln" : "ɲ", + "\\Elzrtln" : "ɳ", + "\\Elzclomeg" : "ɷ", + "\\textphi" : "ɸ", + "\\Elztrnr" : "ɹ", + "\\Elztrnrl" : "ɺ", + "\\Elzrttrnr" : "ɻ", + "\\Elzrl" : "ɼ", + "\\Elzrtlr" : "ɽ", + "\\Elzfhr" : "ɾ", + "\\Elzrtls" : "ʂ", + "\\Elzesh" : "ʃ", + "\\Elztrnt" : "ʇ", + "\\Elzrtlt" : "ʈ", + "\\Elzpupsil" : "ʊ", + "\\Elzpscrv" : "ʋ", + "\\Elzinvv" : "ʌ", + "\\Elzinvw" : "ʍ", + "\\Elztrny" : "ʎ", + "\\Elzrtlz" : "ʐ", + "\\Elzyogh" : "ʒ", + "\\Elzglst" : "ʔ", + "\\Elzreglst" : "ʕ", + "\\Elzinglst" : "ʖ", + "\\textturnk" : "ʞ", + "\\Elzdyogh" : "ʤ", + "\\Elztesh" : "ʧ", + "\\rasp" : "ʼ", + "\\textasciicaron" : "ˇ", + "\\Elzverts" : "ˈ", + "\\Elzverti" : "ˌ", + "\\Elzlmrk" : "ː", + "\\Elzhlmrk" : "ˑ", + "\\grave" : "̀", + "\\acute" : "́", + "\\hat" : "̂", + "\\tilde" : "̃", + "\\bar" : "̄", + "\\breve" : "̆", + "\\dot" : "̇", + "\\ddot" : "̈", + "\\ocirc" : "̊", + "\\H" : "̋", + "\\check" : "̌", + "\\Elzpalh" : "̡", + "\\Elzrh" : "̢", + "\\c" : "̧", + "\\k" : "̨", + "\\Elzsbbrg" : "̪", + "\\Elzxl" : "̵", + "\\Elzbar" : "̶", + "\\Alpha" : "Α", + "\\Beta" : "Β", + "\\Gamma" : "Γ", + "\\Delta" : "Δ", + "\\Epsilon" : "Ε", + "\\Zeta" : "Ζ", + "\\Eta" : "Η", + "\\Theta" : "Θ", + "\\Iota" : "Ι", + "\\Kappa" : "Κ", + "\\Lambda" : "Λ", + "\\Xi" : "Ξ", + "\\Pi" : "Π", + "\\Rho" : "Ρ", + "\\Sigma" : "Σ", + "\\Tau" : "Τ", + "\\Upsilon" : "Υ", + "\\Phi" : "Φ", + "\\Chi" : "Χ", + "\\Psi" : "Ψ", + "\\Omega" : "Ω", + "\\alpha" : "α", + "\\beta" : "β", + "\\gamma" : "γ", + "\\delta" : "δ", + "\\zeta" : "ζ", + "\\eta" : "η", + "\\theta" : "θ", + "\\iota" : "ι", + "\\kappa" : "κ", + "\\lambda" : "λ", + "\\mu" : "μ", + "\\nu" : "ν", + "\\xi" : "ξ", + "\\pi" : "π", + "\\rho" : "ρ", + "\\varsigma" : "ς", + "\\sigma" : "σ", + "\\tau" : "τ", + "\\upsilon" : "υ", + "\\varphi" : "φ", + "\\chi" : "χ", + "\\psi" : "ψ", + "\\omega" : "ω", + "\\vartheta" : "ϑ", + "\\phi" : "ϕ", + "\\varpi" : "ϖ", + "\\Stigma" : "Ϛ", + "\\Digamma" : "Ϝ", + "\\digamma" : "ϝ", + "\\Koppa" : "Ϟ", + "\\Sampi" : "Ϡ", + "\\varkappa" : "ϰ", + "\\varrho" : "ϱ", + "\\textTheta" : "ϴ", + "\\epsilon" : "ϵ", + "\\dddot" : "⃛", + "\\ddddot" : "⃜", + "\\hslash" : "ℏ", + "\\Im" : "ℑ", + "\\ell" : "ℓ", + "\\wp" : "℘", + "\\Re" : "ℜ", + "\\aleph" : "ℵ", + "\\beth" : "ℶ", + "\\gimel" : "ℷ", + "\\daleth" : "ℸ", + "\\BbbPi" : "ℿ", + "\\Zbar" : "Ƶ", + "\\overbar" : "̅", + "\\ovhook" : "̉", + "\\candra" : "̐", + "\\oturnedcomma" : "̒", + "\\ocommatopright" : "̕", + "\\droang" : "̚", + "\\wideutilde" : "̰", + "\\underbar" : "̱", + "\\not" : "̸", + "\\upMu" : "Μ", + "\\upNu" : "Ν", + "\\upOmicron" : "Ο", + "\\upepsilon" : "ε", + "\\upomicron" : "ο", + "\\upvarbeta" : "ϐ", + "\\upoldKoppa" : "Ϙ", + "\\upoldkoppa" : "ϙ", + "\\upstigma" : "ϛ", + "\\upkoppa" : "ϟ", + "\\upsampi" : "ϡ", + "\\tieconcat" : "⁀", + "\\leftharpoonaccent" : "⃐", + "\\rightharpoonaccent" : "⃑", + "\\vertoverlay" : "⃒", + "\\overleftarrow" : "⃖", + "\\vec" : "⃗", + "\\overleftrightarrow" : "⃡", + "\\annuity" : "⃧", + "\\threeunderdot" : "⃨", + "\\widebridgeabove" : "⃩", + "\\BbbC" : "ℂ", + "\\Eulerconst" : "ℇ", + "\\mscrg" : "ℊ", + "\\mscrH" : "ℋ", + "\\mfrakH" : "ℌ", + "\\BbbH" : "ℍ", + "\\Planckconst" : "ℎ", + "\\mscrI" : "ℐ", + "\\mscrL" : "ℒ", + "\\BbbN" : "ℕ", + "\\BbbP" : "ℙ", + "\\BbbQ" : "ℚ", + "\\mscrR" : "ℛ", + "\\BbbR" : "ℝ", + "\\BbbZ" : "ℤ", + "\\mfrakZ" : "ℨ", + "\\Angstrom" : "Å", + "\\mscrB" : "ℬ", + "\\mfrakC" : "ℭ", + "\\mscre" : "ℯ", + "\\mscrE" : "ℰ", + "\\mscrF" : "ℱ", + "\\Finv" : "Ⅎ", + "\\mscrM" : "ℳ", + "\\mscro" : "ℴ", + "\\Bbbgamma" : "ℽ", + "\\BbbGamma" : "ℾ", + "\\mitBbbD" : "ⅅ", + "\\mitBbbd" : "ⅆ", + "\\mitBbbe" : "ⅇ", + "\\mitBbbi" : "ⅈ", + "\\mitBbbj" : "ⅉ", + "\\mbfA" : "𝐀", + "\\mbfB" : "𝐁", + "\\mbfC" : "𝐂", + "\\mbfD" : "𝐃", + "\\mbfE" : "𝐄", + "\\mbfF" : "𝐅", + "\\mbfG" : "𝐆", + "\\mbfH" : "𝐇", + "\\mbfI" : "𝐈", + "\\mbfJ" : "𝐉", + "\\mbfK" : "𝐊", + "\\mbfL" : "𝐋", + "\\mbfM" : "𝐌", + "\\mbfN" : "𝐍", + "\\mbfO" : "𝐎", + "\\mbfP" : "𝐏", + "\\mbfQ" : "𝐐", + "\\mbfR" : "𝐑", + "\\mbfS" : "𝐒", + "\\mbfT" : "𝐓", + "\\mbfU" : "𝐔", + "\\mbfV" : "𝐕", + "\\mbfW" : "𝐖", + "\\mbfX" : "𝐗", + "\\mbfY" : "𝐘", + "\\mbfZ" : "𝐙", + "\\mbfa" : "𝐚", + "\\mbfb" : "𝐛", + "\\mbfc" : "𝐜", + "\\mbfd" : "𝐝", + "\\mbfe" : "𝐞", + "\\mbff" : "𝐟", + "\\mbfg" : "𝐠", + "\\mbfh" : "𝐡", + "\\mbfi" : "𝐢", + "\\mbfj" : "𝐣", + "\\mbfk" : "𝐤", + "\\mbfl" : "𝐥", + "\\mbfm" : "𝐦", + "\\mbfn" : "𝐧", + "\\mbfo" : "𝐨", + "\\mbfp" : "𝐩", + "\\mbfq" : "𝐪", + "\\mbfr" : "𝐫", + "\\mbfs" : "𝐬", + "\\mbft" : "𝐭", + "\\mbfu" : "𝐮", + "\\mbfv" : "𝐯", + "\\mbfw" : "𝐰", + "\\mbfx" : "𝐱", + "\\mbfy" : "𝐲", + "\\mbfz" : "𝐳", + "\\mitA" : "𝐴", + "\\mitB" : "𝐵", + "\\mitC" : "𝐶", + "\\mitD" : "𝐷", + "\\mitE" : "𝐸", + "\\mitF" : "𝐹", + "\\mitG" : "𝐺", + "\\mitH" : "𝐻", + "\\mitI" : "𝐼", + "\\mitJ" : "𝐽", + "\\mitK" : "𝐾", + "\\mitL" : "𝐿", + "\\mitM" : "𝑀", + "\\mitN" : "𝑁", + "\\mitO" : "𝑂", + "\\mitP" : "𝑃", + "\\mitQ" : "𝑄", + "\\mitR" : "𝑅", + "\\mitS" : "𝑆", + "\\mitT" : "𝑇", + "\\mitU" : "𝑈", + "\\mitV" : "𝑉", + "\\mitW" : "𝑊", + "\\mitX" : "𝑋", + "\\mitY" : "𝑌", + "\\mitZ" : "𝑍", + "\\mita" : "𝑎", + "\\mitb" : "𝑏", + "\\mitc" : "𝑐", + "\\mitd" : "𝑑", + "\\mite" : "𝑒", + "\\mitf" : "𝑓", + "\\mitg" : "𝑔", + "\\miti" : "𝑖", + "\\mitj" : "𝑗", + "\\mitk" : "𝑘", + "\\mitl" : "𝑙", + "\\mitm" : "𝑚", + "\\mitn" : "𝑛", + "\\mito" : "𝑜", + "\\mitp" : "𝑝", + "\\mitq" : "𝑞", + "\\mitr" : "𝑟", + "\\mits" : "𝑠", + "\\mitt" : "𝑡", + "\\mitu" : "𝑢", + "\\mitv" : "𝑣", + "\\mitw" : "𝑤", + "\\mitx" : "𝑥", + "\\mity" : "𝑦", + "\\mitz" : "𝑧", + "\\mbfitA" : "𝑨", + "\\mbfitB" : "𝑩", + "\\mbfitC" : "𝑪", + "\\mbfitD" : "𝑫", + "\\mbfitE" : "𝑬", + "\\mbfitF" : "𝑭", + "\\mbfitG" : "𝑮", + "\\mbfitH" : "𝑯", + "\\mbfitI" : "𝑰", + "\\mbfitJ" : "𝑱", + "\\mbfitK" : "𝑲", + "\\mbfitL" : "𝑳", + "\\mbfitM" : "𝑴", + "\\mbfitN" : "𝑵", + "\\mbfitO" : "𝑶", + "\\mbfitP" : "𝑷", + "\\mbfitQ" : "𝑸", + "\\mbfitR" : "𝑹", + "\\mbfitS" : "𝑺", + "\\mbfitT" : "𝑻", + "\\mbfitU" : "𝑼", + "\\mbfitV" : "𝑽", + "\\mbfitW" : "𝑾", + "\\mbfitX" : "𝑿", + "\\mbfitY" : "𝒀", + "\\mbfitZ" : "𝒁", + "\\mbfita" : "𝒂", + "\\mbfitb" : "𝒃", + "\\mbfitc" : "𝒄", + "\\mbfitd" : "𝒅", + "\\mbfite" : "𝒆", + "\\mbfitf" : "𝒇", + "\\mbfitg" : "𝒈", + "\\mbfith" : "𝒉", + "\\mbfiti" : "𝒊", + "\\mbfitj" : "𝒋", + "\\mbfitk" : "𝒌", + "\\mbfitl" : "𝒍", + "\\mbfitm" : "𝒎", + "\\mbfitn" : "𝒏", + "\\mbfito" : "𝒐", + "\\mbfitp" : "𝒑", + "\\mbfitq" : "𝒒", + "\\mbfitr" : "𝒓", + "\\mbfits" : "𝒔", + "\\mbfitt" : "𝒕", + "\\mbfitu" : "𝒖", + "\\mbfitv" : "𝒗", + "\\mbfitw" : "𝒘", + "\\mbfitx" : "𝒙", + "\\mbfity" : "𝒚", + "\\mbfitz" : "𝒛", + "\\mscrA" : "𝒜", + "\\mscrC" : "𝒞", + "\\mscrD" : "𝒟", + "\\mscrG" : "𝒢", + "\\mscrJ" : "𝒥", + "\\mscrK" : "𝒦", + "\\mscrN" : "𝒩", + "\\mscrO" : "𝒪", + "\\mscrP" : "𝒫", + "\\mscrQ" : "𝒬", + "\\mscrS" : "𝒮", + "\\mscrT" : "𝒯", + "\\mscrU" : "𝒰", + "\\mscrV" : "𝒱", + "\\mscrW" : "𝒲", + "\\mscrX" : "𝒳", + "\\mscrY" : "𝒴", + "\\mscrZ" : "𝒵", + "\\mscra" : "𝒶", + "\\mscrb" : "𝒷", + "\\mscrc" : "𝒸", + "\\mscrd" : "𝒹", + "\\mscrf" : "𝒻", + "\\mscrh" : "𝒽", + "\\mscri" : "𝒾", + "\\mscrj" : "𝒿", + "\\mscrk" : "𝓀", + "\\mscrm" : "𝓂", + "\\mscrn" : "𝓃", + "\\mscrp" : "𝓅", + "\\mscrq" : "𝓆", + "\\mscrr" : "𝓇", + "\\mscrs" : "𝓈", + "\\mscrt" : "𝓉", + "\\mscru" : "𝓊", + "\\mscrv" : "𝓋", + "\\mscrw" : "𝓌", + "\\mscrx" : "𝓍", + "\\mscry" : "𝓎", + "\\mscrz" : "𝓏", + "\\mbfscrA" : "𝓐", + "\\mbfscrB" : "𝓑", + "\\mbfscrC" : "𝓒", + "\\mbfscrD" : "𝓓", + "\\mbfscrE" : "𝓔", + "\\mbfscrF" : "𝓕", + "\\mbfscrG" : "𝓖", + "\\mbfscrH" : "𝓗", + "\\mbfscrI" : "𝓘", + "\\mbfscrJ" : "𝓙", + "\\mbfscrK" : "𝓚", + "\\mbfscrL" : "𝓛", + "\\mbfscrM" : "𝓜", + "\\mbfscrN" : "𝓝", + "\\mbfscrO" : "𝓞", + "\\mbfscrP" : "𝓟", + "\\mbfscrQ" : "𝓠", + "\\mbfscrR" : "𝓡", + "\\mbfscrS" : "𝓢", + "\\mbfscrT" : "𝓣", + "\\mbfscrU" : "𝓤", + "\\mbfscrV" : "𝓥", + "\\mbfscrW" : "𝓦", + "\\mbfscrX" : "𝓧", + "\\mbfscrY" : "𝓨", + "\\mbfscrZ" : "𝓩", + "\\mbfscra" : "𝓪", + "\\mbfscrb" : "𝓫", + "\\mbfscrc" : "𝓬", + "\\mbfscrd" : "𝓭", + "\\mbfscre" : "𝓮", + "\\mbfscrf" : "𝓯", + "\\mbfscrg" : "𝓰", + "\\mbfscrh" : "𝓱", + "\\mbfscri" : "𝓲", + "\\mbfscrj" : "𝓳", + "\\mbfscrk" : "𝓴", + "\\mbfscrl" : "𝓵", + "\\mbfscrm" : "𝓶", + "\\mbfscrn" : "𝓷", + "\\mbfscro" : "𝓸", + "\\mbfscrp" : "𝓹", + "\\mbfscrq" : "𝓺", + "\\mbfscrr" : "𝓻", + "\\mbfscrs" : "𝓼", + "\\mbfscrt" : "𝓽", + "\\mbfscru" : "𝓾", + "\\mbfscrv" : "𝓿", + "\\mbfscrw" : "𝔀", + "\\mbfscrx" : "𝔁", + "\\mbfscry" : "𝔂", + "\\mbfscrz" : "𝔃", + "\\mfrakA" : "𝔄", + "\\mfrakB" : "𝔅", + "\\mfrakD" : "𝔇", + "\\mfrakE" : "𝔈", + "\\mfrakF" : "𝔉", + "\\mfrakG" : "𝔊", + "\\mfrakJ" : "𝔍", + "\\mfrakK" : "𝔎", + "\\mfrakL" : "𝔏", + "\\mfrakM" : "𝔐", + "\\mfrakN" : "𝔑", + "\\mfrakO" : "𝔒", + "\\mfrakP" : "𝔓", + "\\mfrakQ" : "𝔔", + "\\mfrakS" : "𝔖", + "\\mfrakT" : "𝔗", + "\\mfrakU" : "𝔘", + "\\mfrakV" : "𝔙", + "\\mfrakW" : "𝔚", + "\\mfrakX" : "𝔛", + "\\mfrakY" : "𝔜", + "\\mfraka" : "𝔞", + "\\mfrakb" : "𝔟", + "\\mfrakc" : "𝔠", + "\\mfrakd" : "𝔡", + "\\mfrake" : "𝔢", + "\\mfrakf" : "𝔣", + "\\mfrakg" : "𝔤", + "\\mfrakh" : "𝔥", + "\\mfraki" : "𝔦", + "\\mfrakj" : "𝔧", + "\\mfrakk" : "𝔨", + "\\mfrakl" : "𝔩", + "\\mfrakm" : "𝔪", + "\\mfrakn" : "𝔫", + "\\mfrako" : "𝔬", + "\\mfrakp" : "𝔭", + "\\mfrakq" : "𝔮", + "\\mfrakr" : "𝔯", + "\\mfraks" : "𝔰", + "\\mfrakt" : "𝔱", + "\\mfraku" : "𝔲", + "\\mfrakv" : "𝔳", + "\\mfrakw" : "𝔴", + "\\mfrakx" : "𝔵", + "\\mfraky" : "𝔶", + "\\mfrakz" : "𝔷", + "\\BbbA" : "𝔸", + "\\BbbB" : "𝔹", + "\\BbbD" : "𝔻", + "\\BbbE" : "𝔼", + "\\BbbF" : "𝔽", + "\\BbbG" : "𝔾", + "\\BbbI" : "𝕀", + "\\BbbJ" : "𝕁", + "\\BbbK" : "𝕂", + "\\BbbL" : "𝕃", + "\\BbbM" : "𝕄", + "\\BbbO" : "𝕆", + "\\BbbS" : "𝕊", + "\\BbbT" : "𝕋", + "\\BbbU" : "𝕌", + "\\BbbV" : "𝕍", + "\\BbbW" : "𝕎", + "\\BbbX" : "𝕏", + "\\BbbY" : "𝕐", + "\\Bbba" : "𝕒", + "\\Bbbb" : "𝕓", + "\\Bbbc" : "𝕔", + "\\Bbbd" : "𝕕", + "\\Bbbe" : "𝕖", + "\\Bbbf" : "𝕗", + "\\Bbbg" : "𝕘", + "\\Bbbh" : "𝕙", + "\\Bbbi" : "𝕚", + "\\Bbbj" : "𝕛", + "\\Bbbk" : "𝕜", + "\\Bbbl" : "𝕝", + "\\Bbbm" : "𝕞", + "\\Bbbn" : "𝕟", + "\\Bbbo" : "𝕠", + "\\Bbbp" : "𝕡", + "\\Bbbq" : "𝕢", + "\\Bbbr" : "𝕣", + "\\Bbbs" : "𝕤", + "\\Bbbt" : "𝕥", + "\\Bbbu" : "𝕦", + "\\Bbbv" : "𝕧", + "\\Bbbw" : "𝕨", + "\\Bbbx" : "𝕩", + "\\Bbby" : "𝕪", + "\\Bbbz" : "𝕫", + "\\mbffrakA" : "𝕬", + "\\mbffrakB" : "𝕭", + "\\mbffrakC" : "𝕮", + "\\mbffrakD" : "𝕯", + "\\mbffrakE" : "𝕰", + "\\mbffrakF" : "𝕱", + "\\mbffrakG" : "𝕲", + "\\mbffrakH" : "𝕳", + "\\mbffrakI" : "𝕴", + "\\mbffrakJ" : "𝕵", + "\\mbffrakK" : "𝕶", + "\\mbffrakL" : "𝕷", + "\\mbffrakM" : "𝕸", + "\\mbffrakN" : "𝕹", + "\\mbffrakO" : "𝕺", + "\\mbffrakP" : "𝕻", + "\\mbffrakQ" : "𝕼", + "\\mbffrakR" : "𝕽", + "\\mbffrakS" : "𝕾", + "\\mbffrakT" : "𝕿", + "\\mbffrakU" : "𝖀", + "\\mbffrakV" : "𝖁", + "\\mbffrakW" : "𝖂", + "\\mbffrakX" : "𝖃", + "\\mbffrakY" : "𝖄", + "\\mbffrakZ" : "𝖅", + "\\mbffraka" : "𝖆", + "\\mbffrakb" : "𝖇", + "\\mbffrakc" : "𝖈", + "\\mbffrakd" : "𝖉", + "\\mbffrake" : "𝖊", + "\\mbffrakf" : "𝖋", + "\\mbffrakg" : "𝖌", + "\\mbffrakh" : "𝖍", + "\\mbffraki" : "𝖎", + "\\mbffrakj" : "𝖏", + "\\mbffrakk" : "𝖐", + "\\mbffrakl" : "𝖑", + "\\mbffrakm" : "𝖒", + "\\mbffrakn" : "𝖓", + "\\mbffrako" : "𝖔", + "\\mbffrakp" : "𝖕", + "\\mbffrakq" : "𝖖", + "\\mbffrakr" : "𝖗", + "\\mbffraks" : "𝖘", + "\\mbffrakt" : "𝖙", + "\\mbffraku" : "𝖚", + "\\mbffrakv" : "𝖛", + "\\mbffrakw" : "𝖜", + "\\mbffrakx" : "𝖝", + "\\mbffraky" : "𝖞", + "\\mbffrakz" : "𝖟", + "\\msansA" : "𝖠", + "\\msansB" : "𝖡", + "\\msansC" : "𝖢", + "\\msansD" : "𝖣", + "\\msansE" : "𝖤", + "\\msansF" : "𝖥", + "\\msansG" : "𝖦", + "\\msansH" : "𝖧", + "\\msansI" : "𝖨", + "\\msansJ" : "𝖩", + "\\msansK" : "𝖪", + "\\msansL" : "𝖫", + "\\msansM" : "𝖬", + "\\msansN" : "𝖭", + "\\msansO" : "𝖮", + "\\msansP" : "𝖯", + "\\msansQ" : "𝖰", + "\\msansR" : "𝖱", + "\\msansS" : "𝖲", + "\\msansT" : "𝖳", + "\\msansU" : "𝖴", + "\\msansV" : "𝖵", + "\\msansW" : "𝖶", + "\\msansX" : "𝖷", + "\\msansY" : "𝖸", + "\\msansZ" : "𝖹", + "\\msansa" : "𝖺", + "\\msansb" : "𝖻", + "\\msansc" : "𝖼", + "\\msansd" : "𝖽", + "\\msanse" : "𝖾", + "\\msansf" : "𝖿", + "\\msansg" : "𝗀", + "\\msansh" : "𝗁", + "\\msansi" : "𝗂", + "\\msansj" : "𝗃", + "\\msansk" : "𝗄", + "\\msansl" : "𝗅", + "\\msansm" : "𝗆", + "\\msansn" : "𝗇", + "\\msanso" : "𝗈", + "\\msansp" : "𝗉", + "\\msansq" : "𝗊", + "\\msansr" : "𝗋", + "\\msanss" : "𝗌", + "\\msanst" : "𝗍", + "\\msansu" : "𝗎", + "\\msansv" : "𝗏", + "\\msansw" : "𝗐", + "\\msansx" : "𝗑", + "\\msansy" : "𝗒", + "\\msansz" : "𝗓", + "\\mbfsansA" : "𝗔", + "\\mbfsansB" : "𝗕", + "\\mbfsansC" : "𝗖", + "\\mbfsansD" : "𝗗", + "\\mbfsansE" : "𝗘", + "\\mbfsansF" : "𝗙", + "\\mbfsansG" : "𝗚", + "\\mbfsansH" : "𝗛", + "\\mbfsansI" : "𝗜", + "\\mbfsansJ" : "𝗝", + "\\mbfsansK" : "𝗞", + "\\mbfsansL" : "𝗟", + "\\mbfsansM" : "𝗠", + "\\mbfsansN" : "𝗡", + "\\mbfsansO" : "𝗢", + "\\mbfsansP" : "𝗣", + "\\mbfsansQ" : "𝗤", + "\\mbfsansR" : "𝗥", + "\\mbfsansS" : "𝗦", + "\\mbfsansT" : "𝗧", + "\\mbfsansU" : "𝗨", + "\\mbfsansV" : "𝗩", + "\\mbfsansW" : "𝗪", + "\\mbfsansX" : "𝗫", + "\\mbfsansY" : "𝗬", + "\\mbfsansZ" : "𝗭", + "\\mbfsansa" : "𝗮", + "\\mbfsansb" : "𝗯", + "\\mbfsansc" : "𝗰", + "\\mbfsansd" : "𝗱", + "\\mbfsanse" : "𝗲", + "\\mbfsansf" : "𝗳", + "\\mbfsansg" : "𝗴", + "\\mbfsansh" : "𝗵", + "\\mbfsansi" : "𝗶", + "\\mbfsansj" : "𝗷", + "\\mbfsansk" : "𝗸", + "\\mbfsansl" : "𝗹", + "\\mbfsansm" : "𝗺", + "\\mbfsansn" : "𝗻", + "\\mbfsanso" : "𝗼", + "\\mbfsansp" : "𝗽", + "\\mbfsansq" : "𝗾", + "\\mbfsansr" : "𝗿", + "\\mbfsanss" : "𝘀", + "\\mbfsanst" : "𝘁", + "\\mbfsansu" : "𝘂", + "\\mbfsansv" : "𝘃", + "\\mbfsansw" : "𝘄", + "\\mbfsansx" : "𝘅", + "\\mbfsansy" : "𝘆", + "\\mbfsansz" : "𝘇", + "\\mitsansA" : "𝘈", + "\\mitsansB" : "𝘉", + "\\mitsansC" : "𝘊", + "\\mitsansD" : "𝘋", + "\\mitsansE" : "𝘌", + "\\mitsansF" : "𝘍", + "\\mitsansG" : "𝘎", + "\\mitsansH" : "𝘏", + "\\mitsansI" : "𝘐", + "\\mitsansJ" : "𝘑", + "\\mitsansK" : "𝘒", + "\\mitsansL" : "𝘓", + "\\mitsansM" : "𝘔", + "\\mitsansN" : "𝘕", + "\\mitsansO" : "𝘖", + "\\mitsansP" : "𝘗", + "\\mitsansQ" : "𝘘", + "\\mitsansR" : "𝘙", + "\\mitsansS" : "𝘚", + "\\mitsansT" : "𝘛", + "\\mitsansU" : "𝘜", + "\\mitsansV" : "𝘝", + "\\mitsansW" : "𝘞", + "\\mitsansX" : "𝘟", + "\\mitsansY" : "𝘠", + "\\mitsansZ" : "𝘡", + "\\mitsansa" : "𝘢", + "\\mitsansb" : "𝘣", + "\\mitsansc" : "𝘤", + "\\mitsansd" : "𝘥", + "\\mitsanse" : "𝘦", + "\\mitsansf" : "𝘧", + "\\mitsansg" : "𝘨", + "\\mitsansh" : "𝘩", + "\\mitsansi" : "𝘪", + "\\mitsansj" : "𝘫", + "\\mitsansk" : "𝘬", + "\\mitsansl" : "𝘭", + "\\mitsansm" : "𝘮", + "\\mitsansn" : "𝘯", + "\\mitsanso" : "𝘰", + "\\mitsansp" : "𝘱", + "\\mitsansq" : "𝘲", + "\\mitsansr" : "𝘳", + "\\mitsanss" : "𝘴", + "\\mitsanst" : "𝘵", + "\\mitsansu" : "𝘶", + "\\mitsansv" : "𝘷", + "\\mitsansw" : "𝘸", + "\\mitsansx" : "𝘹", + "\\mitsansy" : "𝘺", + "\\mitsansz" : "𝘻", + "\\mbfitsansA" : "𝘼", + "\\mbfitsansB" : "𝘽", + "\\mbfitsansC" : "𝘾", + "\\mbfitsansD" : "𝘿", + "\\mbfitsansE" : "𝙀", + "\\mbfitsansF" : "𝙁", + "\\mbfitsansG" : "𝙂", + "\\mbfitsansH" : "𝙃", + "\\mbfitsansI" : "𝙄", + "\\mbfitsansJ" : "𝙅", + "\\mbfitsansK" : "𝙆", + "\\mbfitsansL" : "𝙇", + "\\mbfitsansM" : "𝙈", + "\\mbfitsansN" : "𝙉", + "\\mbfitsansO" : "𝙊", + "\\mbfitsansP" : "𝙋", + "\\mbfitsansQ" : "𝙌", + "\\mbfitsansR" : "𝙍", + "\\mbfitsansS" : "𝙎", + "\\mbfitsansT" : "𝙏", + "\\mbfitsansU" : "𝙐", + "\\mbfitsansV" : "𝙑", + "\\mbfitsansW" : "𝙒", + "\\mbfitsansX" : "𝙓", + "\\mbfitsansY" : "𝙔", + "\\mbfitsansZ" : "𝙕", + "\\mbfitsansa" : "𝙖", + "\\mbfitsansb" : "𝙗", + "\\mbfitsansc" : "𝙘", + "\\mbfitsansd" : "𝙙", + "\\mbfitsanse" : "𝙚", + "\\mbfitsansf" : "𝙛", + "\\mbfitsansg" : "𝙜", + "\\mbfitsansh" : "𝙝", + "\\mbfitsansi" : "𝙞", + "\\mbfitsansj" : "𝙟", + "\\mbfitsansk" : "𝙠", + "\\mbfitsansl" : "𝙡", + "\\mbfitsansm" : "𝙢", + "\\mbfitsansn" : "𝙣", + "\\mbfitsanso" : "𝙤", + "\\mbfitsansp" : "𝙥", + "\\mbfitsansq" : "𝙦", + "\\mbfitsansr" : "𝙧", + "\\mbfitsanss" : "𝙨", + "\\mbfitsanst" : "𝙩", + "\\mbfitsansu" : "𝙪", + "\\mbfitsansv" : "𝙫", + "\\mbfitsansw" : "𝙬", + "\\mbfitsansx" : "𝙭", + "\\mbfitsansy" : "𝙮", + "\\mbfitsansz" : "𝙯", + "\\mttA" : "𝙰", + "\\mttB" : "𝙱", + "\\mttC" : "𝙲", + "\\mttD" : "𝙳", + "\\mttE" : "𝙴", + "\\mttF" : "𝙵", + "\\mttG" : "𝙶", + "\\mttH" : "𝙷", + "\\mttI" : "𝙸", + "\\mttJ" : "𝙹", + "\\mttK" : "𝙺", + "\\mttL" : "𝙻", + "\\mttM" : "𝙼", + "\\mttN" : "𝙽", + "\\mttO" : "𝙾", + "\\mttP" : "𝙿", + "\\mttQ" : "𝚀", + "\\mttR" : "𝚁", + "\\mttS" : "𝚂", + "\\mttT" : "𝚃", + "\\mttU" : "𝚄", + "\\mttV" : "𝚅", + "\\mttW" : "𝚆", + "\\mttX" : "𝚇", + "\\mttY" : "𝚈", + "\\mttZ" : "𝚉", + "\\mtta" : "𝚊", + "\\mttb" : "𝚋", + "\\mttc" : "𝚌", + "\\mttd" : "𝚍", + "\\mtte" : "𝚎", + "\\mttf" : "𝚏", + "\\mttg" : "𝚐", + "\\mtth" : "𝚑", + "\\mtti" : "𝚒", + "\\mttj" : "𝚓", + "\\mttk" : "𝚔", + "\\mttl" : "𝚕", + "\\mttm" : "𝚖", + "\\mttn" : "𝚗", + "\\mtto" : "𝚘", + "\\mttp" : "𝚙", + "\\mttq" : "𝚚", + "\\mttr" : "𝚛", + "\\mtts" : "𝚜", + "\\mttt" : "𝚝", + "\\mttu" : "𝚞", + "\\mttv" : "𝚟", + "\\mttw" : "𝚠", + "\\mttx" : "𝚡", + "\\mtty" : "𝚢", + "\\mttz" : "𝚣", + "\\mbfAlpha" : "𝚨", + "\\mbfBeta" : "𝚩", + "\\mbfGamma" : "𝚪", + "\\mbfDelta" : "𝚫", + "\\mbfEpsilon" : "𝚬", + "\\mbfZeta" : "𝚭", + "\\mbfEta" : "𝚮", + "\\mbfTheta" : "𝚯", + "\\mbfIota" : "𝚰", + "\\mbfKappa" : "𝚱", + "\\mbfLambda" : "𝚲", + "\\mbfMu" : "𝚳", + "\\mbfNu" : "𝚴", + "\\mbfXi" : "𝚵", + "\\mbfOmicron" : "𝚶", + "\\mbfPi" : "𝚷", + "\\mbfRho" : "𝚸", + "\\mbfvarTheta" : "𝚹", + "\\mbfSigma" : "𝚺", + "\\mbfTau" : "𝚻", + "\\mbfUpsilon" : "𝚼", + "\\mbfPhi" : "𝚽", + "\\mbfChi" : "𝚾", + "\\mbfPsi" : "𝚿", + "\\mbfOmega" : "𝛀", + "\\mbfalpha" : "𝛂", + "\\mbfbeta" : "𝛃", + "\\mbfgamma" : "𝛄", + "\\mbfdelta" : "𝛅", + "\\mbfepsilon" : "𝛆", + "\\mbfzeta" : "𝛇", + "\\mbfeta" : "𝛈", + "\\mbftheta" : "𝛉", + "\\mbfiota" : "𝛊", + "\\mbfkappa" : "𝛋", + "\\mbflambda" : "𝛌", + "\\mbfmu" : "𝛍", + "\\mbfnu" : "𝛎", + "\\mbfxi" : "𝛏", + "\\mbfomicron" : "𝛐", + "\\mbfpi" : "𝛑", + "\\mbfrho" : "𝛒", + "\\mbfvarsigma" : "𝛓", + "\\mbfsigma" : "𝛔", + "\\mbftau" : "𝛕", + "\\mbfupsilon" : "𝛖", + "\\mbfvarphi" : "𝛗", + "\\mbfchi" : "𝛘", + "\\mbfpsi" : "𝛙", + "\\mbfomega" : "𝛚", + "\\mbfvarepsilon" : "𝛜", + "\\mbfvartheta" : "𝛝", + "\\mbfvarkappa" : "𝛞", + "\\mbfphi" : "𝛟", + "\\mbfvarrho" : "𝛠", + "\\mbfvarpi" : "𝛡", + "\\mitAlpha" : "𝛢", + "\\mitBeta" : "𝛣", + "\\mitGamma" : "𝛤", + "\\mitDelta" : "𝛥", + "\\mitEpsilon" : "𝛦", + "\\mitZeta" : "𝛧", + "\\mitEta" : "𝛨", + "\\mitTheta" : "𝛩", + "\\mitIota" : "𝛪", + "\\mitKappa" : "𝛫", + "\\mitLambda" : "𝛬", + "\\mitMu" : "𝛭", + "\\mitNu" : "𝛮", + "\\mitXi" : "𝛯", + "\\mitOmicron" : "𝛰", + "\\mitPi" : "𝛱", + "\\mitRho" : "𝛲", + "\\mitvarTheta" : "𝛳", + "\\mitSigma" : "𝛴", + "\\mitTau" : "𝛵", + "\\mitUpsilon" : "𝛶", + "\\mitPhi" : "𝛷", + "\\mitChi" : "𝛸", + "\\mitPsi" : "𝛹", + "\\mitOmega" : "𝛺", + "\\mitalpha" : "𝛼", + "\\mitbeta" : "𝛽", + "\\mitgamma" : "𝛾", + "\\mitdelta" : "𝛿", + "\\mitepsilon" : "𝜀", + "\\mitzeta" : "𝜁", + "\\miteta" : "𝜂", + "\\mittheta" : "𝜃", + "\\mitiota" : "𝜄", + "\\mitkappa" : "𝜅", + "\\mitlambda" : "𝜆", + "\\mitmu" : "𝜇", + "\\mitnu" : "𝜈", + "\\mitxi" : "𝜉", + "\\mitomicron" : "𝜊", + "\\mitpi" : "𝜋", + "\\mitrho" : "𝜌", + "\\mitvarsigma" : "𝜍", + "\\mitsigma" : "𝜎", + "\\mittau" : "𝜏", + "\\mitupsilon" : "𝜐", + "\\mitphi" : "𝜑", + "\\mitchi" : "𝜒", + "\\mitpsi" : "𝜓", + "\\mitomega" : "𝜔", + "\\mitvarepsilon" : "𝜖", + "\\mitvartheta" : "𝜗", + "\\mitvarkappa" : "𝜘", + "\\mitvarphi" : "𝜙", + "\\mitvarrho" : "𝜚", + "\\mitvarpi" : "𝜛", + "\\mbfitAlpha" : "𝜜", + "\\mbfitBeta" : "𝜝", + "\\mbfitGamma" : "𝜞", + "\\mbfitDelta" : "𝜟", + "\\mbfitEpsilon" : "𝜠", + "\\mbfitZeta" : "𝜡", + "\\mbfitEta" : "𝜢", + "\\mbfitTheta" : "𝜣", + "\\mbfitIota" : "𝜤", + "\\mbfitKappa" : "𝜥", + "\\mbfitLambda" : "𝜦", + "\\mbfitMu" : "𝜧", + "\\mbfitNu" : "𝜨", + "\\mbfitXi" : "𝜩", + "\\mbfitOmicron" : "𝜪", + "\\mbfitPi" : "𝜫", + "\\mbfitRho" : "𝜬", + "\\mbfitvarTheta" : "𝜭", + "\\mbfitSigma" : "𝜮", + "\\mbfitTau" : "𝜯", + "\\mbfitUpsilon" : "𝜰", + "\\mbfitPhi" : "𝜱", + "\\mbfitChi" : "𝜲", + "\\mbfitPsi" : "𝜳", + "\\mbfitOmega" : "𝜴", + "\\mbfitalpha" : "𝜶", + "\\mbfitbeta" : "𝜷", + "\\mbfitgamma" : "𝜸", + "\\mbfitdelta" : "𝜹", + "\\mbfitepsilon" : "𝜺", + "\\mbfitzeta" : "𝜻", + "\\mbfiteta" : "𝜼", + "\\mbfittheta" : "𝜽", + "\\mbfitiota" : "𝜾", + "\\mbfitkappa" : "𝜿", + "\\mbfitlambda" : "𝝀", + "\\mbfitmu" : "𝝁", + "\\mbfitnu" : "𝝂", + "\\mbfitxi" : "𝝃", + "\\mbfitomicron" : "𝝄", + "\\mbfitpi" : "𝝅", + "\\mbfitrho" : "𝝆", + "\\mbfitvarsigma" : "𝝇", + "\\mbfitsigma" : "𝝈", + "\\mbfittau" : "𝝉", + "\\mbfitupsilon" : "𝝊", + "\\mbfitphi" : "𝝋", + "\\mbfitchi" : "𝝌", + "\\mbfitpsi" : "𝝍", + "\\mbfitomega" : "𝝎", + "\\mbfitvarepsilon" : "𝝐", + "\\mbfitvartheta" : "𝝑", + "\\mbfitvarkappa" : "𝝒", + "\\mbfitvarphi" : "𝝓", + "\\mbfitvarrho" : "𝝔", + "\\mbfitvarpi" : "𝝕", + "\\mbfsansAlpha" : "𝝖", + "\\mbfsansBeta" : "𝝗", + "\\mbfsansGamma" : "𝝘", + "\\mbfsansDelta" : "𝝙", + "\\mbfsansEpsilon" : "𝝚", + "\\mbfsansZeta" : "𝝛", + "\\mbfsansEta" : "𝝜", + "\\mbfsansTheta" : "𝝝", + "\\mbfsansIota" : "𝝞", + "\\mbfsansKappa" : "𝝟", + "\\mbfsansLambda" : "𝝠", + "\\mbfsansMu" : "𝝡", + "\\mbfsansNu" : "𝝢", + "\\mbfsansXi" : "𝝣", + "\\mbfsansOmicron" : "𝝤", + "\\mbfsansPi" : "𝝥", + "\\mbfsansRho" : "𝝦", + "\\mbfsansvarTheta" : "𝝧", + "\\mbfsansSigma" : "𝝨", + "\\mbfsansTau" : "𝝩", + "\\mbfsansUpsilon" : "𝝪", + "\\mbfsansPhi" : "𝝫", + "\\mbfsansChi" : "𝝬", + "\\mbfsansPsi" : "𝝭", + "\\mbfsansOmega" : "𝝮", + "\\mbfsansalpha" : "𝝰", + "\\mbfsansbeta" : "𝝱", + "\\mbfsansgamma" : "𝝲", + "\\mbfsansdelta" : "𝝳", + "\\mbfsansepsilon" : "𝝴", + "\\mbfsanszeta" : "𝝵", + "\\mbfsanseta" : "𝝶", + "\\mbfsanstheta" : "𝝷", + "\\mbfsansiota" : "𝝸", + "\\mbfsanskappa" : "𝝹", + "\\mbfsanslambda" : "𝝺", + "\\mbfsansmu" : "𝝻", + "\\mbfsansnu" : "𝝼", + "\\mbfsansxi" : "𝝽", + "\\mbfsansomicron" : "𝝾", + "\\mbfsanspi" : "𝝿", + "\\mbfsansrho" : "𝞀", + "\\mbfsansvarsigma" : "𝞁", + "\\mbfsanssigma" : "𝞂", + "\\mbfsanstau" : "𝞃", + "\\mbfsansupsilon" : "𝞄", + "\\mbfsansphi" : "𝞅", + "\\mbfsanschi" : "𝞆", + "\\mbfsanspsi" : "𝞇", + "\\mbfsansomega" : "𝞈", + "\\mbfsansvarepsilon" : "𝞊", + "\\mbfsansvartheta" : "𝞋", + "\\mbfsansvarkappa" : "𝞌", + "\\mbfsansvarphi" : "𝞍", + "\\mbfsansvarrho" : "𝞎", + "\\mbfsansvarpi" : "𝞏", + "\\mbfitsansAlpha" : "𝞐", + "\\mbfitsansBeta" : "𝞑", + "\\mbfitsansGamma" : "𝞒", + "\\mbfitsansDelta" : "𝞓", + "\\mbfitsansEpsilon" : "𝞔", + "\\mbfitsansZeta" : "𝞕", + "\\mbfitsansEta" : "𝞖", + "\\mbfitsansTheta" : "𝞗", + "\\mbfitsansIota" : "𝞘", + "\\mbfitsansKappa" : "𝞙", + "\\mbfitsansLambda" : "𝞚", + "\\mbfitsansMu" : "𝞛", + "\\mbfitsansNu" : "𝞜", + "\\mbfitsansXi" : "𝞝", + "\\mbfitsansOmicron" : "𝞞", + "\\mbfitsansPi" : "𝞟", + "\\mbfitsansRho" : "𝞠", + "\\mbfitsansvarTheta" : "𝞡", + "\\mbfitsansSigma" : "𝞢", + "\\mbfitsansTau" : "𝞣", + "\\mbfitsansUpsilon" : "𝞤", + "\\mbfitsansPhi" : "𝞥", + "\\mbfitsansChi" : "𝞦", + "\\mbfitsansPsi" : "𝞧", + "\\mbfitsansOmega" : "𝞨", + "\\mbfitsansalpha" : "𝞪", + "\\mbfitsansbeta" : "𝞫", + "\\mbfitsansgamma" : "𝞬", + "\\mbfitsansdelta" : "𝞭", + "\\mbfitsansepsilon" : "𝞮", + "\\mbfitsanszeta" : "𝞯", + "\\mbfitsanseta" : "𝞰", + "\\mbfitsanstheta" : "𝞱", + "\\mbfitsansiota" : "𝞲", + "\\mbfitsanskappa" : "𝞳", + "\\mbfitsanslambda" : "𝞴", + "\\mbfitsansmu" : "𝞵", + "\\mbfitsansnu" : "𝞶", + "\\mbfitsansxi" : "𝞷", + "\\mbfitsansomicron" : "𝞸", + "\\mbfitsanspi" : "𝞹", + "\\mbfitsansrho" : "𝞺", + "\\mbfitsansvarsigma" : "𝞻", + "\\mbfitsanssigma" : "𝞼", + "\\mbfitsanstau" : "𝞽", + "\\mbfitsansupsilon" : "𝞾", + "\\mbfitsansphi" : "𝞿", + "\\mbfitsanschi" : "𝟀", + "\\mbfitsanspsi" : "𝟁", + "\\mbfitsansomega" : "𝟂", + "\\mbfitsansvarepsilon" : "𝟄", + "\\mbfitsansvartheta" : "𝟅", + "\\mbfitsansvarkappa" : "𝟆", + "\\mbfitsansvarphi" : "𝟇", + "\\mbfitsansvarrho" : "𝟈", + "\\mbfitsansvarpi" : "𝟉", + "\\mbfzero" : "𝟎", + "\\mbfone" : "𝟏", + "\\mbftwo" : "𝟐", + "\\mbfthree" : "𝟑", + "\\mbffour" : "𝟒", + "\\mbffive" : "𝟓", + "\\mbfsix" : "𝟔", + "\\mbfseven" : "𝟕", + "\\mbfeight" : "𝟖", + "\\mbfnine" : "𝟗", + "\\Bbbzero" : "𝟘", + "\\Bbbone" : "𝟙", + "\\Bbbtwo" : "𝟚", + "\\Bbbthree" : "𝟛", + "\\Bbbfour" : "𝟜", + "\\Bbbfive" : "𝟝", + "\\Bbbsix" : "𝟞", + "\\Bbbseven" : "𝟟", + "\\Bbbeight" : "𝟠", + "\\Bbbnine" : "𝟡", + "\\msanszero" : "𝟢", + "\\msansone" : "𝟣", + "\\msanstwo" : "𝟤", + "\\msansthree" : "𝟥", + "\\msansfour" : "𝟦", + "\\msansfive" : "𝟧", + "\\msanssix" : "𝟨", + "\\msansseven" : "𝟩", + "\\msanseight" : "𝟪", + "\\msansnine" : "𝟫", + "\\mbfsanszero" : "𝟬", + "\\mbfsansone" : "𝟭", + "\\mbfsanstwo" : "𝟮", + "\\mbfsansthree" : "𝟯", + "\\mbfsansfour" : "𝟰", + "\\mbfsansfive" : "𝟱", + "\\mbfsanssix" : "𝟲", + "\\mbfsansseven" : "𝟳", + "\\mbfsanseight" : "𝟴", + "\\mbfsansnine" : "𝟵", + "\\mttzero" : "𝟶", + "\\mttone" : "𝟷", + "\\mtttwo" : "𝟸", + "\\mttthree" : "𝟹", + "\\mttfour" : "𝟺", + "\\mttfive" : "𝟻", + "\\mttsix" : "𝟼", + "\\mttseven" : "𝟽", + "\\mtteight" : "𝟾", + "\\mttnine" : "𝟿", +} diff --git a/IPython/core/tests/test_completer.py b/IPython/core/tests/test_completer.py index 340b28e..f1a951a 100644 --- a/IPython/core/tests/test_completer.py +++ b/IPython/core/tests/test_completer.py @@ -126,6 +126,27 @@ def test_unicode_completions(): nt.assert_true(isinstance(text, string_types)) nt.assert_true(isinstance(matches, list)) +@dec.onlyif(sys.version_info[0] >= 3, 'This test only applies in Py>=3') +def test_latex_completions(): + from IPython.core.latex_symbols import latex_symbols + import random + ip = get_ipython() + # Test some random unicode symbols + keys = random.sample(latex_symbols.keys(), 10) + for k in keys: + text, matches = ip.complete(k) + nt.assert_equal(len(matches),1) + nt.assert_equal(text, k) + nt.assert_equal(matches[0], latex_symbols[k]) + # Test a more complex line + text, matches = ip.complete(u'print(\\alpha') + nt.assert_equals(text, u'\\alpha') + nt.assert_equals(matches[0], latex_symbols['\\alpha']) + # Test multiple matching latex symbols + text, matches = ip.complete(u'\\al') + nt.assert_in('\\alpha', matches) + nt.assert_in('\\aleph', matches) + class CompletionSplitterTestCase(unittest.TestCase): def setUp(self): diff --git a/IPython/html/static/notebook/js/codemirror-ipython.js b/IPython/html/static/notebook/js/codemirror-ipython.js index 1fb01ee..d01abe9 100644 --- a/IPython/html/static/notebook/js/codemirror-ipython.js +++ b/IPython/html/static/notebook/js/codemirror-ipython.js @@ -15,6 +15,11 @@ CodeMirror.requireMode('python',function(){ } pythonConf.name = 'python'; pythonConf.singleOperators = new RegExp("^[\\+\\-\\*/%&|\\^~<>!\\?]"); + if (pythonConf.version === 3) { + pythonConf.identifiers = new RegExp("^[_A-Za-z\u00A1-\uFFFF][_A-Za-z0-9\u00A1-\uFFFF]*"); + } else if (pythonConf.version === 2) { + pythonConf.identifiers = new RegExp("^[_A-Za-z][_A-Za-z0-9]*"); + } return CodeMirror.getMode(conf, pythonConf); }, 'python'); diff --git a/tools/gen_latex_symbols.py b/tools/gen_latex_symbols.py new file mode 100644 index 0000000..47cb8af --- /dev/null +++ b/tools/gen_latex_symbols.py @@ -0,0 +1,84 @@ +# coding: utf-8 + +# This script autogenerates `IPython.core.latex_symbols.py`, which contains a +# single dict , named `latex_symbols`. The keys in this dict are latex symbols, +# such as `\\alpha` and the values in the dict are the unicode equivalents for +# those. Most importantly, only unicode symbols that are valid identifers in +# Python 3 are included. + +# +# The original mapping of latex symbols to unicode comes from the `latex_symbols.jl` files from Julia. + +from __future__ import print_function +import os, sys + +if not sys.version_info[0] == 3: + print("This script must be run with Python 3, exiting...") + sys.exit(1) + +# Import the Julia LaTeX symbols +print('Importing latex_symbols.js from Julia...') +import requests +url = 'https://raw.githubusercontent.com/JuliaLang/julia/master/base/latex_symbols.jl' +r = requests.get(url) + + +# Build a list of key, value pairs +print('Building a list of (latex, unicode) key-vaule pairs...') +lines = r.text.splitlines()[60:] +lines = [line for line in lines if '=>' in line] +lines = [line.replace('=>',':') for line in lines] + +def line_to_tuple(line): + """Convert a single line of the .jl file to a 2-tuple of strings like ("\\alpha", "α")""" + kv = line.split(',')[0].split(':') +# kv = tuple(line.strip(', ').split(':')) + k, v = kv[0].strip(' "'), kv[1].strip(' "') +# if not test_ident(v): +# print(line) + return k, v + +assert line_to_tuple(' "\\sqrt" : "\u221A",') == ('\\sqrt', '\u221A') +lines = [line_to_tuple(line) for line in lines] + + +# Filter out non-valid identifiers +print('Filtering out characters that are not valid Python 3 identifiers') + +def test_ident(i): + """Is the unicode string valid in a Python 3 identifer.""" + # Some characters are not valid at the start of a name, but we still want to + # include them. So prefix with 'a', which is valid at the start. + return ('a' + i).isidentifier() + +assert test_ident("α") +assert not test_ident('‴') + +valid_idents = [line for line in lines if test_ident(line[1])] + + +# Write the `latex_symbols.py` module in the cwd + +s = """# encoding: utf-8 + +# DO NOT EDIT THIS FILE BY HAND. + +# To update this file, run the script /tools/gen_latex_symbols.py using Python 3 + +# This file is autogenerated from the file: +# https://raw.githubusercontent.com/JuliaLang/julia/master/base/latex_symbols.jl +# This original list is filtered to remove any unicode characters that are not valid +# Python identifiers. + +latex_symbols = {\n +""" +for line in valid_idents: + s += ' "%s" : "%s",\n' % (line[0], line[1]) +s += "}\n" + +fn = os.path.join('..','IPython','core','latex_symbols.py') +print("Writing the file: %s" % fn) +with open(fn, 'w', encoding='utf-8') as f: + f.write(s) + +