├── .gitignore ├── .no-sublime-package ├── CiteBibtex.py ├── CiteBibtex.sublime-commands ├── CiteBibtex.sublime-settings ├── Default.sublime-keymap ├── LICENSE ├── Main.sublime-menu ├── README.md ├── lib ├── COPYING_bibtexparser ├── README.md ├── __init__.py ├── bibtexparser │ ├── __init__.py │ ├── bibdatabase.py │ ├── bparser.py │ ├── bwriter.py │ ├── customization.py │ └── latexenc.py └── md2bib.py ├── messages.json └── messages ├── 1.1.0.md ├── 1.2.0.md ├── 1.2.1.md ├── 1.2.2.md ├── 1.3.0.md ├── 1.3.1.md └── install.md /.gitignore: -------------------------------------------------------------------------------- 1 | *.pyc 2 | tmp/ 3 | -------------------------------------------------------------------------------- /.no-sublime-package: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sjpfenninger/citebibtex/b61b3d8c2209a7117799becb37b318074811fdd2/.no-sublime-package -------------------------------------------------------------------------------- /CiteBibtex.py: -------------------------------------------------------------------------------- 1 | import sublime 2 | import sublime_plugin 3 | 4 | import os 5 | from collections import defaultdict 6 | 7 | from .lib.bibtexparser.bparser import BibTexParser 8 | from .lib.bibtexparser import customization 9 | from .lib import md2bib 10 | 11 | 12 | class CiteBibtex(object): 13 | def plugin_loaded_setup(self): 14 | ## 15 | # Load settings 16 | ## 17 | plugin_settings_file = self.__class__.__name__ + '.sublime-settings' 18 | self.plugin_settings = sublime.load_settings(plugin_settings_file) 19 | ## 20 | # Initialize and load global references 21 | ## 22 | global_file = self.plugin_settings.get('bibtex_file') 23 | self.last_modified = {} 24 | self.refs_dict = {} 25 | self.refs = {} 26 | self.ref_keys = {} 27 | _ = self.check_modified(global_file) 28 | self._update_in_progress = False 29 | sublime.set_timeout_async(lambda: self.update_refs(global_file), 0) 30 | 31 | def get_setting(self, setting, return_source=False): 32 | project_data = sublime.active_window().project_data() 33 | # Check whether there is a project-specific override 34 | if project_data and setting in project_data: 35 | result = project_data[setting] 36 | source = 'project' 37 | else: 38 | result = self.plugin_settings.get(setting) 39 | source = 'global' 40 | if return_source: 41 | return (result, source) 42 | else: 43 | return result 44 | 45 | def get_citation_style(self): 46 | autodetect_syntaxes = self.plugin_settings.get('autodetect_syntaxes') 47 | view = sublime.active_window().active_view() 48 | current_syntax = view.settings().get('syntax') 49 | current_syntax = os.path.splitext(os.path.basename(current_syntax))[0] 50 | if (self.get_setting('autodetect_citation_style') and 51 | current_syntax in autodetect_syntaxes): 52 | style = autodetect_syntaxes[current_syntax] 53 | else: 54 | style = self.get_setting('default_citation_style') 55 | 56 | strings = self.plugin_settings.get('styles') 57 | 58 | try: 59 | citation_string = strings[style] 60 | except KeyError: 61 | error_message = 'Unknown citation style: {}'.format(style) 62 | sublime.status_message(error_message) 63 | raise KeyError(error_message) 64 | return citation_string 65 | 66 | def check_modified(self, ref_file): 67 | try: 68 | modified = os.path.getmtime(ref_file) 69 | except FileNotFoundError: 70 | error_message = 'ERROR: Can\'t open BibTeX file ' 71 | sublime.status_message(error_message + ref_file) 72 | raise 73 | if ref_file not in self.last_modified: # Initialize if needed 74 | self.last_modified[ref_file] = modified 75 | return True # Upate needed if this file was never seen before 76 | else: 77 | if modified > self.last_modified[ref_file]: 78 | self.last_modified[ref_file] = modified 79 | return True # Update needed if file was modified 80 | else: 81 | return False 82 | 83 | def get_item(self, i): 84 | # Year 85 | try: 86 | year = i['year'] 87 | except KeyError: 88 | try: 89 | year = i['issued'] 90 | except KeyError: 91 | year = '' 92 | 93 | # Authors 94 | try: 95 | authors = i['author'] 96 | # authors is a list of 'last, first' strings, we only want 97 | # the last names here 98 | authors = ', '.join([a.split(',',)[0] for a in authors]) 99 | except KeyError: 100 | authors = '' 101 | 102 | # Title 103 | try: 104 | title = i['title'] 105 | except KeyError: 106 | title = '' 107 | 108 | # Publication 109 | if 'journal' in i or 'journaltitle' in i: 110 | if 'journal' in i: 111 | publication = i['journal'] 112 | else: 113 | publication = i['journaltitle'] 114 | if 'volume' in i: 115 | publication = publication + ' (' + i['volume'] + ')' 116 | if 'number' in i: 117 | publication = publication + ' ' + i['number'] 118 | else: 119 | try: 120 | publication = i['institution'] 121 | except KeyError: 122 | try: 123 | publication = i['booktitle'] 124 | except KeyError: 125 | # Final fallback if cannot determine publication 126 | publication = i['ENTRYTYPE'].capitalize() 127 | 128 | # Set search key 129 | search_key = i['ID'] 130 | additional_search_fields = self.get_setting('additional_search_fields') 131 | if additional_search_fields: 132 | search_key += ' | ' 133 | for field in additional_search_fields: 134 | try: 135 | if isinstance(i[field], list): 136 | result = ', '.join(i[field]) 137 | else: 138 | result = i[field] 139 | search_key += result + ' | ' 140 | except KeyError: 141 | pass 142 | 143 | return [search_key, year + ' | ' + authors, title, publication] 144 | 145 | def update_refs(self, ref_file): 146 | self._update_in_progress = True 147 | encoding = self.get_setting('bibtex_file_encoding') 148 | parser = BibTexParser() 149 | parser.ignore_nonstandard_types = False 150 | def customizer(record): 151 | record = customization.author(record) 152 | return record 153 | parser.customization = customizer 154 | with open(ref_file, 'r', encoding=encoding) as f: 155 | bib = parser.parse_file(f) 156 | self.refs_dict[ref_file] = refs = bib.entries_dict 157 | self.refs[ref_file] = [self.get_item(refs[i]) for i in refs] 158 | self.ref_keys[ref_file] = [refs[i]['ID'] for i in refs] 159 | self._update_in_progress = False 160 | 161 | def update_refs_then_show_panel(self, ref_file): 162 | window = sublime.active_window() 163 | self.update_refs(ref_file) 164 | ref_source = self.current_ref_source 165 | window.show_quick_panel(self.refs[ref_source], self.insert_ref) 166 | 167 | def show_selector(self, selector_callback=None): 168 | 169 | if selector_callback is None: 170 | selector_callback = self.insert_ref 171 | 172 | # Don't do anything if this is repeatedly called during an update, 173 | # until BibTeX file is completely read 174 | if self._update_in_progress: 175 | return None 176 | 177 | window = sublime.active_window() 178 | 179 | ref_source, source = self.get_setting('bibtex_file', 180 | return_source=True) 181 | if source == 'project' and not os.path.isabs(ref_source): 182 | ref_dir = os.path.dirname(window.project_file_name()) 183 | ref_source = os.path.join(ref_dir, ref_source) 184 | self.current_ref_source = ref_source 185 | 186 | # Before showing selector, check whether BibTeX file was modified 187 | # and update it if needed 188 | if self.check_modified(ref_source): 189 | sublime.status_message('BibTeX file has changed; reloading.') 190 | callback = lambda: self.update_refs_then_show_panel(ref_source) 191 | sublime.set_timeout_async(callback, 0) 192 | else: 193 | window.show_quick_panel(self.refs[ref_source], selector_callback) 194 | 195 | def insert_ref(self, refid): 196 | if refid == -1: # Don't do anything if nothing was selected 197 | return None 198 | ref_key = self.ref_keys[self.current_ref_source][refid] 199 | citation = self.get_citation_style().replace('$CITATION', ref_key) 200 | view = sublime.active_window().active_view() 201 | view.run_command('insert_reference', {'reference': citation}) 202 | 203 | def insert_citation(self, refid): 204 | if refid == -1: # Don't do anything if nothing was selected 205 | return None 206 | ref_key = self.ref_keys[self.current_ref_source][refid] 207 | # Use defaultdict to prevent errors in format string 208 | # due to missing keys, simply filing them with empty strings 209 | ref_dict = defaultdict(lambda: '', 210 | self.refs_dict[self.current_ref_source][ref_key].copy()) 211 | text_fmt = self.get_setting('citation_format_string') 212 | # Concatenate all authors into one string 213 | ref_dict['author'] = ', '.join(ref_dict['author']).strip() 214 | text = text_fmt.format(**ref_dict) 215 | view = sublime.active_window().active_view() 216 | view.run_command('insert_reference', {'reference': text}) 217 | 218 | def extract_citations(self): 219 | """ 220 | Extracts those citations from the global BibTeX file 221 | that are cited in the currently active file, and saves them 222 | to a BibTeX file alongside the currently active file. 223 | 224 | """ 225 | current_file = sublime.active_window().active_view().file_name() 226 | # split off extension 227 | basefile, extension = os.path.splitext(current_file) 228 | bibsubset_file = basefile + '.bib' 229 | bibtex_file = self.plugin_settings.get('bibtex_file') 230 | md2bib.extract_bibliography(current_file, bibtex_file, 231 | bibsubset_file) 232 | _, fname = os.path.split(bibsubset_file) 233 | sublime.status_message('Extracted citations to {}'.format(fname)) 234 | 235 | 236 | class CiteBibtexShowReferenceSelectorCommand(sublime_plugin.ApplicationCommand): 237 | def run(self, **kwargs): 238 | _sublimebibtex.show_selector() 239 | 240 | 241 | class CiteBibtexShowCitationSelectorCommand(sublime_plugin.ApplicationCommand): 242 | def run(self, **kwargs): 243 | _sublimebibtex.show_selector(selector_callback=_sublimebibtex.insert_citation) 244 | 245 | 246 | class InsertReferenceCommand(sublime_plugin.TextCommand): 247 | def run(self, edit, reference): 248 | # Only using the first cursor no matter how many there are 249 | cursor_pos = self.view.sel()[0].begin() 250 | self.view.insert(edit, cursor_pos, reference) 251 | 252 | 253 | class ExtractCitationsCommand(sublime_plugin.ApplicationCommand): 254 | def run(self, **kwargs): 255 | _sublimebibtex.extract_citations() 256 | 257 | 258 | def plugin_loaded(): 259 | _sublimebibtex.plugin_loaded_setup() 260 | 261 | 262 | _sublimebibtex = CiteBibtex() 263 | -------------------------------------------------------------------------------- /CiteBibtex.sublime-commands: -------------------------------------------------------------------------------- 1 | [ 2 | { "caption": "CiteBibTeX: Extract citations in current file", 3 | "command": "extract_citations" 4 | } 5 | ] -------------------------------------------------------------------------------- /CiteBibtex.sublime-settings: -------------------------------------------------------------------------------- 1 | { 2 | // Path to global BibTeX file 3 | // (can be overridden on a per-project basis) 4 | 5 | "bibtex_file": "", 6 | 7 | // Encoding of the BibTeX file 8 | // It should not normally be necessary to change this 9 | // (can be overridden on a per-project basis) 10 | 11 | "bibtex_file_encoding": "utf-8", 12 | 13 | // Default citation style to use 14 | // Also used as a fallback when auto-detection is enabled but fails 15 | // (can be overridden on a per-project basis) 16 | 17 | "default_citation_style": "pandoc", 18 | 19 | // Auto-detect citation style based on a file's syntax? 20 | // (can be overridden on a per-project basis) 21 | 22 | "autodetect_citation_style": true, 23 | 24 | // Additional fields to make searchable when displaying the quick panel 25 | // (the citekey is always searched and displayed first) 26 | 27 | "additional_search_fields": [], 28 | 29 | // !! 30 | // The remainder of the settings below 31 | // cannot be overridden on a per-project basis 32 | // !! 33 | 34 | // How to match citation style to syntax when using auto-detection 35 | 36 | "autodetect_syntaxes": {"LaTeX": "latex", 37 | "LaTeX Beamer": "latex", 38 | "LaTeX Memoir": "latex", 39 | "Markdown": "pandoc", 40 | "MultiMarkdown": "pandoc", 41 | "Markdown GFM": "pandoc", 42 | "AcademicMarkdown": "pandoc"}, 43 | 44 | // Citation style definitions 45 | // "$CITATION" will be replaced by the actual citation key 46 | // Backslash needs to be escaped 47 | 48 | "styles": {"pandoc": "[@$CITATION]", 49 | "latex": "\\citep{$CITATION}"}, 50 | 51 | "citation_format_string": "{author} ({year}). {title}" 52 | } 53 | -------------------------------------------------------------------------------- /Default.sublime-keymap: -------------------------------------------------------------------------------- 1 | [ 2 | { "keys": ["f10"], "command": "cite_bibtex_show_reference_selector" }, 3 | { "keys": ["f9"], "command": "cite_bibtex_show_citation_selector" } 4 | ] 5 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /Main.sublime-menu: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "caption": "Preferences", 4 | "mnemonic": "n", 5 | "id": "preferences", 6 | "children": 7 | [ 8 | { 9 | "caption": "Package Settings", 10 | "mnemonic": "P", 11 | "id": "package-settings", 12 | "children": 13 | [ 14 | { 15 | "caption": "CiteBibtex", 16 | "children": 17 | [ 18 | { 19 | "command": "open_file", 20 | "args": {"file": "${packages}/CiteBibtex/CiteBibtex.sublime-settings"}, 21 | "caption": "Settings – Default" 22 | }, 23 | { 24 | "command": "open_file", 25 | "args": {"file": "${packages}/User/CiteBibtex.sublime-settings"}, 26 | "caption": "Settings – User" 27 | }, 28 | { "caption": "-" }, 29 | { 30 | "command": "open_file", 31 | "args": {"file": "${packages}/CiteBibtex/Default.sublime-keymap"}, 32 | "caption": "Key Bindings – Default" 33 | }, 34 | { 35 | "command": "open_file", 36 | "args": { 37 | "file": "${packages}/User/Default (OSX).sublime-keymap", 38 | "platform": "OSX" 39 | }, 40 | "caption": "Key Bindings – User" 41 | }, 42 | { 43 | "command": "open_file", 44 | "args": { 45 | "file": "${packages}/User/Default (Linux).sublime-keymap", 46 | "platform": "Linux" 47 | }, 48 | "caption": "Key Bindings – User" 49 | }, 50 | { 51 | "command": "open_file", 52 | "args": { 53 | "file": "${packages}/User/Default (Windows).sublime-keymap", 54 | "platform": "Windows" 55 | }, 56 | "caption": "Key Bindings – User" 57 | } 58 | ] 59 | } 60 | ] 61 | } 62 | ] 63 | } 64 | ] 65 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # CiteBibtex 2 | 3 | A Sublime Text plugin to effortlessly insert citations from BibTeX into texts written in Pandoc or LaTeX. 4 | 5 | ## Installation 6 | 7 | Install via [Package Control](https://sublime.wbond.net/packages/CiteBibtex). 8 | 9 | Compatible with Sublime Text 3 only. 10 | 11 | ## Initial configuration 12 | 13 | Set the path to your global BibTeX file (`bibtex_file`) in the plugin settings. 14 | 15 | ## Use 16 | 17 | Pressing the citation shortcut key (bound to `F10` by default) brings up a quick panel for searching the bibliography file. Once the desired reference is found, pressing enter or clicking on it will insert a citation at the current cursor position (if there is more than one cursor, at the first cursor's position). The BibTeX file is checked for modifications each time the quick panel is brought up. 18 | 19 | The format for inserted citations is auto-detected as `pandoc` (for use with [Pandoc](http://johnmacfarlane.net/pandoc/README.html)) or `latex` based on the syntax of the open file (this can be disabled by setting `"autodetect_citation_style": false` in the plugin settings). If auto-detection fails, the default is to use `pandoc` (which can be changed by setting `default_citation_style` in the plugin settings). 20 | 21 | The `bibtex_file` setting can be overridden on a per-project basis in the project settings, using either a path relative to the project settings file or an absolute path. The following example project settings demonstrate this: 22 | 23 | ```json 24 | { 25 | "folders": 26 | [ 27 | { 28 | "follow_symlinks": true, 29 | "path": ".", 30 | } 31 | ], 32 | "bibtex_file": "path/to/bibtex.bib" 33 | } 34 | ``` 35 | 36 | ## Inserting plaintext bibliography entries 37 | 38 | There is a separate command (bound to `F9` by default) to insert a pre-formatted plaintext bibliography entry rather than a citation key. This is configured via the new `citation_format_string` setting in the plugin settings, which is a Python format string, set to `"{author} ({year}). {title}"` by default. Any BibTeX field can be used in the format string, missing ones will be replaced with an empty string. 39 | 40 | ## Extraction of citations from master BibTeX file 41 | 42 | The command `CiteBibTeX: Extract citations in current file` is available via the command palette, and will extract all references used in the currently open file from the global BibTeX file, saving that subset in a local BibTeX file. 43 | 44 | For example, if `my_paper.md` is currently open and cites 10 out of 100 references in the global BibTeX file, calling this command will save those 10 references in a file called `my_paper.bib` in the same directory as `my_paper.md`. This may useful to keep references portable alongside the text that uses them for sharing or archiving. 45 | 46 | ## Acknowledgments 47 | 48 | Includes the BibTeX parsing library [python-bibtexparser](https://github.com/sciunto-org/python-bibtexparser) (LGPLv3-licensed). 49 | 50 | Includes `md2bib.py` from [pandoc-wrappers](https://github.com/reagle/pandoc-wrappers) by Joseph Reagle (GPLv3-licensed). 51 | 52 | ## License 53 | 54 | GNU GPLv3 (see `LICENSE` file). 55 | -------------------------------------------------------------------------------- /lib/COPYING_bibtexparser: -------------------------------------------------------------------------------- 1 | The code is distributed under a dual license (at your choice). 2 | 3 | ##################################################################### 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are 6 | met: 7 | 8 | (1) Redistributions of source code must retain the above copyright 9 | notice, this list of conditions and the following disclaimer. 10 | 11 | (2) Redistributions in binary form must reproduce the above copyright 12 | notice, this list of conditions and the following disclaimer in 13 | the documentation and/or other materials provided with the 14 | distribution. 15 | 16 | (3)The name of the author may not be used to 17 | endorse or promote products derived from this software without 18 | specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 21 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 22 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, 24 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 25 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 28 | STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 29 | IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 30 | POSSIBILITY OF SUCH DAMAGE. 31 | 32 | ##################################################################### 33 | GNU LESSER GENERAL PUBLIC LICENSE 34 | Version 3, 29 June 2007 35 | 36 | Copyright (C) 2007 Free Software Foundation, Inc. 37 | Everyone is permitted to copy and distribute verbatim copies 38 | of this license document, but changing it is not allowed. 39 | 40 | 41 | This version of the GNU Lesser General Public License incorporates 42 | the terms and conditions of version 3 of the GNU General Public 43 | License, supplemented by the additional permissions listed below. 44 | 45 | 0. Additional Definitions. 46 | 47 | As used herein, "this License" refers to version 3 of the GNU Lesser 48 | General Public License, and the "GNU GPL" refers to version 3 of the GNU 49 | General Public License. 50 | 51 | "The Library" refers to a covered work governed by this License, 52 | other than an Application or a Combined Work as defined below. 53 | 54 | An "Application" is any work that makes use of an interface provided 55 | by the Library, but which is not otherwise based on the Library. 56 | Defining a subclass of a class defined by the Library is deemed a mode 57 | of using an interface provided by the Library. 58 | 59 | A "Combined Work" is a work produced by combining or linking an 60 | Application with the Library. The particular version of the Library 61 | with which the Combined Work was made is also called the "Linked 62 | Version". 63 | 64 | The "Minimal Corresponding Source" for a Combined Work means the 65 | Corresponding Source for the Combined Work, excluding any source code 66 | for portions of the Combined Work that, considered in isolation, are 67 | based on the Application, and not on the Linked Version. 68 | 69 | The "Corresponding Application Code" for a Combined Work means the 70 | object code and/or source code for the Application, including any data 71 | and utility programs needed for reproducing the Combined Work from the 72 | Application, but excluding the System Libraries of the Combined Work. 73 | 74 | 1. Exception to Section 3 of the GNU GPL. 75 | 76 | You may convey a covered work under sections 3 and 4 of this License 77 | without being bound by section 3 of the GNU GPL. 78 | 79 | 2. Conveying Modified Versions. 80 | 81 | If you modify a copy of the Library, and, in your modifications, a 82 | facility refers to a function or data to be supplied by an Application 83 | that uses the facility (other than as an argument passed when the 84 | facility is invoked), then you may convey a copy of the modified 85 | version: 86 | 87 | a) under this License, provided that you make a good faith effort to 88 | ensure that, in the event an Application does not supply the 89 | function or data, the facility still operates, and performs 90 | whatever part of its purpose remains meaningful, or 91 | 92 | b) under the GNU GPL, with none of the additional permissions of 93 | this License applicable to that copy. 94 | 95 | 3. Object Code Incorporating Material from Library Header Files. 96 | 97 | The object code form of an Application may incorporate material from 98 | a header file that is part of the Library. You may convey such object 99 | code under terms of your choice, provided that, if the incorporated 100 | material is not limited to numerical parameters, data structure 101 | layouts and accessors, or small macros, inline functions and templates 102 | (ten or fewer lines in length), you do both of the following: 103 | 104 | a) Give prominent notice with each copy of the object code that the 105 | Library is used in it and that the Library and its use are 106 | covered by this License. 107 | 108 | b) Accompany the object code with a copy of the GNU GPL and this license 109 | document. 110 | 111 | 4. Combined Works. 112 | 113 | You may convey a Combined Work under terms of your choice that, 114 | taken together, effectively do not restrict modification of the 115 | portions of the Library contained in the Combined Work and reverse 116 | engineering for debugging such modifications, if you also do each of 117 | the following: 118 | 119 | a) Give prominent notice with each copy of the Combined Work that 120 | the Library is used in it and that the Library and its use are 121 | covered by this License. 122 | 123 | b) Accompany the Combined Work with a copy of the GNU GPL and this license 124 | document. 125 | 126 | c) For a Combined Work that displays copyright notices during 127 | execution, include the copyright notice for the Library among 128 | these notices, as well as a reference directing the user to the 129 | copies of the GNU GPL and this license document. 130 | 131 | d) Do one of the following: 132 | 133 | 0) Convey the Minimal Corresponding Source under the terms of this 134 | License, and the Corresponding Application Code in a form 135 | suitable for, and under terms that permit, the user to 136 | recombine or relink the Application with a modified version of 137 | the Linked Version to produce a modified Combined Work, in the 138 | manner specified by section 6 of the GNU GPL for conveying 139 | Corresponding Source. 140 | 141 | 1) Use a suitable shared library mechanism for linking with the 142 | Library. A suitable mechanism is one that (a) uses at run time 143 | a copy of the Library already present on the user's computer 144 | system, and (b) will operate properly with a modified version 145 | of the Library that is interface-compatible with the Linked 146 | Version. 147 | 148 | e) Provide Installation Information, but only if you would otherwise 149 | be required to provide such information under section 6 of the 150 | GNU GPL, and only to the extent that such information is 151 | necessary to install and execute a modified version of the 152 | Combined Work produced by recombining or relinking the 153 | Application with a modified version of the Linked Version. (If 154 | you use option 4d0, the Installation Information must accompany 155 | the Minimal Corresponding Source and Corresponding Application 156 | Code. If you use option 4d1, you must provide the Installation 157 | Information in the manner specified by section 6 of the GNU GPL 158 | for conveying Corresponding Source.) 159 | 160 | 5. Combined Libraries. 161 | 162 | You may place library facilities that are a work based on the 163 | Library side by side in a single library together with other library 164 | facilities that are not Applications and are not covered by this 165 | License, and convey such a combined library under terms of your 166 | choice, if you do both of the following: 167 | 168 | a) Accompany the combined library with a copy of the same work based 169 | on the Library, uncombined with any other library facilities, 170 | conveyed under the terms of this License. 171 | 172 | b) Give prominent notice with the combined library that part of it 173 | is a work based on the Library, and explaining where to find the 174 | accompanying uncombined form of the same work. 175 | 176 | 6. Revised Versions of the GNU Lesser General Public License. 177 | 178 | The Free Software Foundation may publish revised and/or new versions 179 | of the GNU Lesser General Public License from time to time. Such new 180 | versions will be similar in spirit to the present version, but may 181 | differ in detail to address new problems or concerns. 182 | 183 | Each version is given a distinguishing version number. If the 184 | Library as you received it specifies that a certain numbered version 185 | of the GNU Lesser General Public License "or any later version" 186 | applies to it, you have the option of following the terms and 187 | conditions either of that published version or of any later version 188 | published by the Free Software Foundation. If the Library as you 189 | received it does not specify a version number of the GNU Lesser 190 | General Public License, you may choose any version of the GNU Lesser 191 | General Public License ever published by the Free Software Foundation. 192 | 193 | If the Library as you received it specifies that a proxy can decide 194 | whether future versions of the GNU Lesser General Public License shall 195 | apply, that proxy's public statement of acceptance of any version is 196 | permanent authorization for you to choose that version for the 197 | Library. 198 | -------------------------------------------------------------------------------- /lib/README.md: -------------------------------------------------------------------------------- 1 | * `bibtexparser`: From https://github.com/sciunto-org/python-bibtexparser, LGPLv3/BSD dual licensed, see `COPYING_bibtexparser`, revision fb05189f87 2 | * `md2bib.py`: Modified from md2bib.py, https://github.com/reagle/pandoc-wrappers/, which is (c) Copyright 2011-2012 by Joseph Reagle and licensed under the GPLv3. 3 | -------------------------------------------------------------------------------- /lib/__init__.py: -------------------------------------------------------------------------------- 1 | from . import bibtexparser 2 | -------------------------------------------------------------------------------- /lib/bibtexparser/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | BibTeX is a bibliographic data file format. 3 | 4 | The :mod:`bibtexparser` module provides parsing and writing of BibTeX files functionality. The API is similar to the 5 | :mod:`json` module. The parsed data is returned as a simple :class:`BibDatabase` object with the main attribute being 6 | :attr:`entries` representing bibliographic sources such as books and journal articles. 7 | 8 | Parsing is a simple as:: 9 | 10 | >>>> import bibtexparser 11 | >>>> with open('bibtex.bib') as bibtex_file: 12 | >>>> bibtex_database = bibtexparser.load(bibtex_file) 13 | 14 | And writing:: 15 | 16 | >>>> import bibtexparser 17 | >>>> with open('bibtex.bib', 'w') as bibtex_file: 18 | >>>> bibtexparser.dump(bibtex_database, bibtex_file) 19 | 20 | """ 21 | __all__ = [ 22 | 'loads', 'load', 'dumps', 'dump', 'bibdatabase', 23 | 'bparser', 'bwriter', 'latexenc', 'customization', 24 | ] 25 | __version__ = 'devel' 26 | 27 | from . import bibdatabase, bparser, bwriter, latexenc, customization 28 | 29 | 30 | def loads(bibtex_str, parser=None): 31 | """ 32 | Load :class:`BibDatabase` object from a string 33 | 34 | :param bibtex_str: input BibTeX string to be parsed 35 | :type bibtex_str: str or unicode 36 | :param parser: custom parser to use (optional) 37 | :type parser: BibTexParser 38 | :return: bibliographic database object 39 | :rtype: BibDatabase 40 | """ 41 | if parser is None: 42 | parser = bparser.BibTexParser() 43 | return parser.parse(bibtex_str) 44 | 45 | 46 | def load(bibtex_file, parser=None): 47 | """ 48 | Load :class:`BibDatabase` object from a file 49 | 50 | :param bibtex_file: input file to be parsed 51 | :type bibtex_file: file 52 | :param parser: custom parser to use (optional) 53 | :type parser: BibTexParser 54 | :return: bibliographic database object 55 | :rtype: BibDatabase 56 | """ 57 | if parser is None: 58 | parser = bparser.BibTexParser() 59 | return parser.parse_file(bibtex_file) 60 | 61 | 62 | def dumps(bib_database, writer=None): 63 | """ 64 | Dump :class:`BibDatabase` object to a BibTeX string 65 | 66 | :param bib_database: bibliographic database object 67 | :type bib_database: BibDatabase 68 | :param writer: custom writer to use (optional) (not yet implemented) 69 | :type writer: BibTexWriter 70 | :return: BibTeX string 71 | :rtype: unicode 72 | """ 73 | if writer is None: 74 | writer = bwriter.BibTexWriter() 75 | return writer.write(bib_database) 76 | 77 | 78 | def dump(bib_database, bibtex_file, writer=None): 79 | """ 80 | Save :class:`BibDatabase` object as a BibTeX text file 81 | 82 | :param bib_database: bibliographic database object 83 | :type bib_database: BibDatabase 84 | :param bibtex_file: file to write to 85 | :type bibtex_file: file 86 | :param writer: custom writer to use (optional) (not yet implemented) 87 | :type writer: BibTexWriter 88 | """ 89 | if writer is None: 90 | writer = bwriter.BibTexWriter() 91 | bibtex_file.write(writer.write(bib_database)) 92 | -------------------------------------------------------------------------------- /lib/bibtexparser/bibdatabase.py: -------------------------------------------------------------------------------- 1 | from collections import OrderedDict 2 | 3 | 4 | class BibDatabase(object): 5 | """ 6 | A bibliographic database object following the data structure of a BibTeX file. 7 | """ 8 | def __init__(self): 9 | #: List of BibTeX entries, for example `@book{...}`, `@article{...}`, etc. Each entry is a simple dict with 10 | #: BibTeX field-value pairs, for example `'author': 'Bird, R.B. and Armstrong, R.C. and Hassager, O.'` Each 11 | #: entry will always have the following dict keys (in addition to other BibTeX fields): 12 | #: - `ID` (BibTeX key) 13 | #: - `ENTRYTYPE` (entry type in lowercase, e.g. `book`, `article` etc.) 14 | self.entries = [] 15 | self._entries_dict = {} 16 | #: List of BibTeX comment (`@comment{...}`) blocks. 17 | self.comments = [] 18 | #: OrderedDict of BibTeX string definitions (`@string{...}`). In order of definition. 19 | self.strings = OrderedDict() # Not sure if order is import, keep order just in case 20 | #: List of BibTeX preamble (`@preamble{...}`) blocks. 21 | self.preambles = [] 22 | 23 | def get_entry_list(self): 24 | """Get a list of bibtex entries. 25 | 26 | :returns: BibTeX entries 27 | :rtype: list 28 | .. deprecated:: 0.5.6 29 | Use :attr:`entries` instead. 30 | """ 31 | return self.entries 32 | 33 | @staticmethod 34 | def entry_sort_key(entry, fields): 35 | result = [] 36 | for field in fields: 37 | result.append(str(entry.get(field, '')).lower()) # Sorting always as string 38 | return tuple(result) 39 | 40 | def get_entry_dict(self): 41 | """Return a dictionary of BibTeX entries. 42 | The dict key is the BibTeX entry key 43 | """ 44 | # If the hash has never been made, make it 45 | if not self._entries_dict: 46 | for entry in self.entries: 47 | self._entries_dict[entry['ID']] = entry 48 | return self._entries_dict 49 | 50 | entries_dict = property(get_entry_dict) 51 | -------------------------------------------------------------------------------- /lib/bibtexparser/bparser.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | # Original source: github.com/okfn/bibserver 5 | # Authors: 6 | # markmacgillivray 7 | # Etienne Posthumus (epoz) 8 | # Francois Boulogne 9 | 10 | import sys 11 | import logging 12 | import io 13 | import re 14 | from .bibdatabase import BibDatabase 15 | 16 | logger = logging.getLogger(__name__) 17 | 18 | __all__ = ['BibTexParser'] 19 | 20 | 21 | if sys.version_info >= (3, 0): 22 | from io import StringIO 23 | ustr = str 24 | else: 25 | from StringIO import StringIO 26 | ustr = unicode 27 | 28 | 29 | class BibTexParser(object): 30 | """ 31 | A parser for reading BibTeX bibliographic data files. 32 | 33 | Example:: 34 | 35 | from bibtexparser.bparser import BibTexParser 36 | 37 | bibtex_str = ... 38 | 39 | parser = BibTexParser() 40 | parser.ignore_nonstandard_types = False 41 | parser.homogenise_fields = False 42 | bib_database = bibtexparser.loads(bibtex_str, parser) 43 | """ 44 | 45 | def __new__(cls, data=None, 46 | customization=None, 47 | ignore_nonstandard_types=True, 48 | homogenise_fields=True): 49 | """ 50 | To catch the old API structure in which creating the parser would immediately parse and return data. 51 | """ 52 | 53 | if data is None: 54 | return super(BibTexParser, cls).__new__(cls) 55 | else: 56 | # For backwards compatibility: if data is given, parse and return the `BibDatabase` object instead of the 57 | # parser. 58 | parser = BibTexParser() 59 | parser.customization = customization 60 | parser.ignore_nonstandard_types = ignore_nonstandard_types 61 | parser.homogenise_fields = homogenise_fields 62 | return parser.parse(data) 63 | 64 | def __init__(self): 65 | """ 66 | Creates a parser for rading BibTeX files 67 | 68 | :return: parser 69 | :rtype: `BibTexParser` 70 | """ 71 | self.bib_database = BibDatabase() 72 | #: Callback function to process BibTeX entries after parsing, for example to create a list from a string with 73 | #: multiple values. By default all BibTeX values are treated as simple strings. Default: `None`. 74 | self.customization = None 75 | 76 | #: Ignore non-standard BibTeX types (`book`, `article`, etc). Default: `True`. 77 | self.ignore_nonstandard_types = True 78 | 79 | #: Sanitise BibTeX field names, for example change `url` to `link` etc. Field names are always converted to 80 | #: lowercase names. Default: `True`. 81 | self.homogenise_fields = True 82 | 83 | # On some sample data files, the character encoding detection simply 84 | # hangs We are going to default to utf8, and mandate it. 85 | self.encoding = 'utf8' 86 | 87 | # pre-defined set of key changes 88 | self.alt_dict = { 89 | 'keyw': 'keyword', 90 | 'keywords': 'keyword', 91 | 'authors': 'author', 92 | 'editors': 'editor', 93 | 'url': 'link', 94 | 'urls': 'link', 95 | 'links': 'link', 96 | 'subjects': 'subject' 97 | } 98 | 99 | self.replace_all_re = re.compile(r'((?P
"?)\s*(#|^)\s*(?P[^\d\W]\w*)\s*(#|$)\s*(?P"?))', re.UNICODE)
100 | 
101 |     def _bibtex_file_obj(self, bibtex_str):
102 |         # Some files have Byte-order marks inserted at the start
103 |         byte = '\xef\xbb\xbf'
104 |         if not isinstance(byte, ustr):
105 |             byte = ustr('\xef\xbb\xbf', self.encoding, 'ignore')
106 |         if bibtex_str[:3] == byte:
107 |             bibtex_str = bibtex_str[3:]
108 |         return StringIO(bibtex_str)
109 | 
110 |     def parse(self, bibtex_str):
111 |         """Parse a BibTeX string into an object
112 | 
113 |         :param bibtex_str: BibTeX string
114 |         :type: str or unicode
115 |         :return: bibliographic database
116 |         :rtype: BibDatabase
117 |         """
118 |         self.bibtex_file_obj = self._bibtex_file_obj(bibtex_str)
119 |         self._parse_records(customization=self.customization)
120 |         return self.bib_database
121 | 
122 |     def parse_file(self, file):
123 |         """Parse a BibTeX file into an object
124 | 
125 |         :param file: BibTeX file or file-like object
126 |         :type: file
127 |         :return: bibliographic database
128 |         :rtype: BibDatabase
129 |         """
130 |         return self.parse(file.read())
131 | 
132 |     def _parse_records(self, customization=None):
133 |         """Parse the bibtex into a list of records.
134 | 
135 |         :param customization: a function
136 |         """
137 |         def _add_parsed_record(record, records):
138 |             """
139 |             Atomic function to parse a record
140 |             and append the result in records
141 |             """
142 |             if record != "":
143 |                 logger.debug('The record is not empty. Let\'s parse it.')
144 |                 parsed = self._parse_record(record, customization=customization)
145 |                 if parsed:
146 |                     logger.debug('Store the result of the parsed record')
147 |                     records.append(parsed)
148 |                 else:
149 |                     logger.debug('Nothing returned from the parsed record!')
150 |             else:
151 |                 logger.debug('The record is empty')
152 | 
153 |         records = []
154 |         record = ""
155 |         # read each line, bundle them up until they form an object, then send for parsing
156 |         for linenumber, line in enumerate(self.bibtex_file_obj):
157 |             logger.debug('Inspect line %s', linenumber)
158 |             if line.strip().startswith('@'):
159 |                 # Remove leading whitespaces
160 |                 line = line.lstrip()
161 |                 logger.debug('Line starts with @')
162 |                 # Parse previous record
163 |                 _add_parsed_record(record, records)
164 |                 # Start new record
165 |                 logger.debug('The record is set to empty')
166 |                 record = ""
167 |             # Keep adding lines to the record
168 |             record += line
169 | 
170 |         # catch any remaining record and send it for parsing
171 |         _add_parsed_record(record, records)
172 |         logger.debug('Set the list of entries')
173 |         self.bib_database.entries = records
174 | 
175 |     def _parse_record(self, record, customization=None):
176 |         """Parse a record.
177 | 
178 |         * tidy whitespace and other rubbish
179 |         * parse out the bibtype and citekey
180 |         * find all the key-value pairs it contains
181 | 
182 |         :param record: a record
183 |         :param customization: a function
184 | 
185 |         :returns: dict --
186 |         """
187 |         d = {}
188 | 
189 |         if not record.startswith('@'):
190 |             logger.debug('The record does not start with @. Return empty dict.')
191 |             return {}
192 | 
193 |         # if a comment record, add to bib_database.comments
194 |         if record.lower().startswith('@comment'):
195 |             logger.debug('The record startswith @comment')
196 |             logger.debug('Store comment in list of comments')
197 | 
198 |             self.bib_database.comments.append(re.search('\{(.*)\}', record, re.DOTALL).group(1))
199 | 
200 |             logger.debug('Return an empty dict')
201 |             return {}
202 | 
203 |         # if a preamble record, add to bib_database.preambles
204 |         if record.lower().startswith('@preamble'):
205 |             logger.debug('The record startswith @preamble')
206 |             logger.debug('Store preamble in list of preambles')
207 | 
208 |             self.bib_database.preambles.append(re.search('\{(.*)\}', record, re.DOTALL).group(1))
209 | 
210 |             logger.debug('Return an empty dict')
211 |             return {}
212 | 
213 |         # prepare record
214 |         record = '\n'.join([i.strip() for i in record.split('\n')])
215 |         if '}\n' in record:
216 |             logger.debug('}\\n detected in the record. Clean up.')
217 |             record = record.replace('\r\n', '\n').replace('\r', '\n').rstrip('\n')
218 |             # treat the case for which the last line of the record
219 |             # does not have a coma
220 |             if record.endswith('}\n}') or record.endswith('}}'):
221 |                 logger.debug('Missing coma in the last line of the record. Fix it.')
222 |                 record = re.sub('}(\n|)}$', '},\n}', record)
223 | 
224 |         # if a string record, put it in the replace_dict
225 |         if record.lower().startswith('@string'):
226 |             logger.debug('The record startswith @string')
227 |             key, val = [i.strip().strip('{').strip('}').replace('\n', ' ') for i in record.split('{', 1)[1].strip('\n').strip(',').strip('}').split('=')]
228 |             key = key.lower()  # key is case insensitive
229 |             val = self._string_subst_partial(val)
230 |             if val.startswith('"') or val.lower() not in self.bib_database.strings:
231 |                 self.bib_database.strings[key] = val.strip('"')
232 |             else:
233 |                 self.bib_database.strings[key] = self.bib_database.strings[val.lower()]
234 |             logger.debug('Return a dict')
235 |             return d
236 | 
237 |         # for each line in record
238 |         logger.debug('Split the record of its lines and treat them')
239 |         kvs = [i.strip() for i in re.split(',\s*\n|\n\s*,', record)]
240 |         inkey = ""
241 |         inval = ""
242 |         for kv in kvs:
243 |             logger.debug('Inspect: %s', kv)
244 |             # TODO: We may check that the keyword belongs to a known type
245 |             if kv.startswith('@') and not inkey:
246 |                 # it is the start of the record - set the bibtype and citekey (id)
247 |                 logger.debug('Line starts with @ and the key is not stored yet.')
248 |                 bibtype, id = kv.split('{', 1)
249 |                 bibtype = self._add_key(bibtype)
250 |                 id = id.lstrip().strip('}').strip(',')
251 |                 logger.debug('bibtype = %s', bibtype)
252 |                 logger.debug('id = %s', id)
253 |                 if self.ignore_nonstandard_types and bibtype not in ('article',
254 |                                                                      'book',
255 |                                                                      'booklet',
256 |                                                                      'conference',
257 |                                                                      'inbook',
258 |                                                                      'incollection',
259 |                                                                      'inproceedings',
260 |                                                                      'manual',
261 |                                                                      'mastersthesis',
262 |                                                                      'misc',
263 |                                                                      'phdthesis',
264 |                                                                      'proceedings',
265 |                                                                      'techreport',
266 |                                                                      'unpublished'):
267 |                     logger.warning('Entry type %s not standard. Not considered.', bibtype)
268 |                     break
269 |             elif '=' in kv and not inkey:
270 |                 # it is a line with a key value pair on it
271 |                 logger.debug('Line contains a key-pair value and the key is not stored yet.')
272 |                 key, val = [i.strip() for i in kv.split('=', 1)]
273 |                 key = self._add_key(key)
274 |                 val = self._string_subst_partial(val)
275 |                 # if it looks like the value spans lines, store details for next loop
276 |                 if (val.count('{') != val.count('}')) or (val.startswith('"') and not val.replace('}', '').endswith('"')):
277 |                     logger.debug('The line is not ending the record.')
278 |                     inkey = key
279 |                     inval = val
280 |                 else:
281 |                     logger.debug('The line is the end of the record.')
282 |                     d[key] = self._add_val(val)
283 |             elif inkey:
284 |                 logger.debug('Continues the previous line to complete the key pair value...')
285 |                 # if this line continues the value from a previous line, append
286 |                 inval += ', ' + kv
287 |                 # if it looks like this line finishes the value, store it and clear for next loop
288 |                 if (inval.startswith('{') and inval.endswith('}')) or (inval.startswith('"') and inval.endswith('"')):
289 |                     logger.debug('This line represents the end of the current key-pair value')
290 |                     d[inkey] = self._add_val(inval)
291 |                     inkey = ""
292 |                     inval = ""
293 |                 else:
294 |                     logger.debug('This line does NOT represent the end of the current key-pair value')
295 | 
296 |         logger.debug('All lines have been treated')
297 |         if not d:
298 |             logger.debug('The dict is empty, return it.')
299 |             return d
300 | 
301 |         d['ENTRYTYPE'] = bibtype
302 |         d['ID'] = id
303 | 
304 |         if customization is None:
305 |             logger.debug('No customization to apply, return dict')
306 |             return d
307 |         else:
308 |             # apply any customizations to the record object then return it
309 |             logger.debug('Apply customizations and return dict')
310 |             return customization(d)
311 | 
312 |     def _strip_quotes(self, val):
313 |         """Strip double quotes enclosing string
314 | 
315 |         :param val: a value
316 |         :type val: string
317 |         :returns: string -- value
318 |         """
319 |         logger.debug('Strip quotes')
320 |         val = val.strip()
321 |         if val.startswith('"') and val.endswith('"'):
322 |             return val[1:-1]
323 |         return val
324 | 
325 |     def _strip_braces(self, val):
326 |         """Strip braces enclosing string
327 | 
328 |         :param val: a value
329 |         :type val: string
330 |         :returns: string -- value
331 |         """
332 |         logger.debug('Strip braces')
333 |         val = val.strip()
334 |         if val.startswith('{') and val.endswith('}') and self._full_span(val):
335 |             return val[1:-1]
336 |         return val
337 | 
338 |     def _full_span(self, val):
339 |         cnt = 0
340 |         for i in range(0, len(val)):
341 |                 if val[i] == '{':
342 |                         cnt += 1
343 |                 elif val[i] == '}':
344 |                         cnt -= 1
345 |                 if cnt == 0:
346 |                         break
347 |         if i == len(val) - 1:
348 |                 return True
349 |         else:
350 |                 return False
351 | 
352 |     def _string_subst(self, val):
353 |         """ Substitute string definitions
354 | 
355 |         :param val: a value
356 |         :type val: string
357 |         :returns: string -- value
358 |         """
359 |         logger.debug('Substitute string definitions')
360 |         if not val:
361 |             return ''
362 |         for k in list(self.bib_database.strings.keys()):
363 |             if val.lower() == k:
364 |                 val = self.bib_database.strings[k]
365 |         if not isinstance(val, ustr):
366 |             val = ustr(val, self.encoding, 'ignore')
367 | 
368 |         return val
369 | 
370 |     def _string_subst_partial(self, val):
371 |         """ Substitute string definitions inside larger expressions
372 | 
373 |         :param val: a value
374 |         :type val: string
375 |         :returns: string -- value
376 |         """
377 |         def repl(m):
378 |             k = m.group('id')
379 |             replacement = self.bib_database.strings[k.lower()] if k.lower() in self.bib_database.strings else k
380 |             pre = '"' if m.group('pre') != '"' else ''
381 |             post = '"' if m.group('post') != '"' else ''
382 |             return pre + replacement + post
383 | 
384 |         logger.debug('Substitute string definitions inside larger expressions')
385 |         if '#' not in val:
386 |             return val
387 | 
388 |         # TODO?: Does not match two subsequent variables or strings, such as  "start" # foo # bar # "end"  or  "start" # "end".
389 |         # TODO:  Does not support braces instead of quotes, e.g.: {start} # foo # {bar}
390 |         # TODO:  Does not support strings like: "te#s#t"
391 |         return self.replace_all_re.sub(repl, val)
392 | 
393 |     def _add_val(self, val):
394 |         """ Clean instring before adding to dictionary
395 | 
396 |         :param val: a value
397 |         :type val: string
398 |         :returns: string -- value
399 |         """
400 |         if not val or val == "{}":
401 |             return ''
402 |         val = self._strip_braces(val)
403 |         val = self._strip_quotes(val)
404 |         val = self._strip_braces(val)
405 |         val = self._string_subst(val)
406 |         return val
407 | 
408 |     def _add_key(self, key):
409 |         """ Add a key and homogeneize alternative forms.
410 | 
411 |         :param key: a key
412 |         :type key: string
413 |         :returns: string -- value
414 |         """
415 |         key = key.strip().strip('@').lower()
416 |         if self.homogenise_fields:
417 |             if key in list(self.alt_dict.keys()):
418 |                 key = self.alt_dict[key]
419 |         if not isinstance(key, ustr):
420 |             return ustr(key, 'utf-8')
421 |         else:
422 |             return key
423 | 


--------------------------------------------------------------------------------
/lib/bibtexparser/bwriter.py:
--------------------------------------------------------------------------------
  1 | #!/usr/bin/env python
  2 | # -*- coding: utf-8 -*-
  3 | # Author: Francois Boulogne
  4 | # License:
  5 | 
  6 | import logging
  7 | from .bibdatabase import BibDatabase
  8 | 
  9 | logger = logging.getLogger(__name__)
 10 | 
 11 | __all__ = ['BibTexWriter']
 12 | 
 13 | 
 14 | def to_bibtex(parsed):
 15 |     """
 16 |     Convenience function for backwards compatibility.
 17 |     """
 18 |     return BibTexWriter().write(parsed)
 19 | 
 20 | 
 21 | class BibTexWriter(object):
 22 |     """
 23 |     Writer to convert a :class:`BibDatabase` object to a string or file formatted as a BibTeX file.
 24 | 
 25 |     Example::
 26 | 
 27 |         from bibtexparser.bwriter import BibTexWriter
 28 | 
 29 |         bib_database = ...
 30 | 
 31 |         writer = BibTexWriter()
 32 |         writer.contents = ['comments', 'entries']
 33 |         writer.indent = '  '
 34 |         writer.order_entries_by = ('ENTRYTYPE', 'author', 'year')
 35 |         bibtex_str = bibtexparser.dumps(bib_database, writer)
 36 | 
 37 |     """
 38 | 
 39 |     _valid_contents = ['entries', 'comments', 'preambles', 'strings']
 40 | 
 41 |     def __init__(self):
 42 |         #: List of BibTeX elements to write, valid values are `entries`, `comments`, `preambles`, `strings`.
 43 |         self.contents = ['comments', 'preambles', 'strings', 'entries']
 44 |         #: Character(s) for indenting BibTeX field-value pairs. Default: single space.
 45 |         self.indent = ' '
 46 |         #: Characters(s) for separating BibTeX entries. Default: new line.
 47 |         self.entry_separator = '\n'
 48 |         #: Tuple of fields for ordering entries. Set to `None` to disable sorting. Default: BibTeX key `('ID', )`.
 49 |         self.order_entries_by = ('ID', )
 50 |         #: BibTeX syntax allows comma first syntax
 51 |         #: (common in functional languages), use this to enable
 52 |         #: comma first syntax as the bwritter output
 53 |         self.comma_first = False
 54 | 
 55 |     def write(self, bib_database):
 56 |         """
 57 |         Converts a bibliographic database to a BibTeX-formatted string.
 58 | 
 59 |         :param bib_database: bibliographic database to be converted to a BibTeX string
 60 |         :type bib_database: BibDatabase
 61 |         :return: BibTeX-formatted string
 62 |         :rtype: str or unicode
 63 |         """
 64 |         bibtex = ''
 65 |         for content in self.contents:
 66 |             try:
 67 |                 # Add each element set (entries, comments)
 68 |                 bibtex += getattr(self, '_' + content + '_to_bibtex')(bib_database)
 69 |             except AttributeError:
 70 |                 logger.warning("BibTeX item '{}' does not exist and will not be written. Valid items are {}."
 71 |                                .format(content, self._valid_contents))
 72 |         return bibtex
 73 | 
 74 |     def _entries_to_bibtex(self, bib_database):
 75 |         bibtex = ''
 76 |         if self.order_entries_by:
 77 |             # TODO: allow sort field does not exist for entry
 78 |             entries = sorted(bib_database.entries, key=lambda x: BibDatabase.entry_sort_key(x, self.order_entries_by))
 79 |         else:
 80 |             entries = bib_database.entries
 81 | 
 82 |         for entry in entries:
 83 |             bibtex += self._entry_to_bibtex(entry)
 84 |         return bibtex
 85 | 
 86 |     def _entry_to_bibtex(self, entry):
 87 |         bibtex = ''
 88 |         # Write BibTeX key
 89 |         bibtex += '@' + entry['ENTRYTYPE'] + '{' + entry['ID']
 90 | 
 91 |         # Write field = value lines
 92 |         for field in [i for i in sorted(entry) if i not in ['ENTRYTYPE', 'ID']]:
 93 |             try:
 94 |                 if self.comma_first:
 95 |                     bibtex += "\n," + self.indent + field + " = {" + entry[field] + "}"
 96 |                 else:
 97 |                     bibtex += ",\n" + self.indent + field + " = {" + entry[field] + "}"
 98 |             except TypeError:
 99 |                 raise TypeError("The field %s in entry %s must be a string"
100 |                                 % (field, entry['ID']))
101 |         bibtex += "\n}\n" + self.entry_separator
102 |         return bibtex
103 | 
104 |     def _comments_to_bibtex(self, bib_database):
105 |         return ''.join(['@comment{{{0}}}\n{1}'.format(comment, self.entry_separator)
106 |                         for comment in bib_database.comments])
107 | 
108 |     def _preambles_to_bibtex(self, bib_database):
109 |         return ''.join(['@preamble{{{0}}}\n{1}'.format(preamble, self.entry_separator)
110 |                         for preamble in bib_database.preambles])
111 | 
112 |     def _strings_to_bibtex(self, bib_database):
113 |         return ''.join(['@string{{{0} = "{1}"}}\n{2}'.format(name, value, self.entry_separator)
114 |                         for name, value in bib_database.strings.items()])
115 | 


--------------------------------------------------------------------------------
/lib/bibtexparser/customization.py:
--------------------------------------------------------------------------------
  1 | #!/usr/bin/env python
  2 | # -*- coding: utf-8 -*-
  3 | 
  4 | """
  5 | A set of functions useful for customizing bibtex fields.
  6 | You can find inspiration from these functions to design yours.
  7 | Each of them takes a record and return the modified record.
  8 | """
  9 | 
 10 | import itertools
 11 | import re
 12 | import logging
 13 | 
 14 | from .latexenc import unicode_to_latex, unicode_to_crappy_latex1, unicode_to_crappy_latex2, string_to_latex, protect_uppercase
 15 | 
 16 | logger = logging.getLogger(__name__)
 17 | 
 18 | __all__ = ['getnames', 'author', 'editor', 'journal', 'keyword', 'link',
 19 |            'page_double_hyphen', 'doi', 'type', 'convert_to_unicode',
 20 |            'homogeneize_latex_encoding']
 21 | 
 22 | 
 23 | def getnames(names):
 24 |     """Make people names as surname, firstnames
 25 |     or surname, initials. Should eventually combine up the two.
 26 | 
 27 |     :param names: a list of names
 28 |     :type names: list
 29 |     :returns: list -- Correctly formated names
 30 |     """
 31 |     tidynames = []
 32 |     for namestring in names:
 33 |         namestring = namestring.strip()
 34 |         if len(namestring) < 1:
 35 |             continue
 36 |         if ',' in namestring:
 37 |             namesplit = namestring.split(',', 1)
 38 |             last = namesplit[0].strip()
 39 |             firsts = [i.strip() for i in namesplit[1].split()]
 40 |         else:
 41 |             namesplit = namestring.split()
 42 |             last = namesplit.pop()
 43 |             firsts = [i.replace('.', '. ').strip() for i in namesplit]
 44 |         if last in ['jnr', 'jr', 'junior']:
 45 |             last = firsts.pop()
 46 |         for item in firsts:
 47 |             if item in ['ben', 'van', 'der', 'de', 'la', 'le']:
 48 |                 last = firsts.pop() + ' ' + last
 49 |         tidynames.append(last + ", " + ' '.join(firsts))
 50 |     return tidynames
 51 | 
 52 | 
 53 | def author(record):
 54 |     """
 55 |     Split author field into a list of "Name, Surname".
 56 | 
 57 |     :param record: the record.
 58 |     :type record: dict
 59 |     :returns: dict -- the modified record.
 60 | 
 61 |     """
 62 |     if "author" in record:
 63 |         if record["author"]:
 64 |             record["author"] = getnames([i.strip() for i in record["author"].replace('\n', ' ').split(" and ")])
 65 |         else:
 66 |             del record["author"]
 67 |     return record
 68 | 
 69 | 
 70 | def editor(record):
 71 |     """
 72 |     Turn the editor field into a dict composed of the original editor name
 73 |     and a editor id (without coma or blank).
 74 | 
 75 |     :param record: the record.
 76 |     :type record: dict
 77 |     :returns: dict -- the modified record.
 78 | 
 79 |     """
 80 |     if "editor" in record:
 81 |         if record["editor"]:
 82 |             record["editor"] = getnames([i.strip() for i in record["editor"].replace('\n', ' ').split(" and ")])
 83 |             # convert editor to object
 84 |             record["editor"] = [{"name": i, "ID": i.replace(',', '').replace(' ', '').replace('.', '')} for i in record["editor"]]
 85 |         else:
 86 |             del record["editor"]
 87 |     return record
 88 | 
 89 | 
 90 | def page_double_hyphen(record):
 91 |     """
 92 |     Separate pages by a double hyphen (--).
 93 | 
 94 |     :param record: the record.
 95 |     :type record: dict
 96 |     :returns: dict -- the modified record.
 97 | 
 98 |     """
 99 |     if "pages" in record:
100 |         if "-" in record["pages"]:
101 |             p = [i.strip().strip('-') for i in record["pages"].split("-")]
102 |             record["pages"] = p[0] + '--' + p[-1]
103 |     return record
104 | 
105 | 
106 | def type(record):
107 |     """
108 |     Put the type into lower case.
109 | 
110 |     :param record: the record.
111 |     :type record: dict
112 |     :returns: dict -- the modified record.
113 | 
114 |     """
115 |     if "type" in record:
116 |         record["type"] = record["type"].lower()
117 |     return record
118 | 
119 | 
120 | def journal(record):
121 |     """
122 |     Turn the journal field into a dict composed of the original journal name
123 |     and a journal id (without coma or blank).
124 | 
125 |     :param record: the record.
126 |     :type record: dict
127 |     :returns: dict -- the modified record.
128 | 
129 |     """
130 |     if "journal" in record:
131 |         # switch journal to object
132 |         if record["journal"]:
133 |             record["journal"] = {"name": record["journal"], "ID": record["journal"].replace(',', '').replace(' ', '').replace('.', '')}
134 | 
135 |     return record
136 | 
137 | 
138 | def keyword(record, sep=',|;'):
139 |     """
140 |     Split keyword field into a list.
141 | 
142 |     :param record: the record.
143 |     :type record: dict
144 |     :param sep: pattern used for the splitting regexp.
145 |     :type record: string, optional
146 |     :returns: dict -- the modified record.
147 | 
148 |     """
149 |     if "keyword" in record:
150 |         record["keyword"] = [i.strip() for i in re.split(sep, record["keyword"].replace('\n', ''))]
151 | 
152 |     return record
153 | 
154 | 
155 | def link(record):
156 |     """
157 | 
158 |     :param record: the record.
159 |     :type record: dict
160 |     :returns: dict -- the modified record.
161 | 
162 |     """
163 |     if "link" in record:
164 |         links = [i.strip().replace("  ", " ") for i in record["link"].split('\n')]
165 |         record['link'] = []
166 |         for link in links:
167 |             parts = link.split(" ")
168 |             linkobj = {"url": parts[0]}
169 |             if len(parts) > 1:
170 |                 linkobj["anchor"] = parts[1]
171 |             if len(parts) > 2:
172 |                 linkobj["format"] = parts[2]
173 |             if len(linkobj["url"]) > 0:
174 |                 record["link"].append(linkobj)
175 | 
176 |     return record
177 | 
178 | 
179 | def doi(record):
180 |     """
181 | 
182 |     :param record: the record.
183 |     :type record: dict
184 |     :returns: dict -- the modified record.
185 | 
186 |     """
187 |     if 'doi' in record:
188 |         if 'link' not in record:
189 |             record['link'] = []
190 |         nodoi = True
191 |         for item in record['link']:
192 |             if 'doi' in item:
193 |                 nodoi = False
194 |         if nodoi:
195 |             link = record['doi']
196 |             if link.startswith('10'):
197 |                 link = 'http://dx.doi.org/' + link
198 |             record['link'].append({"url": link, "anchor": "doi"})
199 |     return record
200 | 
201 | 
202 | def convert_to_unicode(record):
203 |     """
204 |     Convert accent from latex to unicode style.
205 | 
206 |     :param record: the record.
207 |     :type record: dict
208 |     :returns: dict -- the modified record.
209 |     """
210 |     for val in record:
211 |         if '\\' in record[val] or '{' in record[val]:
212 |             for k, v in itertools.chain(unicode_to_crappy_latex1, unicode_to_latex):
213 |                 if v in record[val]:
214 |                     record[val] = record[val].replace(v, k)
215 | 
216 |         # If there is still very crappy items
217 |         if '\\' in record[val]:
218 |             for k, v in unicode_to_crappy_latex2:
219 |                 if v in record[val]:
220 |                     parts = record[val].split(str(v))
221 |                     for key, record[val] in enumerate(parts):
222 |                         if key+1 < len(parts) and len(parts[key+1]) > 0:
223 |                             # Change order to display accents
224 |                             parts[key] = parts[key] + parts[key+1][0]
225 |                             parts[key+1] = parts[key+1][1:]
226 |                     record[val] = k.join(parts)
227 |     return record
228 | 
229 | 
230 | def homogeneize_latex_encoding(record):
231 |     """
232 |     Homogeneize the latex enconding style for bibtex
233 | 
234 |     This function is experimental.
235 | 
236 |     :param record: the record.
237 |     :type record: dict
238 |     :returns: dict -- the modified record.
239 |     """
240 |     # First, we convert everything to unicode
241 |     record = convert_to_unicode(record)
242 |     # And then, we fall back
243 |     for val in record:
244 |         if val not in ('ID',):
245 |             logger.debug('Apply string_to_latex to: %s', val)
246 |             record[val] = string_to_latex(record[val])
247 |             if val == 'title':
248 |                 logger.debug('Protect uppercase in title')
249 |                 logger.debug('Before: %s', record[val])
250 |                 record[val] = protect_uppercase(record[val])
251 |                 logger.debug('After: %s', record[val])
252 |     return record
253 | 


--------------------------------------------------------------------------------
/lib/bibtexparser/latexenc.py:
--------------------------------------------------------------------------------
   1 | #!/usr/bin/env python
   2 | # -*- coding: utf-8 -*-
   3 | 
   4 | # Original source: github.com/okfn/bibserver
   5 | # Authors:
   6 | # markmacgillivray
   7 | # Etienne Posthumus (epoz)
   8 | # Francois Boulogne 
   9 | 
  10 | import re
  11 | import sys
  12 | 
  13 | __all__ = ['string_to_latex', 'protect_uppercase', 'unicode_to_latex',
  14 |            'unicode_to_crappy_latex1', 'unicode_to_crappy_latex2']
  15 | 
  16 | 
  17 | def string_to_latex(string):
  18 |     """
  19 |     Convert a string to its latex equivalent
  20 |     """
  21 |     escape = [' ', '{', '}']
  22 | 
  23 |     new = []
  24 |     for char in string:
  25 |         if char in escape:
  26 |             new.append(char)
  27 |         else:
  28 |             new.append(unicode_to_latex_map.get(char, char))
  29 |     return ''.join(new)
  30 | 
  31 | 
  32 | def protect_uppercase(string):
  33 |     """
  34 |     Protect uppercase letters for bibtex
  35 | 
  36 |     :param string: string to convert
  37 |     :returns: string
  38 |     """
  39 |     string = re.sub('([^{]|^)([A-Z])([^}]|$)', '\g<1>{\g<2>}\g<3>', string)
  40 |     return string
  41 | 
  42 | 
  43 | # list of latex conversions from
  44 | # https://gist.github.com/798549
  45 | # this list contrains crappy accents
  46 | # like \`{e} which is not advised for bibtex
  47 | # http://tex.stackexchange.com/questions/57743/how-to-write-a-and-other-umlauts-and-accented-letters-in-bibliography/57745#57745
  48 | # Correct accent are in unicode_to_latex
  49 | unicode_to_latex = []
  50 | unicode_to_latex_map = {}
  51 | unicode_to_crappy_latex1 = []
  52 | unicode_to_crappy_latex2 = []
  53 | 
  54 | def prepare_unicode_to_latex():
  55 |     global unicode_to_latex
  56 |     global unicode_to_latex_map
  57 |     global unicode_to_crappy_latex1
  58 |     global unicode_to_crappy_latex2
  59 | 
  60 |     to_crappy1 = (
  61 |         ("\u00C0", "\\`{A}"),
  62 |         ("\u00C1", "\\'{A}"),
  63 |         ("\u00C2", "\\^{A}"),
  64 |         ("\u00C3", "\\~{A}"),
  65 |         ("\u00C4", "\\\"{A}"),
  66 |         ("\u00C5", "\\AA "),
  67 |         ("\u00C6", "\\AE "),
  68 |         ("\u00C7", "\\c{C}"),
  69 |         ("\u00C8", "\\`{E}"),
  70 |         ("\u00C9", "\\'{E}"),
  71 |         ("\u00CA", "\\^{E}"),
  72 |         ("\u00CB", "\\\"{E}"),
  73 |         ("\u00CC", "\\`{I}"),
  74 |         ("\u00CD", "\\'{I}"),
  75 |         ("\u00CE", "\\^{I}"),
  76 |         ("\u00CF", "\\\"{I}"),
  77 |         ("\u00D0", "\\DH "),
  78 |         ("\u00D1", "\\~{N}"),
  79 |         ("\u00D2", "\\`{O}"),
  80 |         ("\u00D3", "\\'{O}"),
  81 |         ("\u00D4", "\\^{O}"),
  82 |         ("\u00D5", "\\~{O}"),
  83 |         ("\u00D6", "\\\"{O}"),
  84 |         ("\u00D7", "\\texttimes "),
  85 |         ("\u00D8", "\\O "),
  86 |         ("\u00D9", "\\`{U}"),
  87 |         ("\u00DA", "\\'{U}"),
  88 |         ("\u00DB", "\\^{U}"),
  89 |         ("\u00DC", "\\\"{U}"),
  90 |         ("\u00DD", "\\'{Y}"),
  91 |         ("\u00DE", "\\TH "),
  92 |         ("\u00DF", "\\ss "),
  93 |         ("\u00E0", "\\`{a}"),
  94 |         ("\u00E1", "\\'{a}"),
  95 |         ("\u00E2", "\\^{a}"),
  96 |         ("\u00E3", "\\~{a}"),
  97 |         ("\u00E4", "\\\"{a}"),
  98 |         ("\u00E5", "\\aa "),
  99 |         ("\u00E6", "\\ae "),
 100 |         ("\u00E7", "\\c{c}"),
 101 |         ("\u00E8", "\\`{e}"),
 102 |         ("\u00E9", "\\'{e}"),
 103 |         ("\u00EA", "\\^{e}"),
 104 |         ("\u00EB", "\\\"{e}"),
 105 |         ("\u00EC", "\\`{\\i}"),
 106 |         ("\u00ED", "\\'{\\i}"),
 107 |         ("\u00EE", "\\^{\\i}"),
 108 |         ("\u00EF", "\\\"{\\i}"),
 109 |         ("\u00F0", "\\dh "),
 110 |         ("\u00F1", "\\~{n}"),
 111 |         ("\u00F2", "\\`{o}"),
 112 |         ("\u00F3", "\\'{o}"),
 113 |         ("\u00F4", "\\^{o}"),
 114 |         ("\u00F5", "\\~{o}"),
 115 |         ("\u00F6", "\\\"{o}"),
 116 |         ("\u00F7", "\\div "),
 117 |         ("\u00F8", "\\o "),
 118 |         ("\u00F9", "\\`{u}"),
 119 |         ("\u00FA", "\\'{u}"),
 120 |         ("\u00FB", "\\^{u}"),
 121 |         ("\u00FC", "\\\"{u}"),
 122 |         ("\u00FD", "\\'{y}"),
 123 |         ("\u00FE", "\\th "),
 124 |         ("\u00FF", "\\\"{y}"),
 125 |         ("\u0100", "\\={A}"),
 126 |         ("\u0101", "\\={a}"),
 127 |         ("\u0102", "\\u{A}"),
 128 |         ("\u0103", "\\u{a}"),
 129 |         ("\u0104", "\\k{A}"),
 130 |         ("\u0105", "\\k{a}"),
 131 |         ("\u0106", "\\'{C}"),
 132 |         ("\u0107", "\\'{c}"),
 133 |         ("\u0108", "\\^{C}"),
 134 |         ("\u0109", "\\^{c}"),
 135 |         ("\u010A", "\\.{C}"),
 136 |         ("\u010B", "\\.{c}"),
 137 |         ("\u010C", "\\v{C}"),
 138 |         ("\u010D", "\\v{c}"),
 139 |         ("\u010E", "\\v{D}"),
 140 |         ("\u010F", "\\v{d}"),
 141 |         ("\u0110", "\\DJ "),
 142 |         ("\u0111", "\\dj "),
 143 |         ("\u0112", "\\={E}"),
 144 |         ("\u0113", "\\={e}"),
 145 |         ("\u0114", "\\u{E}"),
 146 |         ("\u0115", "\\u{e}"),
 147 |         ("\u0116", "\\.{E}"),
 148 |         ("\u0117", "\\.{e}"),
 149 |         ("\u0118", "\\k{E}"),
 150 |         ("\u0119", "\\k{e}"),
 151 |         ("\u011A", "\\v{E}"),
 152 |         ("\u011B", "\\v{e}"),
 153 |         ("\u011C", "\\^{G}"),
 154 |         ("\u011D", "\\^{g}"),
 155 |         ("\u011E", "\\u{G}"),
 156 |         ("\u011F", "\\u{g}"),
 157 |         ("\u0120", "\\.{G}"),
 158 |         ("\u0121", "\\.{g}"),
 159 |         ("\u0122", "\\c{G}"),
 160 |         ("\u0123", "\\c{g}"),
 161 |         ("\u0124", "\\^{H}"),
 162 |         ("\u0125", "\\^{h}"),
 163 |         ("\u0126", "{\\fontencoding{LELA}\\selectfont\\char40}"),
 164 |         ("\u0127", "\\Elzxh "),
 165 |         ("\u0128", "\\~{I}"),
 166 |         ("\u0129", "\\~{\\i}"),
 167 |         ("\u012A", "\\={I}"),
 168 |         ("\u012B", "\\={\\i}"),
 169 |         ("\u012C", "\\u{I}"),
 170 |         ("\u012D", "\\u{\\i}"),
 171 |         ("\u012E", "\\k{I}"),
 172 |         ("\u012F", "\\k{i}"),
 173 |         ("\u0130", "\\.{I}"),
 174 |         ("\u0131", "\\i "),
 175 | #        (u"\u0132", "IJ"),
 176 | #        (u"\u0133", "ij"),
 177 |         ("\u0134", "\\^{J}"),
 178 |         ("\u0135", "\\^{\\j}"),
 179 |         ("\u0136", "\\c{K}"),
 180 |         ("\u0137", "\\c{k}"),
 181 |         ("\u0138", "{\\fontencoding{LELA}\\selectfont\\char91}"),
 182 |         ("\u0139", "\\'{L}"),
 183 |         ("\u013A", "\\'{l}"),
 184 |         ("\u013B", "\\c{L}"),
 185 |         ("\u013C", "\\c{l}"),
 186 |         ("\u013D", "\\v{L}"),
 187 |         ("\u013E", "\\v{l}"),
 188 |         ("\u013F", "{\\fontencoding{LELA}\\selectfont\\char201}"),
 189 |         ("\u0140", "{\\fontencoding{LELA}\\selectfont\\char202}"),
 190 |         ("\u0141", "\\L "),
 191 |         ("\u0142", "\\l "),
 192 |         ("\u0143", "\\'{N}"),
 193 |         ("\u0144", "\\'{n}"),
 194 |         ("\u0145", "\\c{N}"),
 195 |         ("\u0146", "\\c{n}"),
 196 |         ("\u0147", "\\v{N}"),
 197 |         ("\u0148", "\\v{n}"),
 198 |         ("\u0149", "'n"),
 199 |         ("\u014A", "\\NG "),
 200 |         ("\u014B", "\\ng "),
 201 |         ("\u014C", "\\={O}"),
 202 |         ("\u014D", "\\={o}"),
 203 |         ("\u014E", "\\u{O}"),
 204 |         ("\u014F", "\\u{o}"),
 205 |         ("\u0150", "\\H{O}"),
 206 |         ("\u0151", "\\H{o}"),
 207 |         ("\u0152", "\\OE "),
 208 |         ("\u0153", "\\oe "),
 209 |         ("\u0154", "\\'{R}"),
 210 |         ("\u0155", "\\'{r}"),
 211 |         ("\u0156", "\\c{R}"),
 212 |         ("\u0157", "\\c{r}"),
 213 |         ("\u0158", "\\v{R}"),
 214 |         ("\u0159", "\\v{r}"),
 215 |         ("\u015A", "\\'{S}"),
 216 |         ("\u015B", "\\'{s}"),
 217 |         ("\u015C", "\\^{S}"),
 218 |         ("\u015D", "\\^{s}"),
 219 |         ("\u015E", "\\c{S}"),
 220 |         ("\u015F", "\\c{s}"),
 221 |         ("\u0160", "\\v{S}"),
 222 |         ("\u0161", "\\v{s}"),
 223 |         ("\u0162", "\\c{T}"),
 224 |         ("\u0163", "\\c{t}"),
 225 |         ("\u0164", "\\v{T}"),
 226 |         ("\u0165", "\\v{t}"),
 227 |         ("\u0166", "{\\fontencoding{LELA}\\selectfont\\char47}"),
 228 |         ("\u0167", "{\\fontencoding{LELA}\\selectfont\\char63}"),
 229 |         ("\u0168", "\\~{U}"),
 230 |         ("\u0169", "\\~{u}"),
 231 |         ("\u016A", "\\={U}"),
 232 |         ("\u016B", "\\={u}"),
 233 |         ("\u016C", "\\u{U}"),
 234 |         ("\u016D", "\\u{u}"),
 235 |         ("\u016E", "\\r{U}"),
 236 |         ("\u016F", "\\r{u}"),
 237 |         ("\u0170", "\\H{U}"),
 238 |         ("\u0171", "\\H{u}"),
 239 |         ("\u0172", "\\k{U}"),
 240 |         ("\u0173", "\\k{u}"),
 241 |         ("\u0174", "\\^{W}"),
 242 |         ("\u0175", "\\^{w}"),
 243 |         ("\u0176", "\\^{Y}"),
 244 |         ("\u0177", "\\^{y}"),
 245 |         ("\u0178", "\\\"{Y}"),
 246 |         ("\u0179", "\\'{Z}"),
 247 |         ("\u017A", "\\'{z}"),
 248 |         ("\u017B", "\\.{Z}"),
 249 |         ("\u017C", "\\.{z}"),
 250 |         ("\u017D", "\\v{Z}"),
 251 |         ("\u017E", "\\v{z}"),
 252 |         ("\u0195", "\\texthvlig "),
 253 |         ("\u019E", "\\textnrleg "),
 254 |         ("\u01AA", "\\eth "),
 255 |         ("\u01BA", "{\\fontencoding{LELA}\\selectfont\\char195}"),
 256 |         ("\u01C2", "\\textdoublepipe "),
 257 |         ("\u01F5", "\\'{g}"),
 258 |         ("\u0386", "\\'{A}"),
 259 |         ("\u0388", "\\'{E}"),
 260 |         ("\u0389", "\\'{H}"),
 261 |         ("\u03CC", "\\'{o}"),
 262 |     )
 263 | 
 264 |     # These are dangerous
 265 |     # should not be used on
 266 |     # {\'E} for instance!
 267 |     to_crappy2 = (
 268 |         ("\u0300", "\\`"),
 269 |         ("\u0301", "\\'"),
 270 |         ("\u0302", "\\^"),
 271 |         ("\u0327", "\\c"),
 272 |     )
 273 | 
 274 |     # list of latex conversions from
 275 |     # https://gist.github.com/798549
 276 |     # Corrected \`{e} -> {\`e}
 277 |     to_latex = (
 278 |         ("\u0020", "\\space "),
 279 |         ("\u0023", "\\#"),
 280 |         ("\u0024", "\\textdollar "),
 281 |         ("\u0025", "\\%"),
 282 |         ("\u0026", "\\&"),
 283 |         ("\u0027", "\\textquotesingle "),
 284 |         ("\u002A", "\\ast "),
 285 |         ("\u005C", "\\textbackslash "),
 286 |         ("\u005E", "\\^{}"),
 287 |         ("\u005F", "\\_"),
 288 |         ("\u0060", "\\textasciigrave "),
 289 |         ("\u007B", "\\lbrace "),
 290 |         ("\u007C", "\\vert "),
 291 |         ("\u007D", "\\rbrace "),
 292 |         ("\u007E", "\\textasciitilde "),
 293 |         ("\u00A1", "\\textexclamdown "),
 294 |         ("\u00A2", "\\textcent "),
 295 |         ("\u00A3", "\\textsterling "),
 296 |         ("\u00A4", "\\textcurrency "),
 297 |         ("\u00A5", "\\textyen "),
 298 |         ("\u00A6", "\\textbrokenbar "),
 299 |         ("\u00A7", "\\textsection "),
 300 |         ("\u00A8", "\\textasciidieresis "),
 301 |         ("\u00A9", "\\textcopyright "),
 302 |         ("\u00AA", "\\textordfeminine "),
 303 |         ("\u00AB", "\\guillemotleft "),
 304 |         ("\u00AC", "\\lnot "),
 305 |         ("\u00AD", "\\-"),
 306 |         ("\u00AE", "\\textregistered "),
 307 |         ("\u00AF", "\\textasciimacron "),
 308 |         ("\u00B0", "\\textdegree "),
 309 |         ("\u00B1", "\\pm "),
 310 |         ("\u00B2", "{^2}"),
 311 |         ("\u00B3", "{^3}"),
 312 |         ("\u00B4", "\\textasciiacute "),
 313 |         ("\u00B5", "\\mathrm{\\mu}"),
 314 |         ("\u00B6", "\\textparagraph "),
 315 |         ("\u00B7", "\\cdot "),
 316 |         ("\u00B8", "\\c{}"),
 317 |         ("\u00B9", "{^1}"),
 318 |         ("\u00BA", "\\textordmasculine "),
 319 |         ("\u00BB", "\\guillemotright "),
 320 |         ("\u00BC", "\\textonequarter "),
 321 |         ("\u00BD", "\\textonehalf "),
 322 |         ("\u00BE", "\\textthreequarters "),
 323 |         ("\u00BF", "\\textquestiondown "),
 324 |         ("\u00C0", "{\\`A}"),
 325 |         ("\u00C1", "{\\'A}"),
 326 |         ("\u00C2", "{\\^A}"),
 327 |         ("\u00C3", "{\\~A}"),
 328 |         ("\u00C4", "{\\\"A}"),
 329 |         ("\u00C5", "{\\AA}"),
 330 |         ("\u00C6", "{\\AE}"),
 331 |         ("\u00C7", "{\\c C}"),
 332 |         ("\u00C8", "{\\`E}"),
 333 |         ("\u00C9", "{\\'E}"),
 334 |         ("\u00CA", "{\\^E}"),
 335 |         ("\u00CB", "{\\\"E}"),
 336 |         ("\u00CC", "{\\`I}"),
 337 |         ("\u00CD", "{\\'I}"),
 338 |         ("\u00CE", "{\\^I}"),
 339 |         ("\u00CF", "{\\\"I}"),
 340 |         ("\u00D0", "{\\DH}"),
 341 |         ("\u00D1", "{\\~N}"),
 342 |         ("\u00D2", "{\\`O}"),
 343 |         ("\u00D3", "{\\'O}"),
 344 |         ("\u00D4", "{\\^O}"),
 345 |         ("\u00D5", "{\\~O}"),
 346 |         ("\u00D6", "{\\\"O}"),
 347 |         ("\u00D7", "\\texttimes "),
 348 |         ("\u00D8", "{\\O}"),
 349 |         ("\u00D9", "{\\`U}"),
 350 |         ("\u00DA", "{\\'U}"),
 351 |         ("\u00DB", "{\\^U}"),
 352 |         ("\u00DC", "{\\\"U}"),
 353 |         ("\u00DD", "{\\'Y}"),
 354 |         ("\u00DE", "{\\TH}"),
 355 |         ("\u00DF", "{\\ss}"),
 356 |         ("\u00E0", "{\\`a}"),
 357 |         ("\u00E1", "{\\'a}"),
 358 |         ("\u00E2", "{\\^a}"),
 359 |         ("\u00E3", "{\\~a}"),
 360 |         ("\u00E4", "{\\\"a}"),
 361 |         ("\u00E5", "{\\aa}"),
 362 |         ("\u00E6", "{\\ae}"),
 363 |         ("\u00E7", "{\\c c}"),
 364 |         ("\u00E8", "{\\`e}"),
 365 |         ("\u00E9", "{\\'e}"),
 366 |         ("\u00EA", "{\\^e}"),
 367 |         ("\u00EB", "{\\\"e}"),
 368 |         ("\u00EC", "{\\`\\i}"),
 369 |         ("\u00ED", "{\\'\\i}"),
 370 |         ("\u00EE", "{\\^\\i}"),
 371 |         ("\u00EF", "{\\\"\\i}"),
 372 |         ("\u00F0", "{\\dh }"),
 373 |         ("\u00F1", "{\\~n}"),
 374 |         ("\u00F2", "{\\`o}"),
 375 |         ("\u00F3", "{\\'o}"),
 376 |         ("\u00F4", "{\\^o}"),
 377 |         ("\u00F5", "{\\~o}"),
 378 |         ("\u00F6", "{\\\"o}"),
 379 |         ("\u00F7", "{\\div}"),
 380 |         ("\u00F8", "{\\o}"),
 381 |         ("\u00F9", "{\\`u}"),
 382 |         ("\u00FA", "{\\'u}"),
 383 |         ("\u00FB", "{\\^u}"),
 384 |         ("\u00FC", "{\\\"u}"),
 385 |         ("\u00FD", "{\\'y}"),
 386 |         ("\u00FE", "{\\th}"),
 387 |         ("\u00FF", "{\\\"y}"),
 388 |         ("\u0100", "{\\= A}"),
 389 |         ("\u0101", "{\\= a}"),
 390 |         ("\u0102", "{\\u A}"),
 391 |         ("\u0103", "{\\u a}"),
 392 |         ("\u0104", "{\\k A}"),
 393 |         ("\u0105", "{\\k a}"),
 394 |         ("\u0106", "{\\' C}"),
 395 |         ("\u0107", "{\\' c}"),
 396 |         ("\u0108", "{\\^ C}"),
 397 |         ("\u0109", "{\\^ c}"),
 398 |         ("\u010A", "{\\. C}"),
 399 |         ("\u010B", "{\\. c}"),
 400 |         ("\u010C", "{\\v C}"),
 401 |         ("\u010D", "{\\v c}"),
 402 |         ("\u010E", "{\\v D}"),
 403 |         ("\u010F", "{\\v d}"),
 404 |         ("\u0110", "{\\DJ}"),
 405 |         ("\u0111", "{\\dj}"),
 406 |         ("\u0112", "{\\= E}"),
 407 |         ("\u0113", "{\\= e}"),
 408 |         ("\u0114", "{\\u E}"),
 409 |         ("\u0115", "{\\u e}"),
 410 |         ("\u0116", "{\\.E}"),
 411 |         ("\u0117", "{\\.e}"),
 412 |         ("\u0118", "{\\k E}"),
 413 |         ("\u0119", "{\\k e}"),
 414 |         ("\u011A", "{\\v E}"),
 415 |         ("\u011B", "{\\v e}"),
 416 |         ("\u011C", "{\\^ G}"),
 417 |         ("\u011D", "{\\^ g}"),
 418 |         ("\u011E", "{\\u G}"),
 419 |         ("\u011F", "{\\u g}"),
 420 |         ("\u0120", "{\\. G}"),
 421 |         ("\u0121", "{\\. g}"),
 422 |         ("\u0122", "{\\c G}"),
 423 |         ("\u0123", "{\\c g}"),
 424 |         ("\u0124", "{\\^ H}"),
 425 |         ("\u0125", "{\\^ h}"),
 426 |         ("\u0126", "{\\fontencoding{LELA}\\selectfont\\char40}"),
 427 |         ("\u0127", "\\Elzxh "),
 428 |         ("\u0128", "{\\~ I}"),
 429 |         ("\u0129", "{\\~ \\i}"),
 430 |         ("\u012A", "{\\= I}"),
 431 |         ("\u012B", "{\\= \\i}"),
 432 |         ("\u012C", "{\\u I}"),
 433 |         ("\u012D", "{\\u \\i}"),
 434 |         ("\u012E", "{\\k I}"),
 435 |         ("\u012F", "{\\k i}"),
 436 |         ("\u0130", "{\\. I}"),
 437 |         ("\u0131", "{\\i}"),
 438 | #        (u"\u0132", "IJ"),
 439 | #        (u"\u0133", "ij"),
 440 |         ("\u0134", "{\\^J}"),
 441 |         ("\u0135", "{\\^\\j}"),
 442 |         ("\u0136", "{\\c K}"),
 443 |         ("\u0137", "{\\c k}"),
 444 |         ("\u0138", "{\\fontencoding{LELA}\\selectfont\\char91}"),
 445 |         ("\u0139", "{\\'L}"),
 446 |         ("\u013A", "{\\'l}"),
 447 |         ("\u013B", "{\\c L}"),
 448 |         ("\u013C", "{\\c l}"),
 449 |         ("\u013D", "{\\v L}"),
 450 |         ("\u013E", "{\\v l}"),
 451 |         ("\u013F", "{\\fontencoding{LELA}\\selectfont\\char201}"),
 452 |         ("\u0140", "{\\fontencoding{LELA}\\selectfont\\char202}"),
 453 |         ("\u0141", "{\\L}"),
 454 |         ("\u0142", "{\\l}"),
 455 |         ("\u0143", "{\\'N}"),
 456 |         ("\u0144", "{\\'n}"),
 457 |         ("\u0145", "{\\c N}"),
 458 |         ("\u0146", "{\\c n}"),
 459 |         ("\u0147", "{\\v N}"),
 460 |         ("\u0148", "{\\v n}"),
 461 |         ("\u0149", "'n"),
 462 |         ("\u014A", "{\\NG}"),
 463 |         ("\u014B", "{\\ng}"),
 464 |         ("\u014C", "{\\= O}"),
 465 |         ("\u014D", "{\\= o}"),
 466 |         ("\u014E", "{\\u O}"),
 467 |         ("\u014F", "{\\u o}"),
 468 |         ("\u0150", "{\\H O}"),
 469 |         ("\u0151", "{\\H o}"),
 470 |         ("\u0152", "{\\OE}"),
 471 |         ("\u0153", "{\\oe}"),
 472 |         ("\u0154", "{\\'R}"),
 473 |         ("\u0155", "{\\'r}"),
 474 |         ("\u0156", "{\\c R}"),
 475 |         ("\u0157", "{\\c r}"),
 476 |         ("\u0158", "{\\v R}"),
 477 |         ("\u0159", "{\\v r}"),
 478 |         ("\u015A", "{\\' S}"),
 479 |         ("\u015B", "{\\' s}"),
 480 |         ("\u015C", "{\\^ S}"),
 481 |         ("\u015D", "{\\^ s}"),
 482 |         ("\u015E", "{\\c S}"),
 483 |         ("\u015F", "{\\c s}"),
 484 |         ("\u0160", "{\\v S}"),
 485 |         ("\u0161", "{\\v s}"),
 486 |         ("\u0162", "{\\c T}"),
 487 |         ("\u0163", "{\\c t}"),
 488 |         ("\u0164", "{\\v T}"),
 489 |         ("\u0165", "{\\v t}"),
 490 |         ("\u0166", "{\\fontencoding{LELA}\\selectfont\\char47}"),
 491 |         ("\u0167", "{\\fontencoding{LELA}\\selectfont\\char63}"),
 492 |         ("\u0168", "{\\~ U}"),
 493 |         ("\u0169", "{\\~ u}"),
 494 |         ("\u016A", "{\\= U}"),
 495 |         ("\u016B", "{\\= u}"),
 496 |         ("\u016C", "{\\u U}"),
 497 |         ("\u016D", "{\\u u}"),
 498 |         ("\u016E", "{\\r U}"),
 499 |         ("\u016F", "{\\r u}"),
 500 |         ("\u0170", "{\\H U}"),
 501 |         ("\u0171", "{\\H u}"),
 502 |         ("\u0172", "{\\k U}"),
 503 |         ("\u0173", "{\\k u}"),
 504 |         ("\u0174", "{\\^ W}"),
 505 |         ("\u0175", "{\\^ w}"),
 506 |         ("\u0176", "{\\^ Y}"),
 507 |         ("\u0177", "{\\^ y}"),
 508 |         ("\u0178", "{\\\" Y}"),
 509 |         ("\u0179", "{\\' Z}"),
 510 |         ("\u017A", "{\\' z}"),
 511 |         ("\u017B", "{\\. Z}"),
 512 |         ("\u017C", "{\\. z}"),
 513 |         ("\u017D", "{\\v Z}"),
 514 |         ("\u017E", "{\\v z}"),
 515 |         ("\u0195", "{\\texthvlig}"),
 516 |         ("\u019E", "{\\textnrleg}"),
 517 |         ("\u01AA", "{\\eth}"),
 518 |         ("\u01BA", "{\\fontencoding{LELA}\\selectfont\\char195}"),
 519 |         ("\u01C2", "\\textdoublepipe "),
 520 |         ("\u01F5", "{\\' g}"),
 521 |         ("\u0250", "\\Elztrna "),
 522 |         ("\u0252", "\\Elztrnsa "),
 523 |         ("\u0254", "\\Elzopeno "),
 524 |         ("\u0256", "\\Elzrtld "),
 525 |         ("\u0258", "{\\fontencoding{LEIP}\\selectfont\\char61}"),
 526 |         ("\u0259", "\\Elzschwa "),
 527 |         ("\u025B", "\\varepsilon "),
 528 |         ("\u0263", "\\Elzpgamma "),
 529 |         ("\u0264", "\\Elzpbgam "),
 530 |         ("\u0265", "\\Elztrnh "),
 531 |         ("\u026C", "\\Elzbtdl "),
 532 |         ("\u026D", "\\Elzrtll "),
 533 |         ("\u026F", "\\Elztrnm "),
 534 |         ("\u0270", "\\Elztrnmlr "),
 535 |         ("\u0271", "\\Elzltlmr "),
 536 |         ("\u0272", "\\Elzltln "),
 537 |         ("\u0273", "\\Elzrtln "),
 538 |         ("\u0277", "\\Elzclomeg "),
 539 |         ("\u0278", "\\textphi "),
 540 |         ("\u0279", "\\Elztrnr "),
 541 |         ("\u027A", "\\Elztrnrl "),
 542 |         ("\u027B", "\\Elzrttrnr "),
 543 |         ("\u027C", "\\Elzrl "),
 544 |         ("\u027D", "\\Elzrtlr "),
 545 |         ("\u027E", "\\Elzfhr "),
 546 |         ("\u027F", "{\\fontencoding{LEIP}\\selectfont\\char202}"),
 547 |         ("\u0282", "\\Elzrtls "),
 548 |         ("\u0283", "\\Elzesh "),
 549 |         ("\u0287", "\\Elztrnt "),
 550 |         ("\u0288", "\\Elzrtlt "),
 551 |         ("\u028A", "\\Elzpupsil "),
 552 |         ("\u028B", "\\Elzpscrv "),
 553 |         ("\u028C", "\\Elzinvv "),
 554 |         ("\u028D", "\\Elzinvw "),
 555 |         ("\u028E", "\\Elztrny "),
 556 |         ("\u0290", "\\Elzrtlz "),
 557 |         ("\u0292", "\\Elzyogh "),
 558 |         ("\u0294", "\\Elzglst "),
 559 |         ("\u0295", "\\Elzreglst "),
 560 |         ("\u0296", "\\Elzinglst "),
 561 |         ("\u029E", "\\textturnk "),
 562 |         ("\u02A4", "\\Elzdyogh "),
 563 |         ("\u02A7", "\\Elztesh "),
 564 |         ("\u02C7", "\\textasciicaron "),
 565 |         ("\u02C8", "\\Elzverts "),
 566 |         ("\u02CC", "\\Elzverti "),
 567 |         ("\u02D0", "\\Elzlmrk "),
 568 |         ("\u02D1", "\\Elzhlmrk "),
 569 |         ("\u02D2", "\\Elzsbrhr "),
 570 |         ("\u02D3", "\\Elzsblhr "),
 571 |         ("\u02D4", "\\Elzrais "),
 572 |         ("\u02D5", "\\Elzlow "),
 573 |         ("\u02D8", "\\textasciibreve "),
 574 |         ("\u02D9", "\\textperiodcentered "),
 575 |         ("\u02DA", "\\r{}"),
 576 |         ("\u02DB", "\\k{}"),
 577 |         ("\u02DC", "\\texttildelow "),
 578 |         ("\u02DD", "\\H{}"),
 579 |         ("\u02E5", "\\tone{55}"),
 580 |         ("\u02E6", "\\tone{44}"),
 581 |         ("\u02E7", "\\tone{33}"),
 582 |         ("\u02E8", "\\tone{22}"),
 583 |         ("\u02E9", "\\tone{11}"),
 584 |         ("\u0303", "\\~"),
 585 |         ("\u0304", "\\="),
 586 |         ("\u0306", "\\u"),
 587 |         ("\u0307", "\\."),
 588 |         ("\u0308", "\\\""),
 589 |         ("\u030A", "\\r"),
 590 |         ("\u030B", "\\H"),
 591 |         ("\u030C", "\\v"),
 592 |         ("\u030F", "\\cyrchar\\C"),
 593 |         ("\u0311", "{\\fontencoding{LECO}\\selectfont\\char177}"),
 594 |         ("\u0318", "{\\fontencoding{LECO}\\selectfont\\char184}"),
 595 |         ("\u0319", "{\\fontencoding{LECO}\\selectfont\\char185}"),
 596 |         ("\u0321", "\\Elzpalh "),
 597 |         ("\u0322", "\\Elzrh "),
 598 |         ("\u0328", "\\k"),
 599 |         ("\u032A", "\\Elzsbbrg "),
 600 |         ("\u032B", "{\\fontencoding{LECO}\\selectfont\\char203}"),
 601 |         ("\u032F", "{\\fontencoding{LECO}\\selectfont\\char207}"),
 602 |         ("\u0335", "\\Elzxl "),
 603 |         ("\u0336", "\\Elzbar "),
 604 |         ("\u0337", "{\\fontencoding{LECO}\\selectfont\\char215}"),
 605 |         ("\u0338", "{\\fontencoding{LECO}\\selectfont\\char216}"),
 606 |         ("\u033A", "{\\fontencoding{LECO}\\selectfont\\char218}"),
 607 |         ("\u033B", "{\\fontencoding{LECO}\\selectfont\\char219}"),
 608 |         ("\u033C", "{\\fontencoding{LECO}\\selectfont\\char220}"),
 609 |         ("\u033D", "{\\fontencoding{LECO}\\selectfont\\char221}"),
 610 |         ("\u0361", "{\\fontencoding{LECO}\\selectfont\\char225}"),
 611 |         ("\u0386", "{\\' A}"),
 612 |         ("\u0388", "{\\' E}"),
 613 |         ("\u0389", "{\\' H}"),
 614 |         ("\u038A", "\\'{}{I}"),
 615 |         ("\u038C", "\\'{}O"),
 616 |         ("\u038E", "\\mathrm{'Y}"),
 617 |         ("\u038F", "\\mathrm{'\\Omega}"),
 618 |         ("\u0390", "\\acute{\\ddot{\\iota}}"),
 619 |         ("\u0391", "\\Alpha "),
 620 |         ("\u0392", "\\Beta "),
 621 |         ("\u0393", "\\Gamma "),
 622 |         ("\u0394", "\\Delta "),
 623 |         ("\u0395", "\\Epsilon "),
 624 |         ("\u0396", "\\Zeta "),
 625 |         ("\u0397", "\\Eta "),
 626 |         ("\u0398", "\\Theta "),
 627 |         ("\u0399", "\\Iota "),
 628 |         ("\u039A", "\\Kappa "),
 629 |         ("\u039B", "\\Lambda "),
 630 |         ("\u039E", "\\Xi "),
 631 |         ("\u03A0", "\\Pi "),
 632 |         ("\u03A1", "\\Rho "),
 633 |         ("\u03A3", "\\Sigma "),
 634 |         ("\u03A4", "\\Tau "),
 635 |         ("\u03A5", "\\Upsilon "),
 636 |         ("\u03A6", "\\Phi "),
 637 |         ("\u03A7", "\\Chi "),
 638 |         ("\u03A8", "\\Psi "),
 639 |         ("\u03A9", "\\Omega "),
 640 |         ("\u03AA", "\\mathrm{\\ddot{I}}"),
 641 |         ("\u03AB", "\\mathrm{\\ddot{Y}}"),
 642 |         ("\u03AC", "\\'{$\\alpha$}"),
 643 |         ("\u03AD", "\\acute{\\epsilon}"),
 644 |         ("\u03AE", "\\acute{\\eta}"),
 645 |         ("\u03AF", "\\acute{\\iota}"),
 646 |         ("\u03B0", "\\acute{\\ddot{\\upsilon}}"),
 647 |         ("\u03B1", "\\alpha "),
 648 |         ("\u03B2", "\\beta "),
 649 |         ("\u03B3", "\\gamma "),
 650 |         ("\u03B4", "\\delta "),
 651 |         ("\u03B5", "\\epsilon "),
 652 |         ("\u03B6", "\\zeta "),
 653 |         ("\u03B7", "\\eta "),
 654 |         ("\u03B8", "\\texttheta "),
 655 |         ("\u03B9", "\\iota "),
 656 |         ("\u03BA", "\\kappa "),
 657 |         ("\u03BB", "\\lambda "),
 658 |         ("\u03BC", "\\mu "),
 659 |         ("\u03BD", "\\nu "),
 660 |         ("\u03BE", "\\xi "),
 661 |         ("\u03C0", "\\pi "),
 662 |         ("\u03C1", "\\rho "),
 663 |         ("\u03C2", "\\varsigma "),
 664 |         ("\u03C3", "\\sigma "),
 665 |         ("\u03C4", "\\tau "),
 666 |         ("\u03C5", "\\upsilon "),
 667 |         ("\u03C6", "\\varphi "),
 668 |         ("\u03C7", "\\chi "),
 669 |         ("\u03C8", "\\psi "),
 670 |         ("\u03C9", "\\omega "),
 671 |         ("\u03CA", "\\ddot{\\iota}"),
 672 |         ("\u03CB", "\\ddot{\\upsilon}"),
 673 |         ("\u03CC", "{\\' o}"),
 674 |         ("\u03CD", "\\acute{\\upsilon}"),
 675 |         ("\u03CE", "\\acute{\\omega}"),
 676 |         ("\u03D0", "\\Pisymbol{ppi022}{87}"),
 677 |         ("\u03D1", "\\textvartheta "),
 678 |         ("\u03D2", "\\Upsilon "),
 679 |         ("\u03D5", "\\phi "),
 680 |         ("\u03D6", "\\varpi "),
 681 |         ("\u03DA", "\\Stigma "),
 682 |         ("\u03DC", "\\Digamma "),
 683 |         ("\u03DD", "\\digamma "),
 684 |         ("\u03DE", "\\Koppa "),
 685 |         ("\u03E0", "\\Sampi "),
 686 |         ("\u03F0", "\\varkappa "),
 687 |         ("\u03F1", "\\varrho "),
 688 |         ("\u03F4", "\\textTheta "),
 689 |         ("\u03F6", "\\backepsilon "),
 690 |         ("\u0401", "\\cyrchar\\CYRYO "),
 691 |         ("\u0402", "\\cyrchar\\CYRDJE "),
 692 |         ("\u0403", "\\cyrchar{\\'\\CYRG}"),
 693 |         ("\u0404", "\\cyrchar\\CYRIE "),
 694 |         ("\u0405", "\\cyrchar\\CYRDZE "),
 695 |         ("\u0406", "\\cyrchar\\CYRII "),
 696 |         ("\u0407", "\\cyrchar\\CYRYI "),
 697 |         ("\u0408", "\\cyrchar\\CYRJE "),
 698 |         ("\u0409", "\\cyrchar\\CYRLJE "),
 699 |         ("\u040A", "\\cyrchar\\CYRNJE "),
 700 |         ("\u040B", "\\cyrchar\\CYRTSHE "),
 701 |         ("\u040C", "\\cyrchar{\\'\\CYRK}"),
 702 |         ("\u040E", "\\cyrchar\\CYRUSHRT "),
 703 |         ("\u040F", "\\cyrchar\\CYRDZHE "),
 704 |         ("\u0410", "\\cyrchar\\CYRA "),
 705 |         ("\u0411", "\\cyrchar\\CYRB "),
 706 |         ("\u0412", "\\cyrchar\\CYRV "),
 707 |         ("\u0413", "\\cyrchar\\CYRG "),
 708 |         ("\u0414", "\\cyrchar\\CYRD "),
 709 |         ("\u0415", "\\cyrchar\\CYRE "),
 710 |         ("\u0416", "\\cyrchar\\CYRZH "),
 711 |         ("\u0417", "\\cyrchar\\CYRZ "),
 712 |         ("\u0418", "\\cyrchar\\CYRI "),
 713 |         ("\u0419", "\\cyrchar\\CYRISHRT "),
 714 |         ("\u041A", "\\cyrchar\\CYRK "),
 715 |         ("\u041B", "\\cyrchar\\CYRL "),
 716 |         ("\u041C", "\\cyrchar\\CYRM "),
 717 |         ("\u041D", "\\cyrchar\\CYRN "),
 718 |         ("\u041E", "\\cyrchar\\CYRO "),
 719 |         ("\u041F", "\\cyrchar\\CYRP "),
 720 |         ("\u0420", "\\cyrchar\\CYRR "),
 721 |         ("\u0421", "\\cyrchar\\CYRS "),
 722 |         ("\u0422", "\\cyrchar\\CYRT "),
 723 |         ("\u0423", "\\cyrchar\\CYRU "),
 724 |         ("\u0424", "\\cyrchar\\CYRF "),
 725 |         ("\u0425", "\\cyrchar\\CYRH "),
 726 |         ("\u0426", "\\cyrchar\\CYRC "),
 727 |         ("\u0427", "\\cyrchar\\CYRCH "),
 728 |         ("\u0428", "\\cyrchar\\CYRSH "),
 729 |         ("\u0429", "\\cyrchar\\CYRSHCH "),
 730 |         ("\u042A", "\\cyrchar\\CYRHRDSN "),
 731 |         ("\u042B", "\\cyrchar\\CYRERY "),
 732 |         ("\u042C", "\\cyrchar\\CYRSFTSN "),
 733 |         ("\u042D", "\\cyrchar\\CYREREV "),
 734 |         ("\u042E", "\\cyrchar\\CYRYU "),
 735 |         ("\u042F", "\\cyrchar\\CYRYA "),
 736 |         ("\u0430", "\\cyrchar\\cyra "),
 737 |         ("\u0431", "\\cyrchar\\cyrb "),
 738 |         ("\u0432", "\\cyrchar\\cyrv "),
 739 |         ("\u0433", "\\cyrchar\\cyrg "),
 740 |         ("\u0434", "\\cyrchar\\cyrd "),
 741 |         ("\u0435", "\\cyrchar\\cyre "),
 742 |         ("\u0436", "\\cyrchar\\cyrzh "),
 743 |         ("\u0437", "\\cyrchar\\cyrz "),
 744 |         ("\u0438", "\\cyrchar\\cyri "),
 745 |         ("\u0439", "\\cyrchar\\cyrishrt "),
 746 |         ("\u043A", "\\cyrchar\\cyrk "),
 747 |         ("\u043B", "\\cyrchar\\cyrl "),
 748 |         ("\u043C", "\\cyrchar\\cyrm "),
 749 |         ("\u043D", "\\cyrchar\\cyrn "),
 750 |         ("\u043E", "\\cyrchar\\cyro "),
 751 |         ("\u043F", "\\cyrchar\\cyrp "),
 752 |         ("\u0440", "\\cyrchar\\cyrr "),
 753 |         ("\u0441", "\\cyrchar\\cyrs "),
 754 |         ("\u0442", "\\cyrchar\\cyrt "),
 755 |         ("\u0443", "\\cyrchar\\cyru "),
 756 |         ("\u0444", "\\cyrchar\\cyrf "),
 757 |         ("\u0445", "\\cyrchar\\cyrh "),
 758 |         ("\u0446", "\\cyrchar\\cyrc "),
 759 |         ("\u0447", "\\cyrchar\\cyrch "),
 760 |         ("\u0448", "\\cyrchar\\cyrsh "),
 761 |         ("\u0449", "\\cyrchar\\cyrshch "),
 762 |         ("\u044A", "\\cyrchar\\cyrhrdsn "),
 763 |         ("\u044B", "\\cyrchar\\cyrery "),
 764 |         ("\u044C", "\\cyrchar\\cyrsftsn "),
 765 |         ("\u044D", "\\cyrchar\\cyrerev "),
 766 |         ("\u044E", "\\cyrchar\\cyryu "),
 767 |         ("\u044F", "\\cyrchar\\cyrya "),
 768 |         ("\u0451", "\\cyrchar\\cyryo "),
 769 |         ("\u0452", "\\cyrchar\\cyrdje "),
 770 |         ("\u0453", "\\cyrchar{\\'\\cyrg}"),
 771 |         ("\u0454", "\\cyrchar\\cyrie "),
 772 |         ("\u0455", "\\cyrchar\\cyrdze "),
 773 |         ("\u0456", "\\cyrchar\\cyrii "),
 774 |         ("\u0457", "\\cyrchar\\cyryi "),
 775 |         ("\u0458", "\\cyrchar\\cyrje "),
 776 |         ("\u0459", "\\cyrchar\\cyrlje "),
 777 |         ("\u045A", "\\cyrchar\\cyrnje "),
 778 |         ("\u045B", "\\cyrchar\\cyrtshe "),
 779 |         ("\u045C", "\\cyrchar{\\'\\cyrk}"),
 780 |         ("\u045E", "\\cyrchar\\cyrushrt "),
 781 |         ("\u045F", "\\cyrchar\\cyrdzhe "),
 782 |         ("\u0460", "\\cyrchar\\CYROMEGA "),
 783 |         ("\u0461", "\\cyrchar\\cyromega "),
 784 |         ("\u0462", "\\cyrchar\\CYRYAT "),
 785 |         ("\u0464", "\\cyrchar\\CYRIOTE "),
 786 |         ("\u0465", "\\cyrchar\\cyriote "),
 787 |         ("\u0466", "\\cyrchar\\CYRLYUS "),
 788 |         ("\u0467", "\\cyrchar\\cyrlyus "),
 789 |         ("\u0468", "\\cyrchar\\CYRIOTLYUS "),
 790 |         ("\u0469", "\\cyrchar\\cyriotlyus "),
 791 |         ("\u046A", "\\cyrchar\\CYRBYUS "),
 792 |         ("\u046C", "\\cyrchar\\CYRIOTBYUS "),
 793 |         ("\u046D", "\\cyrchar\\cyriotbyus "),
 794 |         ("\u046E", "\\cyrchar\\CYRKSI "),
 795 |         ("\u046F", "\\cyrchar\\cyrksi "),
 796 |         ("\u0470", "\\cyrchar\\CYRPSI "),
 797 |         ("\u0471", "\\cyrchar\\cyrpsi "),
 798 |         ("\u0472", "\\cyrchar\\CYRFITA "),
 799 |         ("\u0474", "\\cyrchar\\CYRIZH "),
 800 |         ("\u0478", "\\cyrchar\\CYRUK "),
 801 |         ("\u0479", "\\cyrchar\\cyruk "),
 802 |         ("\u047A", "\\cyrchar\\CYROMEGARND "),
 803 |         ("\u047B", "\\cyrchar\\cyromegarnd "),
 804 |         ("\u047C", "\\cyrchar\\CYROMEGATITLO "),
 805 |         ("\u047D", "\\cyrchar\\cyromegatitlo "),
 806 |         ("\u047E", "\\cyrchar\\CYROT "),
 807 |         ("\u047F", "\\cyrchar\\cyrot "),
 808 |         ("\u0480", "\\cyrchar\\CYRKOPPA "),
 809 |         ("\u0481", "\\cyrchar\\cyrkoppa "),
 810 |         ("\u0482", "\\cyrchar\\cyrthousands "),
 811 |         ("\u0488", "\\cyrchar\\cyrhundredthousands "),
 812 |         ("\u0489", "\\cyrchar\\cyrmillions "),
 813 |         ("\u048C", "\\cyrchar\\CYRSEMISFTSN "),
 814 |         ("\u048D", "\\cyrchar\\cyrsemisftsn "),
 815 |         ("\u048E", "\\cyrchar\\CYRRTICK "),
 816 |         ("\u048F", "\\cyrchar\\cyrrtick "),
 817 |         ("\u0490", "\\cyrchar\\CYRGUP "),
 818 |         ("\u0491", "\\cyrchar\\cyrgup "),
 819 |         ("\u0492", "\\cyrchar\\CYRGHCRS "),
 820 |         ("\u0493", "\\cyrchar\\cyrghcrs "),
 821 |         ("\u0494", "\\cyrchar\\CYRGHK "),
 822 |         ("\u0495", "\\cyrchar\\cyrghk "),
 823 |         ("\u0496", "\\cyrchar\\CYRZHDSC "),
 824 |         ("\u0497", "\\cyrchar\\cyrzhdsc "),
 825 |         ("\u0498", "\\cyrchar\\CYRZDSC "),
 826 |         ("\u0499", "\\cyrchar\\cyrzdsc "),
 827 |         ("\u049A", "\\cyrchar\\CYRKDSC "),
 828 |         ("\u049B", "\\cyrchar\\cyrkdsc "),
 829 |         ("\u049C", "\\cyrchar\\CYRKVCRS "),
 830 |         ("\u049D", "\\cyrchar\\cyrkvcrs "),
 831 |         ("\u049E", "\\cyrchar\\CYRKHCRS "),
 832 |         ("\u049F", "\\cyrchar\\cyrkhcrs "),
 833 |         ("\u04A0", "\\cyrchar\\CYRKBEAK "),
 834 |         ("\u04A1", "\\cyrchar\\cyrkbeak "),
 835 |         ("\u04A2", "\\cyrchar\\CYRNDSC "),
 836 |         ("\u04A3", "\\cyrchar\\cyrndsc "),
 837 |         ("\u04A4", "\\cyrchar\\CYRNG "),
 838 |         ("\u04A5", "\\cyrchar\\cyrng "),
 839 |         ("\u04A6", "\\cyrchar\\CYRPHK "),
 840 |         ("\u04A7", "\\cyrchar\\cyrphk "),
 841 |         ("\u04A8", "\\cyrchar\\CYRABHHA "),
 842 |         ("\u04A9", "\\cyrchar\\cyrabhha "),
 843 |         ("\u04AA", "\\cyrchar\\CYRSDSC "),
 844 |         ("\u04AB", "\\cyrchar\\cyrsdsc "),
 845 |         ("\u04AC", "\\cyrchar\\CYRTDSC "),
 846 |         ("\u04AD", "\\cyrchar\\cyrtdsc "),
 847 |         ("\u04AE", "\\cyrchar\\CYRY "),
 848 |         ("\u04AF", "\\cyrchar\\cyry "),
 849 |         ("\u04B0", "\\cyrchar\\CYRYHCRS "),
 850 |         ("\u04B1", "\\cyrchar\\cyryhcrs "),
 851 |         ("\u04B2", "\\cyrchar\\CYRHDSC "),
 852 |         ("\u04B3", "\\cyrchar\\cyrhdsc "),
 853 |         ("\u04B4", "\\cyrchar\\CYRTETSE "),
 854 |         ("\u04B5", "\\cyrchar\\cyrtetse "),
 855 |         ("\u04B6", "\\cyrchar\\CYRCHRDSC "),
 856 |         ("\u04B7", "\\cyrchar\\cyrchrdsc "),
 857 |         ("\u04B8", "\\cyrchar\\CYRCHVCRS "),
 858 |         ("\u04B9", "\\cyrchar\\cyrchvcrs "),
 859 |         ("\u04BA", "\\cyrchar\\CYRSHHA "),
 860 |         ("\u04BB", "\\cyrchar\\cyrshha "),
 861 |         ("\u04BC", "\\cyrchar\\CYRABHCH "),
 862 |         ("\u04BD", "\\cyrchar\\cyrabhch "),
 863 |         ("\u04BE", "\\cyrchar\\CYRABHCHDSC "),
 864 |         ("\u04BF", "\\cyrchar\\cyrabhchdsc "),
 865 |         ("\u04C0", "\\cyrchar\\CYRpalochka "),
 866 |         ("\u04C3", "\\cyrchar\\CYRKHK "),
 867 |         ("\u04C4", "\\cyrchar\\cyrkhk "),
 868 |         ("\u04C7", "\\cyrchar\\CYRNHK "),
 869 |         ("\u04C8", "\\cyrchar\\cyrnhk "),
 870 |         ("\u04CB", "\\cyrchar\\CYRCHLDSC "),
 871 |         ("\u04CC", "\\cyrchar\\cyrchldsc "),
 872 |         ("\u04D4", "\\cyrchar\\CYRAE "),
 873 |         ("\u04D5", "\\cyrchar\\cyrae "),
 874 |         ("\u04D8", "\\cyrchar\\CYRSCHWA "),
 875 |         ("\u04D9", "\\cyrchar\\cyrschwa "),
 876 |         ("\u04E0", "\\cyrchar\\CYRABHDZE "),
 877 |         ("\u04E1", "\\cyrchar\\cyrabhdze "),
 878 |         ("\u04E8", "\\cyrchar\\CYROTLD "),
 879 |         ("\u04E9", "\\cyrchar\\cyrotld "),
 880 |         ("\u2002", "\\hspace{0.6em}"),
 881 |         ("\u2003", "\\hspace{1em}"),
 882 |         ("\u2004", "\\hspace{0.33em}"),
 883 |         ("\u2005", "\\hspace{0.25em}"),
 884 |         ("\u2006", "\\hspace{0.166em}"),
 885 |         ("\u2007", "\\hphantom{0}"),
 886 |         ("\u2008", "\\hphantom{,}"),
 887 |         ("\u2009", "\\hspace{0.167em}"),
 888 |         ("\u2009-0200A-0200A", "\\;"),
 889 |         ("\u200A", "\\mkern1mu "),
 890 |         ("\u2013", "\\textendash "),
 891 |         ("\u2014", "\\textemdash "),
 892 |         ("\u2015", "\\rule{1em}{1pt}"),
 893 |         ("\u2016", "\\Vert "),
 894 |         ("\u201B", "\\Elzreapos "),
 895 |         ("\u201C", "\\textquotedblleft "),
 896 |         ("\u201D", "\\textquotedblright "),
 897 |         ("\u201E", ",,"),
 898 |         ("\u2020", "\\textdagger "),
 899 |         ("\u2021", "\\textdaggerdbl "),
 900 |         ("\u2022", "\\textbullet "),
 901 | #        (u"\u2025", ".."),
 902 |         ("\u2026", "\\ldots "),
 903 |         ("\u2030", "\\textperthousand "),
 904 |         ("\u2031", "\\textpertenthousand "),
 905 |         ("\u2032", "{'}"),
 906 |         ("\u2033", "{''}"),
 907 |         ("\u2034", "{'''}"),
 908 |         ("\u2035", "\\backprime "),
 909 |         ("\u2039", "\\guilsinglleft "),
 910 |         ("\u203A", "\\guilsinglright "),
 911 |         ("\u2057", "''''"),
 912 |         ("\u205F", "\\mkern4mu "),
 913 |         ("\u2060", "\\nolinebreak "),
 914 |         ("\u20A7", "\\ensuremath{\\Elzpes}"),
 915 |         ("\u20AC", "\\mbox{\\texteuro} "),
 916 |         ("\u20DB", "\\dddot "),
 917 |         ("\u20DC", "\\ddddot "),
 918 |         ("\u2102", "\\mathbb{C}"),
 919 |         ("\u210A", "\\mathscr{g}"),
 920 |         ("\u210B", "\\mathscr{H}"),
 921 |         ("\u210C", "\\mathfrak{H}"),
 922 |         ("\u210D", "\\mathbb{H}"),
 923 |         ("\u210F", "\\hslash "),
 924 |         ("\u2110", "\\mathscr{I}"),
 925 |         ("\u2111", "\\mathfrak{I}"),
 926 |         ("\u2112", "\\mathscr{L}"),
 927 |         ("\u2113", "\\mathscr{l}"),
 928 |         ("\u2115", "\\mathbb{N}"),
 929 |         ("\u2116", "\\cyrchar\\textnumero "),
 930 |         ("\u2118", "\\wp "),
 931 |         ("\u2119", "\\mathbb{P}"),
 932 |         ("\u211A", "\\mathbb{Q}"),
 933 |         ("\u211B", "\\mathscr{R}"),
 934 |         ("\u211C", "\\mathfrak{R}"),
 935 |         ("\u211D", "\\mathbb{R}"),
 936 |         ("\u211E", "\\Elzxrat "),
 937 |         ("\u2122", "\\texttrademark "),
 938 |         ("\u2124", "\\mathbb{Z}"),
 939 |         ("\u2126", "\\Omega "),
 940 |         ("\u2127", "\\mho "),
 941 |         ("\u2128", "\\mathfrak{Z}"),
 942 |         ("\u2129", "\\ElsevierGlyph{2129}"),
 943 |         ("\u212B", "\\AA "),
 944 |         ("\u212C", "\\mathscr{B}"),
 945 |         ("\u212D", "\\mathfrak{C}"),
 946 |         ("\u212F", "\\mathscr{e}"),
 947 |         ("\u2130", "\\mathscr{E}"),
 948 |         ("\u2131", "\\mathscr{F}"),
 949 |         ("\u2133", "\\mathscr{M}"),
 950 |         ("\u2134", "\\mathscr{o}"),
 951 |         ("\u2135", "\\aleph "),
 952 |         ("\u2136", "\\beth "),
 953 |         ("\u2137", "\\gimel "),
 954 |         ("\u2138", "\\daleth "),
 955 |         ("\u2153", "\\textfrac{1}{3}"),
 956 |         ("\u2154", "\\textfrac{2}{3}"),
 957 |         ("\u2155", "\\textfrac{1}{5}"),
 958 |         ("\u2156", "\\textfrac{2}{5}"),
 959 |         ("\u2157", "\\textfrac{3}{5}"),
 960 |         ("\u2158", "\\textfrac{4}{5}"),
 961 |         ("\u2159", "\\textfrac{1}{6}"),
 962 |         ("\u215A", "\\textfrac{5}{6}"),
 963 |         ("\u215B", "\\textfrac{1}{8}"),
 964 |         ("\u215C", "\\textfrac{3}{8}"),
 965 |         ("\u215D", "\\textfrac{5}{8}"),
 966 |         ("\u215E", "\\textfrac{7}{8}"),
 967 |         ("\u2190", "\\leftarrow "),
 968 |         ("\u2191", "\\uparrow "),
 969 |         ("\u2192", "\\rightarrow "),
 970 |         ("\u2193", "\\downarrow "),
 971 |         ("\u2194", "\\leftrightarrow "),
 972 |         ("\u2195", "\\updownarrow "),
 973 |         ("\u2196", "\\nwarrow "),
 974 |         ("\u2197", "\\nearrow "),
 975 |         ("\u2198", "\\searrow "),
 976 |         ("\u2199", "\\swarrow "),
 977 |         ("\u219A", "\\nleftarrow "),
 978 |         ("\u219B", "\\nrightarrow "),
 979 |         ("\u219C", "\\arrowwaveright "),
 980 |         ("\u219D", "\\arrowwaveright "),
 981 |         ("\u219E", "\\twoheadleftarrow "),
 982 |         ("\u21A0", "\\twoheadrightarrow "),
 983 |         ("\u21A2", "\\leftarrowtail "),
 984 |         ("\u21A3", "\\rightarrowtail "),
 985 |         ("\u21A6", "\\mapsto "),
 986 |         ("\u21A9", "\\hookleftarrow "),
 987 |         ("\u21AA", "\\hookrightarrow "),
 988 |         ("\u21AB", "\\looparrowleft "),
 989 |         ("\u21AC", "\\looparrowright "),
 990 |         ("\u21AD", "\\leftrightsquigarrow "),
 991 |         ("\u21AE", "\\nleftrightarrow "),
 992 |         ("\u21B0", "\\Lsh "),
 993 |         ("\u21B1", "\\Rsh "),
 994 |         ("\u21B3", "\\ElsevierGlyph{21B3}"),
 995 |         ("\u21B6", "\\curvearrowleft "),
 996 |         ("\u21B7", "\\curvearrowright "),
 997 |         ("\u21BA", "\\circlearrowleft "),
 998 |         ("\u21BB", "\\circlearrowright "),
 999 |         ("\u21BC", "\\leftharpoonup "),
1000 |         ("\u21BD", "\\leftharpoondown "),
1001 |         ("\u21BE", "\\upharpoonright "),
1002 |         ("\u21BF", "\\upharpoonleft "),
1003 |         ("\u21C0", "\\rightharpoonup "),
1004 |         ("\u21C1", "\\rightharpoondown "),
1005 |         ("\u21C2", "\\downharpoonright "),
1006 |         ("\u21C3", "\\downharpoonleft "),
1007 |         ("\u21C4", "\\rightleftarrows "),
1008 |         ("\u21C5", "\\dblarrowupdown "),
1009 |         ("\u21C6", "\\leftrightarrows "),
1010 |         ("\u21C7", "\\leftleftarrows "),
1011 |         ("\u21C8", "\\upuparrows "),
1012 |         ("\u21C9", "\\rightrightarrows "),
1013 |         ("\u21CA", "\\downdownarrows "),
1014 |         ("\u21CB", "\\leftrightharpoons "),
1015 |         ("\u21CC", "\\rightleftharpoons "),
1016 |         ("\u21CD", "\\nLeftarrow "),
1017 |         ("\u21CE", "\\nLeftrightarrow "),
1018 |         ("\u21CF", "\\nRightarrow "),
1019 |         ("\u21D0", "\\Leftarrow "),
1020 |         ("\u21D1", "\\Uparrow "),
1021 |         ("\u21D2", "\\Rightarrow "),
1022 |         ("\u21D3", "\\Downarrow "),
1023 |         ("\u21D4", "\\Leftrightarrow "),
1024 |         ("\u21D5", "\\Updownarrow "),
1025 |         ("\u21DA", "\\Lleftarrow "),
1026 |         ("\u21DB", "\\Rrightarrow "),
1027 |         ("\u21DD", "\\rightsquigarrow "),
1028 |         ("\u21F5", "\\DownArrowUpArrow "),
1029 |         ("\u2200", "\\forall "),
1030 |         ("\u2201", "\\complement "),
1031 |         ("\u2202", "\\partial "),
1032 |         ("\u2203", "\\exists "),
1033 |         ("\u2204", "\\nexists "),
1034 |         ("\u2205", "\\varnothing "),
1035 |         ("\u2207", "\\nabla "),
1036 |         ("\u2208", "\\in "),
1037 |         ("\u2209", "\\not\\in "),
1038 |         ("\u220B", "\\ni "),
1039 |         ("\u220C", "\\not\\ni "),
1040 |         ("\u220F", "\\prod "),
1041 |         ("\u2210", "\\coprod "),
1042 |         ("\u2211", "\\sum "),
1043 |         ("\u2213", "\\mp "),
1044 |         ("\u2214", "\\dotplus "),
1045 |         ("\u2216", "\\setminus "),
1046 |         ("\u2217", "{_\\ast}"),
1047 |         ("\u2218", "\\circ "),
1048 |         ("\u2219", "\\bullet "),
1049 |         ("\u221A", "\\surd "),
1050 |         ("\u221D", "\\propto "),
1051 |         ("\u221E", "\\infty "),
1052 |         ("\u221F", "\\rightangle "),
1053 |         ("\u2220", "\\angle "),
1054 |         ("\u2221", "\\measuredangle "),
1055 |         ("\u2222", "\\sphericalangle "),
1056 |         ("\u2223", "\\mid "),
1057 |         ("\u2224", "\\nmid "),
1058 |         ("\u2225", "\\parallel "),
1059 |         ("\u2226", "\\nparallel "),
1060 |         ("\u2227", "\\wedge "),
1061 |         ("\u2228", "\\vee "),
1062 |         ("\u2229", "\\cap "),
1063 |         ("\u222A", "\\cup "),
1064 |         ("\u222B", "\\int "),
1065 |         ("\u222C", "\\int\\!\\int "),
1066 |         ("\u222D", "\\int\\!\\int\\!\\int "),
1067 |         ("\u222E", "\\oint "),
1068 |         ("\u222F", "\\surfintegral "),
1069 |         ("\u2230", "\\volintegral "),
1070 |         ("\u2231", "\\clwintegral "),
1071 |         ("\u2232", "\\ElsevierGlyph{2232}"),
1072 |         ("\u2233", "\\ElsevierGlyph{2233}"),
1073 |         ("\u2234", "\\therefore "),
1074 |         ("\u2235", "\\because "),
1075 |         ("\u2237", "\\Colon "),
1076 |         ("\u2238", "\\ElsevierGlyph{2238}"),
1077 |         ("\u223A", "\\mathbin{{:}\\!\\!{-}\\!\\!{:}}"),
1078 |         ("\u223B", "\\homothetic "),
1079 |         ("\u223C", "\\sim "),
1080 |         ("\u223D", "\\backsim "),
1081 |         ("\u223E", "\\lazysinv "),
1082 |         ("\u2240", "\\wr "),
1083 |         ("\u2241", "\\not\\sim "),
1084 |         ("\u2242", "\\ElsevierGlyph{2242}"),
1085 |         ("\u2242-00338", "\\NotEqualTilde "),
1086 |         ("\u2243", "\\simeq "),
1087 |         ("\u2244", "\\not\\simeq "),
1088 |         ("\u2245", "\\cong "),
1089 |         ("\u2246", "\\approxnotequal "),
1090 |         ("\u2247", "\\not\\cong "),
1091 |         ("\u2248", "\\approx "),
1092 |         ("\u2249", "\\not\\approx "),
1093 |         ("\u224A", "\\approxeq "),
1094 |         ("\u224B", "\\tildetrpl "),
1095 |         ("\u224B-00338", "\\not\\apid "),
1096 |         ("\u224C", "\\allequal "),
1097 |         ("\u224D", "\\asymp "),
1098 |         ("\u224E", "\\Bumpeq "),
1099 |         ("\u224E-00338", "\\NotHumpDownHump "),
1100 |         ("\u224F", "\\bumpeq "),
1101 |         ("\u224F-00338", "\\NotHumpEqual "),
1102 |         ("\u2250", "\\doteq "),
1103 |         ("\u2250-00338", "\\not\\doteq"),
1104 |         ("\u2251", "\\doteqdot "),
1105 |         ("\u2252", "\\fallingdotseq "),
1106 |         ("\u2253", "\\risingdotseq "),
1107 |         ("\u2254", ":="),
1108 |         ("\u2255", "=:"),
1109 |         ("\u2256", "\\eqcirc "),
1110 |         ("\u2257", "\\circeq "),
1111 |         ("\u2259", "\\estimates "),
1112 |         ("\u225A", "\\ElsevierGlyph{225A}"),
1113 |         ("\u225B", "\\starequal "),
1114 |         ("\u225C", "\\triangleq "),
1115 |         ("\u225F", "\\ElsevierGlyph{225F}"),
1116 |         ("\u2260", "\\not ="),
1117 |         ("\u2261", "\\equiv "),
1118 |         ("\u2262", "\\not\\equiv "),
1119 |         ("\u2264", "\\leq "),
1120 |         ("\u2265", "\\geq "),
1121 |         ("\u2266", "\\leqq "),
1122 |         ("\u2267", "\\geqq "),
1123 |         ("\u2268", "\\lneqq "),
1124 |         ("\u2268-0FE00", "\\lvertneqq "),
1125 |         ("\u2269", "\\gneqq "),
1126 |         ("\u2269-0FE00", "\\gvertneqq "),
1127 |         ("\u226A", "\\ll "),
1128 |         ("\u226A-00338", "\\NotLessLess "),
1129 |         ("\u226B", "\\gg "),
1130 |         ("\u226B-00338", "\\NotGreaterGreater "),
1131 |         ("\u226C", "\\between "),
1132 |         ("\u226D", "\\not\\kern-0.3em\\times "),
1133 |         ("\u226E", "\\not<"),
1134 |         ("\u226F", "\\not>"),
1135 |         ("\u2270", "\\not\\leq "),
1136 |         ("\u2271", "\\not\\geq "),
1137 |         ("\u2272", "\\lessequivlnt "),
1138 |         ("\u2273", "\\greaterequivlnt "),
1139 |         ("\u2274", "\\ElsevierGlyph{2274}"),
1140 |         ("\u2275", "\\ElsevierGlyph{2275}"),
1141 |         ("\u2276", "\\lessgtr "),
1142 |         ("\u2277", "\\gtrless "),
1143 |         ("\u2278", "\\notlessgreater "),
1144 |         ("\u2279", "\\notgreaterless "),
1145 |         ("\u227A", "\\prec "),
1146 |         ("\u227B", "\\succ "),
1147 |         ("\u227C", "\\preccurlyeq "),
1148 |         ("\u227D", "\\succcurlyeq "),
1149 |         ("\u227E", "\\precapprox "),
1150 |         ("\u227E-00338", "\\NotPrecedesTilde "),
1151 |         ("\u227F", "\\succapprox "),
1152 |         ("\u227F-00338", "\\NotSucceedsTilde "),
1153 |         ("\u2280", "\\not\\prec "),
1154 |         ("\u2281", "\\not\\succ "),
1155 |         ("\u2282", "\\subset "),
1156 |         ("\u2283", "\\supset "),
1157 |         ("\u2284", "\\not\\subset "),
1158 |         ("\u2285", "\\not\\supset "),
1159 |         ("\u2286", "\\subseteq "),
1160 |         ("\u2287", "\\supseteq "),
1161 |         ("\u2288", "\\not\\subseteq "),
1162 |         ("\u2289", "\\not\\supseteq "),
1163 |         ("\u228A", "\\subsetneq "),
1164 |         ("\u228A-0FE00", "\\varsubsetneqq "),
1165 |         ("\u228B", "\\supsetneq "),
1166 |         ("\u228B-0FE00", "\\varsupsetneq "),
1167 |         ("\u228E", "\\uplus "),
1168 |         ("\u228F", "\\sqsubset "),
1169 |         ("\u228F-00338", "\\NotSquareSubset "),
1170 |         ("\u2290", "\\sqsupset "),
1171 |         ("\u2290-00338", "\\NotSquareSuperset "),
1172 |         ("\u2291", "\\sqsubseteq "),
1173 |         ("\u2292", "\\sqsupseteq "),
1174 |         ("\u2293", "\\sqcap "),
1175 |         ("\u2294", "\\sqcup "),
1176 |         ("\u2295", "\\oplus "),
1177 |         ("\u2296", "\\ominus "),
1178 |         ("\u2297", "\\otimes "),
1179 |         ("\u2298", "\\oslash "),
1180 |         ("\u2299", "\\odot "),
1181 |         ("\u229A", "\\circledcirc "),
1182 |         ("\u229B", "\\circledast "),
1183 |         ("\u229D", "\\circleddash "),
1184 |         ("\u229E", "\\boxplus "),
1185 |         ("\u229F", "\\boxminus "),
1186 |         ("\u22A0", "\\boxtimes "),
1187 |         ("\u22A1", "\\boxdot "),
1188 |         ("\u22A2", "\\vdash "),
1189 |         ("\u22A3", "\\dashv "),
1190 |         ("\u22A4", "\\top "),
1191 |         ("\u22A5", "\\perp "),
1192 |         ("\u22A7", "\\truestate "),
1193 |         ("\u22A8", "\\forcesextra "),
1194 |         ("\u22A9", "\\Vdash "),
1195 |         ("\u22AA", "\\Vvdash "),
1196 |         ("\u22AB", "\\VDash "),
1197 |         ("\u22AC", "\\nvdash "),
1198 |         ("\u22AD", "\\nvDash "),
1199 |         ("\u22AE", "\\nVdash "),
1200 |         ("\u22AF", "\\nVDash "),
1201 |         ("\u22B2", "\\vartriangleleft "),
1202 |         ("\u22B3", "\\vartriangleright "),
1203 |         ("\u22B4", "\\trianglelefteq "),
1204 |         ("\u22B5", "\\trianglerighteq "),
1205 |         ("\u22B6", "\\original "),
1206 |         ("\u22B7", "\\image "),
1207 |         ("\u22B8", "\\multimap "),
1208 |         ("\u22B9", "\\hermitconjmatrix "),
1209 |         ("\u22BA", "\\intercal "),
1210 |         ("\u22BB", "\\veebar "),
1211 |         ("\u22BE", "\\rightanglearc "),
1212 |         ("\u22C0", "\\ElsevierGlyph{22C0}"),
1213 |         ("\u22C1", "\\ElsevierGlyph{22C1}"),
1214 |         ("\u22C2", "\\bigcap "),
1215 |         ("\u22C3", "\\bigcup "),
1216 |         ("\u22C4", "\\diamond "),
1217 |         ("\u22C5", "\\cdot "),
1218 |         ("\u22C6", "\\star "),
1219 |         ("\u22C7", "\\divideontimes "),
1220 |         ("\u22C8", "\\bowtie "),
1221 |         ("\u22C9", "\\ltimes "),
1222 |         ("\u22CA", "\\rtimes "),
1223 |         ("\u22CB", "\\leftthreetimes "),
1224 |         ("\u22CC", "\\rightthreetimes "),
1225 |         ("\u22CD", "\\backsimeq "),
1226 |         ("\u22CE", "\\curlyvee "),
1227 |         ("\u22CF", "\\curlywedge "),
1228 |         ("\u22D0", "\\Subset "),
1229 |         ("\u22D1", "\\Supset "),
1230 |         ("\u22D2", "\\Cap "),
1231 |         ("\u22D3", "\\Cup "),
1232 |         ("\u22D4", "\\pitchfork "),
1233 |         ("\u22D6", "\\lessdot "),
1234 |         ("\u22D7", "\\gtrdot "),
1235 |         ("\u22D8", "\\verymuchless "),
1236 |         ("\u22D9", "\\verymuchgreater "),
1237 |         ("\u22DA", "\\lesseqgtr "),
1238 |         ("\u22DB", "\\gtreqless "),
1239 |         ("\u22DE", "\\curlyeqprec "),
1240 |         ("\u22DF", "\\curlyeqsucc "),
1241 |         ("\u22E2", "\\not\\sqsubseteq "),
1242 |         ("\u22E3", "\\not\\sqsupseteq "),
1243 |         ("\u22E5", "\\Elzsqspne "),
1244 |         ("\u22E6", "\\lnsim "),
1245 |         ("\u22E7", "\\gnsim "),
1246 |         ("\u22E8", "\\precedesnotsimilar "),
1247 |         ("\u22E9", "\\succnsim "),
1248 |         ("\u22EA", "\\ntriangleleft "),
1249 |         ("\u22EB", "\\ntriangleright "),
1250 |         ("\u22EC", "\\ntrianglelefteq "),
1251 |         ("\u22ED", "\\ntrianglerighteq "),
1252 |         ("\u22EE", "\\vdots "),
1253 |         ("\u22EF", "\\cdots "),
1254 |         ("\u22F0", "\\upslopeellipsis "),
1255 |         ("\u22F1", "\\downslopeellipsis "),
1256 |         ("\u2305", "\\barwedge "),
1257 |         ("\u2306", "\\perspcorrespond "),
1258 |         ("\u2308", "\\lceil "),
1259 |         ("\u2309", "\\rceil "),
1260 |         ("\u230A", "\\lfloor "),
1261 |         ("\u230B", "\\rfloor "),
1262 |         ("\u2315", "\\recorder "),
1263 |         ("\u2316", "\\mathchar\"2208"),
1264 |         ("\u231C", "\\ulcorner "),
1265 |         ("\u231D", "\\urcorner "),
1266 |         ("\u231E", "\\llcorner "),
1267 |         ("\u231F", "\\lrcorner "),
1268 |         ("\u2322", "\\frown "),
1269 |         ("\u2323", "\\smile "),
1270 |         ("\u2329", "\\langle "),
1271 |         ("\u232A", "\\rangle "),
1272 |         ("\u233D", "\\ElsevierGlyph{E838}"),
1273 |         ("\u23A3", "\\Elzdlcorn "),
1274 |         ("\u23B0", "\\lmoustache "),
1275 |         ("\u23B1", "\\rmoustache "),
1276 |         ("\u2423", "\\textvisiblespace "),
1277 |         ("\u2460", "\\ding{172}"),
1278 |         ("\u2461", "\\ding{173}"),
1279 |         ("\u2462", "\\ding{174}"),
1280 |         ("\u2463", "\\ding{175}"),
1281 |         ("\u2464", "\\ding{176}"),
1282 |         ("\u2465", "\\ding{177}"),
1283 |         ("\u2466", "\\ding{178}"),
1284 |         ("\u2467", "\\ding{179}"),
1285 |         ("\u2468", "\\ding{180}"),
1286 |         ("\u2469", "\\ding{181}"),
1287 |         ("\u24C8", "\\circledS "),
1288 |         ("\u2506", "\\Elzdshfnc "),
1289 |         ("\u2519", "\\Elzsqfnw "),
1290 |         ("\u2571", "\\diagup "),
1291 |         ("\u25A0", "\\ding{110}"),
1292 |         ("\u25A1", "\\square "),
1293 |         ("\u25AA", "\\blacksquare "),
1294 |         ("\u25AD", "\\fbox{~~}"),
1295 |         ("\u25AF", "\\Elzvrecto "),
1296 |         ("\u25B1", "\\ElsevierGlyph{E381}"),
1297 |         ("\u25B2", "\\ding{115}"),
1298 |         ("\u25B3", "\\bigtriangleup "),
1299 |         ("\u25B4", "\\blacktriangle "),
1300 |         ("\u25B5", "\\vartriangle "),
1301 |         ("\u25B8", "\\blacktriangleright "),
1302 |         ("\u25B9", "\\triangleright "),
1303 |         ("\u25BC", "\\ding{116}"),
1304 |         ("\u25BD", "\\bigtriangledown "),
1305 |         ("\u25BE", "\\blacktriangledown "),
1306 |         ("\u25BF", "\\triangledown "),
1307 |         ("\u25C2", "\\blacktriangleleft "),
1308 |         ("\u25C3", "\\triangleleft "),
1309 |         ("\u25C6", "\\ding{117}"),
1310 |         ("\u25CA", "\\lozenge "),
1311 |         ("\u25CB", "\\bigcirc "),
1312 |         ("\u25CF", "\\ding{108}"),
1313 |         ("\u25D0", "\\Elzcirfl "),
1314 |         ("\u25D1", "\\Elzcirfr "),
1315 |         ("\u25D2", "\\Elzcirfb "),
1316 |         ("\u25D7", "\\ding{119}"),
1317 |         ("\u25D8", "\\Elzrvbull "),
1318 |         ("\u25E7", "\\Elzsqfl "),
1319 |         ("\u25E8", "\\Elzsqfr "),
1320 |         ("\u25EA", "\\Elzsqfse "),
1321 |         ("\u25EF", "\\bigcirc "),
1322 |         ("\u2605", "\\ding{72}"),
1323 |         ("\u2606", "\\ding{73}"),
1324 |         ("\u260E", "\\ding{37}"),
1325 |         ("\u261B", "\\ding{42}"),
1326 |         ("\u261E", "\\ding{43}"),
1327 |         ("\u263E", "\\rightmoon "),
1328 |         ("\u263F", "\\mercury "),
1329 |         ("\u2640", "\\venus "),
1330 |         ("\u2642", "\\male "),
1331 |         ("\u2643", "\\jupiter "),
1332 |         ("\u2644", "\\saturn "),
1333 |         ("\u2645", "\\uranus "),
1334 |         ("\u2646", "\\neptune "),
1335 |         ("\u2647", "\\pluto "),
1336 |         ("\u2648", "\\aries "),
1337 |         ("\u2649", "\\taurus "),
1338 |         ("\u264A", "\\gemini "),
1339 |         ("\u264B", "\\cancer "),
1340 |         ("\u264C", "\\leo "),
1341 |         ("\u264D", "\\virgo "),
1342 |         ("\u264E", "\\libra "),
1343 |         ("\u264F", "\\scorpio "),
1344 |         ("\u2650", "\\sagittarius "),
1345 |         ("\u2651", "\\capricornus "),
1346 |         ("\u2652", "\\aquarius "),
1347 |         ("\u2653", "\\pisces "),
1348 |         ("\u2660", "\\ding{171}"),
1349 |         ("\u2662", "\\diamond "),
1350 |         ("\u2663", "\\ding{168}"),
1351 |         ("\u2665", "\\ding{170}"),
1352 |         ("\u2666", "\\ding{169}"),
1353 |         ("\u2669", "\\quarternote "),
1354 |         ("\u266A", "\\eighthnote "),
1355 |         ("\u266D", "\\flat "),
1356 |         ("\u266E", "\\natural "),
1357 |         ("\u266F", "\\sharp "),
1358 |         ("\u2701", "\\ding{33}"),
1359 |         ("\u2702", "\\ding{34}"),
1360 |         ("\u2703", "\\ding{35}"),
1361 |         ("\u2704", "\\ding{36}"),
1362 |         ("\u2706", "\\ding{38}"),
1363 |         ("\u2707", "\\ding{39}"),
1364 |         ("\u2708", "\\ding{40}"),
1365 |         ("\u2709", "\\ding{41}"),
1366 |         ("\u270C", "\\ding{44}"),
1367 |         ("\u270D", "\\ding{45}"),
1368 |         ("\u270E", "\\ding{46}"),
1369 |         ("\u270F", "\\ding{47}"),
1370 |         ("\u2710", "\\ding{48}"),
1371 |         ("\u2711", "\\ding{49}"),
1372 |         ("\u2712", "\\ding{50}"),
1373 |         ("\u2713", "\\ding{51}"),
1374 |         ("\u2714", "\\ding{52}"),
1375 |         ("\u2715", "\\ding{53}"),
1376 |         ("\u2716", "\\ding{54}"),
1377 |         ("\u2717", "\\ding{55}"),
1378 |         ("\u2718", "\\ding{56}"),
1379 |         ("\u2719", "\\ding{57}"),
1380 |         ("\u271A", "\\ding{58}"),
1381 |         ("\u271B", "\\ding{59}"),
1382 |         ("\u271C", "\\ding{60}"),
1383 |         ("\u271D", "\\ding{61}"),
1384 |         ("\u271E", "\\ding{62}"),
1385 |         ("\u271F", "\\ding{63}"),
1386 |         ("\u2720", "\\ding{64}"),
1387 |         ("\u2721", "\\ding{65}"),
1388 |         ("\u2722", "\\ding{66}"),
1389 |         ("\u2723", "\\ding{67}"),
1390 |         ("\u2724", "\\ding{68}"),
1391 |         ("\u2725", "\\ding{69}"),
1392 |         ("\u2726", "\\ding{70}"),
1393 |         ("\u2727", "\\ding{71}"),
1394 |         ("\u2729", "\\ding{73}"),
1395 |         ("\u272A", "\\ding{74}"),
1396 |         ("\u272B", "\\ding{75}"),
1397 |         ("\u272C", "\\ding{76}"),
1398 |         ("\u272D", "\\ding{77}"),
1399 |         ("\u272E", "\\ding{78}"),
1400 |         ("\u272F", "\\ding{79}"),
1401 |         ("\u2730", "\\ding{80}"),
1402 |         ("\u2731", "\\ding{81}"),
1403 |         ("\u2732", "\\ding{82}"),
1404 |         ("\u2733", "\\ding{83}"),
1405 |         ("\u2734", "\\ding{84}"),
1406 |         ("\u2735", "\\ding{85}"),
1407 |         ("\u2736", "\\ding{86}"),
1408 |         ("\u2737", "\\ding{87}"),
1409 |         ("\u2738", "\\ding{88}"),
1410 |         ("\u2739", "\\ding{89}"),
1411 |         ("\u273A", "\\ding{90}"),
1412 |         ("\u273B", "\\ding{91}"),
1413 |         ("\u273C", "\\ding{92}"),
1414 |         ("\u273D", "\\ding{93}"),
1415 |         ("\u273E", "\\ding{94}"),
1416 |         ("\u273F", "\\ding{95}"),
1417 |         ("\u2740", "\\ding{96}"),
1418 |         ("\u2741", "\\ding{97}"),
1419 |         ("\u2742", "\\ding{98}"),
1420 |         ("\u2743", "\\ding{99}"),
1421 |         ("\u2744", "\\ding{100}"),
1422 |         ("\u2745", "\\ding{101}"),
1423 |         ("\u2746", "\\ding{102}"),
1424 |         ("\u2747", "\\ding{103}"),
1425 |         ("\u2748", "\\ding{104}"),
1426 |         ("\u2749", "\\ding{105}"),
1427 |         ("\u274A", "\\ding{106}"),
1428 |         ("\u274B", "\\ding{107}"),
1429 |         ("\u274D", "\\ding{109}"),
1430 |         ("\u274F", "\\ding{111}"),
1431 |         ("\u2750", "\\ding{112}"),
1432 |         ("\u2751", "\\ding{113}"),
1433 |         ("\u2752", "\\ding{114}"),
1434 |         ("\u2756", "\\ding{118}"),
1435 |         ("\u2758", "\\ding{120}"),
1436 |         ("\u2759", "\\ding{121}"),
1437 |         ("\u275A", "\\ding{122}"),
1438 |         ("\u275B", "\\ding{123}"),
1439 |         ("\u275C", "\\ding{124}"),
1440 |         ("\u275D", "\\ding{125}"),
1441 |         ("\u275E", "\\ding{126}"),
1442 |         ("\u2761", "\\ding{161}"),
1443 |         ("\u2762", "\\ding{162}"),
1444 |         ("\u2763", "\\ding{163}"),
1445 |         ("\u2764", "\\ding{164}"),
1446 |         ("\u2765", "\\ding{165}"),
1447 |         ("\u2766", "\\ding{166}"),
1448 |         ("\u2767", "\\ding{167}"),
1449 |         ("\u2776", "\\ding{182}"),
1450 |         ("\u2777", "\\ding{183}"),
1451 |         ("\u2778", "\\ding{184}"),
1452 |         ("\u2779", "\\ding{185}"),
1453 |         ("\u277A", "\\ding{186}"),
1454 |         ("\u277B", "\\ding{187}"),
1455 |         ("\u277C", "\\ding{188}"),
1456 |         ("\u277D", "\\ding{189}"),
1457 |         ("\u277E", "\\ding{190}"),
1458 |         ("\u277F", "\\ding{191}"),
1459 |         ("\u2780", "\\ding{192}"),
1460 |         ("\u2781", "\\ding{193}"),
1461 |         ("\u2782", "\\ding{194}"),
1462 |         ("\u2783", "\\ding{195}"),
1463 |         ("\u2784", "\\ding{196}"),
1464 |         ("\u2785", "\\ding{197}"),
1465 |         ("\u2786", "\\ding{198}"),
1466 |         ("\u2787", "\\ding{199}"),
1467 |         ("\u2788", "\\ding{200}"),
1468 |         ("\u2789", "\\ding{201}"),
1469 |         ("\u278A", "\\ding{202}"),
1470 |         ("\u278B", "\\ding{203}"),
1471 |         ("\u278C", "\\ding{204}"),
1472 |         ("\u278D", "\\ding{205}"),
1473 |         ("\u278E", "\\ding{206}"),
1474 |         ("\u278F", "\\ding{207}"),
1475 |         ("\u2790", "\\ding{208}"),
1476 |         ("\u2791", "\\ding{209}"),
1477 |         ("\u2792", "\\ding{210}"),
1478 |         ("\u2793", "\\ding{211}"),
1479 |         ("\u2794", "\\ding{212}"),
1480 |         ("\u2798", "\\ding{216}"),
1481 |         ("\u2799", "\\ding{217}"),
1482 |         ("\u279A", "\\ding{218}"),
1483 |         ("\u279B", "\\ding{219}"),
1484 |         ("\u279C", "\\ding{220}"),
1485 |         ("\u279D", "\\ding{221}"),
1486 |         ("\u279E", "\\ding{222}"),
1487 |         ("\u279F", "\\ding{223}"),
1488 |         ("\u27A0", "\\ding{224}"),
1489 |         ("\u27A1", "\\ding{225}"),
1490 |         ("\u27A2", "\\ding{226}"),
1491 |         ("\u27A3", "\\ding{227}"),
1492 |         ("\u27A4", "\\ding{228}"),
1493 |         ("\u27A5", "\\ding{229}"),
1494 |         ("\u27A6", "\\ding{230}"),
1495 |         ("\u27A7", "\\ding{231}"),
1496 |         ("\u27A8", "\\ding{232}"),
1497 |         ("\u27A9", "\\ding{233}"),
1498 |         ("\u27AA", "\\ding{234}"),
1499 |         ("\u27AB", "\\ding{235}"),
1500 |         ("\u27AC", "\\ding{236}"),
1501 |         ("\u27AD", "\\ding{237}"),
1502 |         ("\u27AE", "\\ding{238}"),
1503 |         ("\u27AF", "\\ding{239}"),
1504 |         ("\u27B1", "\\ding{241}"),
1505 |         ("\u27B2", "\\ding{242}"),
1506 |         ("\u27B3", "\\ding{243}"),
1507 |         ("\u27B4", "\\ding{244}"),
1508 |         ("\u27B5", "\\ding{245}"),
1509 |         ("\u27B6", "\\ding{246}"),
1510 |         ("\u27B7", "\\ding{247}"),
1511 |         ("\u27B8", "\\ding{248}"),
1512 |         ("\u27B9", "\\ding{249}"),
1513 |         ("\u27BA", "\\ding{250}"),
1514 |         ("\u27BB", "\\ding{251}"),
1515 |         ("\u27BC", "\\ding{252}"),
1516 |         ("\u27BD", "\\ding{253}"),
1517 |         ("\u27BE", "\\ding{254}"),
1518 |         ("\u27F5", "\\longleftarrow "),
1519 |         ("\u27F6", "\\longrightarrow "),
1520 |         ("\u27F7", "\\longleftrightarrow "),
1521 |         ("\u27F8", "\\Longleftarrow "),
1522 |         ("\u27F9", "\\Longrightarrow "),
1523 |         ("\u27FA", "\\Longleftrightarrow "),
1524 |         ("\u27FC", "\\longmapsto "),
1525 |         ("\u27FF", "\\sim\\joinrel\\leadsto"),
1526 |         ("\u2905", "\\ElsevierGlyph{E212}"),
1527 |         ("\u2912", "\\UpArrowBar "),
1528 |         ("\u2913", "\\DownArrowBar "),
1529 |         ("\u2923", "\\ElsevierGlyph{E20C}"),
1530 |         ("\u2924", "\\ElsevierGlyph{E20D}"),
1531 |         ("\u2925", "\\ElsevierGlyph{E20B}"),
1532 |         ("\u2926", "\\ElsevierGlyph{E20A}"),
1533 |         ("\u2927", "\\ElsevierGlyph{E211}"),
1534 |         ("\u2928", "\\ElsevierGlyph{E20E}"),
1535 |         ("\u2929", "\\ElsevierGlyph{E20F}"),
1536 |         ("\u292A", "\\ElsevierGlyph{E210}"),
1537 |         ("\u2933", "\\ElsevierGlyph{E21C}"),
1538 |         ("\u2933-00338", "\\ElsevierGlyph{E21D}"),
1539 |         ("\u2936", "\\ElsevierGlyph{E21A}"),
1540 |         ("\u2937", "\\ElsevierGlyph{E219}"),
1541 |         ("\u2940", "\\Elolarr "),
1542 |         ("\u2941", "\\Elorarr "),
1543 |         ("\u2942", "\\ElzRlarr "),
1544 |         ("\u2944", "\\ElzrLarr "),
1545 |         ("\u2947", "\\Elzrarrx "),
1546 |         ("\u294E", "\\LeftRightVector "),
1547 |         ("\u294F", "\\RightUpDownVector "),
1548 |         ("\u2950", "\\DownLeftRightVector "),
1549 |         ("\u2951", "\\LeftUpDownVector "),
1550 |         ("\u2952", "\\LeftVectorBar "),
1551 |         ("\u2953", "\\RightVectorBar "),
1552 |         ("\u2954", "\\RightUpVectorBar "),
1553 |         ("\u2955", "\\RightDownVectorBar "),
1554 |         ("\u2956", "\\DownLeftVectorBar "),
1555 |         ("\u2957", "\\DownRightVectorBar "),
1556 |         ("\u2958", "\\LeftUpVectorBar "),
1557 |         ("\u2959", "\\LeftDownVectorBar "),
1558 |         ("\u295A", "\\LeftTeeVector "),
1559 |         ("\u295B", "\\RightTeeVector "),
1560 |         ("\u295C", "\\RightUpTeeVector "),
1561 |         ("\u295D", "\\RightDownTeeVector "),
1562 |         ("\u295E", "\\DownLeftTeeVector "),
1563 |         ("\u295F", "\\DownRightTeeVector "),
1564 |         ("\u2960", "\\LeftUpTeeVector "),
1565 |         ("\u2961", "\\LeftDownTeeVector "),
1566 |         ("\u296E", "\\UpEquilibrium "),
1567 |         ("\u296F", "\\ReverseUpEquilibrium "),
1568 |         ("\u2970", "\\RoundImplies "),
1569 |         ("\u297C", "\\ElsevierGlyph{E214}"),
1570 |         ("\u297D", "\\ElsevierGlyph{E215}"),
1571 |         ("\u2980", "\\Elztfnc "),
1572 |         ("\u2985", "\\ElsevierGlyph{3018}"),
1573 |         ("\u2986", "\\Elroang "),
1574 |         ("\u2993", "<\\kern-0.58em("),
1575 |         ("\u2994", "\\ElsevierGlyph{E291}"),
1576 |         ("\u2999", "\\Elzddfnc "),
1577 |         ("\u299C", "\\Angle "),
1578 |         ("\u29A0", "\\Elzlpargt "),
1579 |         ("\u29B5", "\\ElsevierGlyph{E260}"),
1580 |         ("\u29B6", "\\ElsevierGlyph{E61B}"),
1581 |         ("\u29CA", "\\ElzLap "),
1582 |         ("\u29CB", "\\Elzdefas "),
1583 |         ("\u29CF", "\\LeftTriangleBar "),
1584 |         ("\u29CF-00338", "\\NotLeftTriangleBar "),
1585 |         ("\u29D0", "\\RightTriangleBar "),
1586 |         ("\u29D0-00338", "\\NotRightTriangleBar "),
1587 |         ("\u29DC", "\\ElsevierGlyph{E372}"),
1588 |         ("\u29EB", "\\blacklozenge "),
1589 |         ("\u29F4", "\\RuleDelayed "),
1590 |         ("\u2A04", "\\Elxuplus "),
1591 |         ("\u2A05", "\\ElzThr "),
1592 |         ("\u2A06", "\\Elxsqcup "),
1593 |         ("\u2A07", "\\ElzInf "),
1594 |         ("\u2A08", "\\ElzSup "),
1595 |         ("\u2A0D", "\\ElzCint "),
1596 |         ("\u2A0F", "\\clockoint "),
1597 |         ("\u2A10", "\\ElsevierGlyph{E395}"),
1598 |         ("\u2A16", "\\sqrint "),
1599 |         ("\u2A25", "\\ElsevierGlyph{E25A}"),
1600 |         ("\u2A2A", "\\ElsevierGlyph{E25B}"),
1601 |         ("\u2A2D", "\\ElsevierGlyph{E25C}"),
1602 |         ("\u2A2E", "\\ElsevierGlyph{E25D}"),
1603 |         ("\u2A2F", "\\ElzTimes "),
1604 |         ("\u2A34", "\\ElsevierGlyph{E25E}"),
1605 |         ("\u2A35", "\\ElsevierGlyph{E25E}"),
1606 |         ("\u2A3C", "\\ElsevierGlyph{E259}"),
1607 |         ("\u2A3F", "\\amalg "),
1608 |         ("\u2A53", "\\ElzAnd "),
1609 |         ("\u2A54", "\\ElzOr "),
1610 |         ("\u2A55", "\\ElsevierGlyph{E36E}"),
1611 |         ("\u2A56", "\\ElOr "),
1612 |         ("\u2A5E", "\\perspcorrespond "),
1613 |         ("\u2A5F", "\\Elzminhat "),
1614 |         ("\u2A63", "\\ElsevierGlyph{225A}"),
1615 |         ("\u2A6E", "\\stackrel{*}{=}"),
1616 |         ("\u2A75", "\\Equal "),
1617 |         ("\u2A7D", "\\leqslant "),
1618 |         ("\u2A7D-00338", "\\nleqslant "),
1619 |         ("\u2A7E", "\\geqslant "),
1620 |         ("\u2A7E-00338", "\\ngeqslant "),
1621 |         ("\u2A85", "\\lessapprox "),
1622 |         ("\u2A86", "\\gtrapprox "),
1623 |         ("\u2A87", "\\lneq "),
1624 |         ("\u2A88", "\\gneq "),
1625 |         ("\u2A89", "\\lnapprox "),
1626 |         ("\u2A8A", "\\gnapprox "),
1627 |         ("\u2A8B", "\\lesseqqgtr "),
1628 |         ("\u2A8C", "\\gtreqqless "),
1629 |         ("\u2A95", "\\eqslantless "),
1630 |         ("\u2A96", "\\eqslantgtr "),
1631 |         ("\u2A9D", "\\Pisymbol{ppi020}{117}"),
1632 |         ("\u2A9E", "\\Pisymbol{ppi020}{105}"),
1633 |         ("\u2AA1", "\\NestedLessLess "),
1634 |         ("\u2AA1-00338", "\\NotNestedLessLess "),
1635 |         ("\u2AA2", "\\NestedGreaterGreater "),
1636 |         ("\u2AA2-00338", "\\NotNestedGreaterGreater "),
1637 |         ("\u2AAF", "\\preceq "),
1638 |         ("\u2AAF-00338", "\\not\\preceq "),
1639 |         ("\u2AB0", "\\succeq "),
1640 |         ("\u2AB0-00338", "\\not\\succeq "),
1641 |         ("\u2AB5", "\\precneqq "),
1642 |         ("\u2AB6", "\\succneqq "),
1643 |         ("\u2AB7", "\\precapprox "),
1644 |         ("\u2AB8", "\\succapprox "),
1645 |         ("\u2AB9", "\\precnapprox "),
1646 |         ("\u2ABA", "\\succnapprox "),
1647 |         ("\u2AC5", "\\subseteqq "),
1648 |         ("\u2AC5-00338", "\\nsubseteqq "),
1649 |         ("\u2AC6", "\\supseteqq "),
1650 |         ("\u2AC6-00338", "\\nsupseteqq"),
1651 |         ("\u2ACB", "\\subsetneqq "),
1652 |         ("\u2ACC", "\\supsetneqq "),
1653 |         ("\u2AEB", "\\ElsevierGlyph{E30D}"),
1654 |         ("\u2AF6", "\\Elztdcol "),
1655 |         ("\u2AFD", "{{/}\\!\\!{/}}"),
1656 |         ("\u2AFD-020E5", "{\\rlap{\\textbackslash}{{/}\\!\\!{/}}}"),
1657 |         ("\u300A", "\\ElsevierGlyph{300A}"),
1658 |         ("\u300B", "\\ElsevierGlyph{300B}"),
1659 |         ("\u3018", "\\ElsevierGlyph{3018}"),
1660 |         ("\u3019", "\\ElsevierGlyph{3019}"),
1661 |         ("\u301A", "\\openbracketleft "),
1662 |         ("\u301B", "\\openbracketright "),
1663 | #        (u"\uFB00", "ff"),
1664 | #        (u"\uFB01", "fi"),
1665 | #        (u"\uFB02", "fl"),
1666 | #        (u"\uFB03", "ffi"),
1667 | #        (u"\uFB04", "ffl"),
1668 |         ("\uD400", "\\mathbf{A}"),
1669 |         ("\uD401", "\\mathbf{B}"),
1670 |         ("\uD402", "\\mathbf{C}"),
1671 |         ("\uD403", "\\mathbf{D}"),
1672 |         ("\uD404", "\\mathbf{E}"),
1673 |         ("\uD405", "\\mathbf{F}"),
1674 |         ("\uD406", "\\mathbf{G}"),
1675 |         ("\uD407", "\\mathbf{H}"),
1676 |         ("\uD408", "\\mathbf{I}"),
1677 |         ("\uD409", "\\mathbf{J}"),
1678 |         ("\uD40A", "\\mathbf{K}"),
1679 |         ("\uD40B", "\\mathbf{L}"),
1680 |         ("\uD40C", "\\mathbf{M}"),
1681 |         ("\uD40D", "\\mathbf{N}"),
1682 |         ("\uD40E", "\\mathbf{O}"),
1683 |         ("\uD40F", "\\mathbf{P}"),
1684 |         ("\uD410", "\\mathbf{Q}"),
1685 |         ("\uD411", "\\mathbf{R}"),
1686 |         ("\uD412", "\\mathbf{S}"),
1687 |         ("\uD413", "\\mathbf{T}"),
1688 |         ("\uD414", "\\mathbf{U}"),
1689 |         ("\uD415", "\\mathbf{V}"),
1690 |         ("\uD416", "\\mathbf{W}"),
1691 |         ("\uD417", "\\mathbf{X}"),
1692 |         ("\uD418", "\\mathbf{Y}"),
1693 |         ("\uD419", "\\mathbf{Z}"),
1694 |         ("\uD41A", "\\mathbf{a}"),
1695 |         ("\uD41B", "\\mathbf{b}"),
1696 |         ("\uD41C", "\\mathbf{c}"),
1697 |         ("\uD41D", "\\mathbf{d}"),
1698 |         ("\uD41E", "\\mathbf{e}"),
1699 |         ("\uD41F", "\\mathbf{f}"),
1700 |         ("\uD420", "\\mathbf{g}"),
1701 |         ("\uD421", "\\mathbf{h}"),
1702 |         ("\uD422", "\\mathbf{i}"),
1703 |         ("\uD423", "\\mathbf{j}"),
1704 |         ("\uD424", "\\mathbf{k}"),
1705 |         ("\uD425", "\\mathbf{l}"),
1706 |         ("\uD426", "\\mathbf{m}"),
1707 |         ("\uD427", "\\mathbf{n}"),
1708 |         ("\uD428", "\\mathbf{o}"),
1709 |         ("\uD429", "\\mathbf{p}"),
1710 |         ("\uD42A", "\\mathbf{q}"),
1711 |         ("\uD42B", "\\mathbf{r}"),
1712 |         ("\uD42C", "\\mathbf{s}"),
1713 |         ("\uD42D", "\\mathbf{t}"),
1714 |         ("\uD42E", "\\mathbf{u}"),
1715 |         ("\uD42F", "\\mathbf{v}"),
1716 |         ("\uD430", "\\mathbf{w}"),
1717 |         ("\uD431", "\\mathbf{x}"),
1718 |         ("\uD432", "\\mathbf{y}"),
1719 |         ("\uD433", "\\mathbf{z}"),
1720 |         ("\uD434", "\\mathsl{A}"),
1721 |         ("\uD435", "\\mathsl{B}"),
1722 |         ("\uD436", "\\mathsl{C}"),
1723 |         ("\uD437", "\\mathsl{D}"),
1724 |         ("\uD438", "\\mathsl{E}"),
1725 |         ("\uD439", "\\mathsl{F}"),
1726 |         ("\uD43A", "\\mathsl{G}"),
1727 |         ("\uD43B", "\\mathsl{H}"),
1728 |         ("\uD43C", "\\mathsl{I}"),
1729 |         ("\uD43D", "\\mathsl{J}"),
1730 |         ("\uD43E", "\\mathsl{K}"),
1731 |         ("\uD43F", "\\mathsl{L}"),
1732 |         ("\uD440", "\\mathsl{M}"),
1733 |         ("\uD441", "\\mathsl{N}"),
1734 |         ("\uD442", "\\mathsl{O}"),
1735 |         ("\uD443", "\\mathsl{P}"),
1736 |         ("\uD444", "\\mathsl{Q}"),
1737 |         ("\uD445", "\\mathsl{R}"),
1738 |         ("\uD446", "\\mathsl{S}"),
1739 |         ("\uD447", "\\mathsl{T}"),
1740 |         ("\uD448", "\\mathsl{U}"),
1741 |         ("\uD449", "\\mathsl{V}"),
1742 |         ("\uD44A", "\\mathsl{W}"),
1743 |         ("\uD44B", "\\mathsl{X}"),
1744 |         ("\uD44C", "\\mathsl{Y}"),
1745 |         ("\uD44D", "\\mathsl{Z}"),
1746 |         ("\uD44E", "\\mathsl{a}"),
1747 |         ("\uD44F", "\\mathsl{b}"),
1748 |         ("\uD450", "\\mathsl{c}"),
1749 |         ("\uD451", "\\mathsl{d}"),
1750 |         ("\uD452", "\\mathsl{e}"),
1751 |         ("\uD453", "\\mathsl{f}"),
1752 |         ("\uD454", "\\mathsl{g}"),
1753 |         ("\uD456", "\\mathsl{i}"),
1754 |         ("\uD457", "\\mathsl{j}"),
1755 |         ("\uD458", "\\mathsl{k}"),
1756 |         ("\uD459", "\\mathsl{l}"),
1757 |         ("\uD45A", "\\mathsl{m}"),
1758 |         ("\uD45B", "\\mathsl{n}"),
1759 |         ("\uD45C", "\\mathsl{o}"),
1760 |         ("\uD45D", "\\mathsl{p}"),
1761 |         ("\uD45E", "\\mathsl{q}"),
1762 |         ("\uD45F", "\\mathsl{r}"),
1763 |         ("\uD460", "\\mathsl{s}"),
1764 |         ("\uD461", "\\mathsl{t}"),
1765 |         ("\uD462", "\\mathsl{u}"),
1766 |         ("\uD463", "\\mathsl{v}"),
1767 |         ("\uD464", "\\mathsl{w}"),
1768 |         ("\uD465", "\\mathsl{x}"),
1769 |         ("\uD466", "\\mathsl{y}"),
1770 |         ("\uD467", "\\mathsl{z}"),
1771 |         ("\uD468", "\\mathbit{A}"),
1772 |         ("\uD469", "\\mathbit{B}"),
1773 |         ("\uD46A", "\\mathbit{C}"),
1774 |         ("\uD46B", "\\mathbit{D}"),
1775 |         ("\uD46C", "\\mathbit{E}"),
1776 |         ("\uD46D", "\\mathbit{F}"),
1777 |         ("\uD46E", "\\mathbit{G}"),
1778 |         ("\uD46F", "\\mathbit{H}"),
1779 |         ("\uD470", "\\mathbit{I}"),
1780 |         ("\uD471", "\\mathbit{J}"),
1781 |         ("\uD472", "\\mathbit{K}"),
1782 |         ("\uD473", "\\mathbit{L}"),
1783 |         ("\uD474", "\\mathbit{M}"),
1784 |         ("\uD475", "\\mathbit{N}"),
1785 |         ("\uD476", "\\mathbit{O}"),
1786 |         ("\uD477", "\\mathbit{P}"),
1787 |         ("\uD478", "\\mathbit{Q}"),
1788 |         ("\uD479", "\\mathbit{R}"),
1789 |         ("\uD47A", "\\mathbit{S}"),
1790 |         ("\uD47B", "\\mathbit{T}"),
1791 |         ("\uD47C", "\\mathbit{U}"),
1792 |         ("\uD47D", "\\mathbit{V}"),
1793 |         ("\uD47E", "\\mathbit{W}"),
1794 |         ("\uD47F", "\\mathbit{X}"),
1795 |         ("\uD480", "\\mathbit{Y}"),
1796 |         ("\uD481", "\\mathbit{Z}"),
1797 |         ("\uD482", "\\mathbit{a}"),
1798 |         ("\uD483", "\\mathbit{b}"),
1799 |         ("\uD484", "\\mathbit{c}"),
1800 |         ("\uD485", "\\mathbit{d}"),
1801 |         ("\uD486", "\\mathbit{e}"),
1802 |         ("\uD487", "\\mathbit{f}"),
1803 |         ("\uD488", "\\mathbit{g}"),
1804 |         ("\uD489", "\\mathbit{h}"),
1805 |         ("\uD48A", "\\mathbit{i}"),
1806 |         ("\uD48B", "\\mathbit{j}"),
1807 |         ("\uD48C", "\\mathbit{k}"),
1808 |         ("\uD48D", "\\mathbit{l}"),
1809 |         ("\uD48E", "\\mathbit{m}"),
1810 |         ("\uD48F", "\\mathbit{n}"),
1811 |         ("\uD490", "\\mathbit{o}"),
1812 |         ("\uD491", "\\mathbit{p}"),
1813 |         ("\uD492", "\\mathbit{q}"),
1814 |         ("\uD493", "\\mathbit{r}"),
1815 |         ("\uD494", "\\mathbit{s}"),
1816 |         ("\uD495", "\\mathbit{t}"),
1817 |         ("\uD496", "\\mathbit{u}"),
1818 |         ("\uD497", "\\mathbit{v}"),
1819 |         ("\uD498", "\\mathbit{w}"),
1820 |         ("\uD499", "\\mathbit{x}"),
1821 |         ("\uD49A", "\\mathbit{y}"),
1822 |         ("\uD49B", "\\mathbit{z}"),
1823 |         ("\uD49C", "\\mathscr{A}"),
1824 |         ("\uD49E", "\\mathscr{C}"),
1825 |         ("\uD49F", "\\mathscr{D}"),
1826 |         ("\uD4A2", "\\mathscr{G}"),
1827 |         ("\uD4A5", "\\mathscr{J}"),
1828 |         ("\uD4A6", "\\mathscr{K}"),
1829 |         ("\uD4A9", "\\mathscr{N}"),
1830 |         ("\uD4AA", "\\mathscr{O}"),
1831 |         ("\uD4AB", "\\mathscr{P}"),
1832 |         ("\uD4AC", "\\mathscr{Q}"),
1833 |         ("\uD4AE", "\\mathscr{S}"),
1834 |         ("\uD4AF", "\\mathscr{T}"),
1835 |         ("\uD4B0", "\\mathscr{U}"),
1836 |         ("\uD4B1", "\\mathscr{V}"),
1837 |         ("\uD4B2", "\\mathscr{W}"),
1838 |         ("\uD4B3", "\\mathscr{X}"),
1839 |         ("\uD4B4", "\\mathscr{Y}"),
1840 |         ("\uD4B5", "\\mathscr{Z}"),
1841 |         ("\uD4B6", "\\mathscr{a}"),
1842 |         ("\uD4B7", "\\mathscr{b}"),
1843 |         ("\uD4B8", "\\mathscr{c}"),
1844 |         ("\uD4B9", "\\mathscr{d}"),
1845 |         ("\uD4BB", "\\mathscr{f}"),
1846 |         ("\uD4BD", "\\mathscr{h}"),
1847 |         ("\uD4BE", "\\mathscr{i}"),
1848 |         ("\uD4BF", "\\mathscr{j}"),
1849 |         ("\uD4C0", "\\mathscr{k}"),
1850 |         ("\uD4C1", "\\mathscr{l}"),
1851 |         ("\uD4C2", "\\mathscr{m}"),
1852 |         ("\uD4C3", "\\mathscr{n}"),
1853 |         ("\uD4C5", "\\mathscr{p}"),
1854 |         ("\uD4C6", "\\mathscr{q}"),
1855 |         ("\uD4C7", "\\mathscr{r}"),
1856 |         ("\uD4C8", "\\mathscr{s}"),
1857 |         ("\uD4C9", "\\mathscr{t}"),
1858 |         ("\uD4CA", "\\mathscr{u}"),
1859 |         ("\uD4CB", "\\mathscr{v}"),
1860 |         ("\uD4CC", "\\mathscr{w}"),
1861 |         ("\uD4CD", "\\mathscr{x}"),
1862 |         ("\uD4CE", "\\mathscr{y}"),
1863 |         ("\uD4CF", "\\mathscr{z}"),
1864 |         ("\uD4D0", "\\mathmit{A}"),
1865 |         ("\uD4D1", "\\mathmit{B}"),
1866 |         ("\uD4D2", "\\mathmit{C}"),
1867 |         ("\uD4D3", "\\mathmit{D}"),
1868 |         ("\uD4D4", "\\mathmit{E}"),
1869 |         ("\uD4D5", "\\mathmit{F}"),
1870 |         ("\uD4D6", "\\mathmit{G}"),
1871 |         ("\uD4D7", "\\mathmit{H}"),
1872 |         ("\uD4D8", "\\mathmit{I}"),
1873 |         ("\uD4D9", "\\mathmit{J}"),
1874 |         ("\uD4DA", "\\mathmit{K}"),
1875 |         ("\uD4DB", "\\mathmit{L}"),
1876 |         ("\uD4DC", "\\mathmit{M}"),
1877 |         ("\uD4DD", "\\mathmit{N}"),
1878 |         ("\uD4DE", "\\mathmit{O}"),
1879 |         ("\uD4DF", "\\mathmit{P}"),
1880 |         ("\uD4E0", "\\mathmit{Q}"),
1881 |         ("\uD4E1", "\\mathmit{R}"),
1882 |         ("\uD4E2", "\\mathmit{S}"),
1883 |         ("\uD4E3", "\\mathmit{T}"),
1884 |         ("\uD4E4", "\\mathmit{U}"),
1885 |         ("\uD4E5", "\\mathmit{V}"),
1886 |         ("\uD4E6", "\\mathmit{W}"),
1887 |         ("\uD4E7", "\\mathmit{X}"),
1888 |         ("\uD4E8", "\\mathmit{Y}"),
1889 |         ("\uD4E9", "\\mathmit{Z}"),
1890 |         ("\uD4EA", "\\mathmit{a}"),
1891 |         ("\uD4EB", "\\mathmit{b}"),
1892 |         ("\uD4EC", "\\mathmit{c}"),
1893 |         ("\uD4ED", "\\mathmit{d}"),
1894 |         ("\uD4EE", "\\mathmit{e}"),
1895 |         ("\uD4EF", "\\mathmit{f}"),
1896 |         ("\uD4F0", "\\mathmit{g}"),
1897 |         ("\uD4F1", "\\mathmit{h}"),
1898 |         ("\uD4F2", "\\mathmit{i}"),
1899 |         ("\uD4F3", "\\mathmit{j}"),
1900 |         ("\uD4F4", "\\mathmit{k}"),
1901 |         ("\uD4F5", "\\mathmit{l}"),
1902 |         ("\uD4F6", "\\mathmit{m}"),
1903 |         ("\uD4F7", "\\mathmit{n}"),
1904 |         ("\uD4F8", "\\mathmit{o}"),
1905 |         ("\uD4F9", "\\mathmit{p}"),
1906 |         ("\uD4FA", "\\mathmit{q}"),
1907 |         ("\uD4FB", "\\mathmit{r}"),
1908 |         ("\uD4FC", "\\mathmit{s}"),
1909 |         ("\uD4FD", "\\mathmit{t}"),
1910 |         ("\uD4FE", "\\mathmit{u}"),
1911 |         ("\uD4FF", "\\mathmit{v}"),
1912 |         ("\uD500", "\\mathmit{w}"),
1913 |         ("\uD501", "\\mathmit{x}"),
1914 |         ("\uD502", "\\mathmit{y}"),
1915 |         ("\uD503", "\\mathmit{z}"),
1916 |         ("\uD504", "\\mathfrak{A}"),
1917 |         ("\uD505", "\\mathfrak{B}"),
1918 |         ("\uD507", "\\mathfrak{D}"),
1919 |         ("\uD508", "\\mathfrak{E}"),
1920 |         ("\uD509", "\\mathfrak{F}"),
1921 |         ("\uD50A", "\\mathfrak{G}"),
1922 |         ("\uD50D", "\\mathfrak{J}"),
1923 |         ("\uD50E", "\\mathfrak{K}"),
1924 |         ("\uD50F", "\\mathfrak{L}"),
1925 |         ("\uD510", "\\mathfrak{M}"),
1926 |         ("\uD511", "\\mathfrak{N}"),
1927 |         ("\uD512", "\\mathfrak{O}"),
1928 |         ("\uD513", "\\mathfrak{P}"),
1929 |         ("\uD514", "\\mathfrak{Q}"),
1930 |         ("\uD516", "\\mathfrak{S}"),
1931 |         ("\uD517", "\\mathfrak{T}"),
1932 |         ("\uD518", "\\mathfrak{U}"),
1933 |         ("\uD519", "\\mathfrak{V}"),
1934 |         ("\uD51A", "\\mathfrak{W}"),
1935 |         ("\uD51B", "\\mathfrak{X}"),
1936 |         ("\uD51C", "\\mathfrak{Y}"),
1937 |         ("\uD51E", "\\mathfrak{a}"),
1938 |         ("\uD51F", "\\mathfrak{b}"),
1939 |         ("\uD520", "\\mathfrak{c}"),
1940 |         ("\uD521", "\\mathfrak{d}"),
1941 |         ("\uD522", "\\mathfrak{e}"),
1942 |         ("\uD523", "\\mathfrak{f}"),
1943 |         ("\uD524", "\\mathfrak{g}"),
1944 |         ("\uD525", "\\mathfrak{h}"),
1945 |         ("\uD526", "\\mathfrak{i}"),
1946 |         ("\uD527", "\\mathfrak{j}"),
1947 |         ("\uD528", "\\mathfrak{k}"),
1948 |         ("\uD529", "\\mathfrak{l}"),
1949 |         ("\uD52A", "\\mathfrak{m}"),
1950 |         ("\uD52B", "\\mathfrak{n}"),
1951 |         ("\uD52C", "\\mathfrak{o}"),
1952 |         ("\uD52D", "\\mathfrak{p}"),
1953 |         ("\uD52E", "\\mathfrak{q}"),
1954 |         ("\uD52F", "\\mathfrak{r}"),
1955 |         ("\uD530", "\\mathfrak{s}"),
1956 |         ("\uD531", "\\mathfrak{t}"),
1957 |         ("\uD532", "\\mathfrak{u}"),
1958 |         ("\uD533", "\\mathfrak{v}"),
1959 |         ("\uD534", "\\mathfrak{w}"),
1960 |         ("\uD535", "\\mathfrak{x}"),
1961 |         ("\uD536", "\\mathfrak{y}"),
1962 |         ("\uD537", "\\mathfrak{z}"),
1963 |         ("\uD538", "\\mathbb{A}"),
1964 |         ("\uD539", "\\mathbb{B}"),
1965 |         ("\uD53B", "\\mathbb{D}"),
1966 |         ("\uD53C", "\\mathbb{E}"),
1967 |         ("\uD53D", "\\mathbb{F}"),
1968 |         ("\uD53E", "\\mathbb{G}"),
1969 |         ("\uD540", "\\mathbb{I}"),
1970 |         ("\uD541", "\\mathbb{J}"),
1971 |         ("\uD542", "\\mathbb{K}"),
1972 |         ("\uD543", "\\mathbb{L}"),
1973 |         ("\uD544", "\\mathbb{M}"),
1974 |         ("\uD546", "\\mathbb{O}"),
1975 |         ("\uD54A", "\\mathbb{S}"),
1976 |         ("\uD54B", "\\mathbb{T}"),
1977 |         ("\uD54C", "\\mathbb{U}"),
1978 |         ("\uD54D", "\\mathbb{V}"),
1979 |         ("\uD54E", "\\mathbb{W}"),
1980 |         ("\uD54F", "\\mathbb{X}"),
1981 |         ("\uD550", "\\mathbb{Y}"),
1982 |         ("\uD552", "\\mathbb{a}"),
1983 |         ("\uD553", "\\mathbb{b}"),
1984 |         ("\uD554", "\\mathbb{c}"),
1985 |         ("\uD555", "\\mathbb{d}"),
1986 |         ("\uD556", "\\mathbb{e}"),
1987 |         ("\uD557", "\\mathbb{f}"),
1988 |         ("\uD558", "\\mathbb{g}"),
1989 |         ("\uD559", "\\mathbb{h}"),
1990 |         ("\uD55A", "\\mathbb{i}"),
1991 |         ("\uD55B", "\\mathbb{j}"),
1992 |         ("\uD55C", "\\mathbb{k}"),
1993 |         ("\uD55D", "\\mathbb{l}"),
1994 |         ("\uD55E", "\\mathbb{m}"),
1995 |         ("\uD55F", "\\mathbb{n}"),
1996 |         ("\uD560", "\\mathbb{o}"),
1997 |         ("\uD561", "\\mathbb{p}"),
1998 |         ("\uD562", "\\mathbb{q}"),
1999 |         ("\uD563", "\\mathbb{r}"),
2000 |         ("\uD564", "\\mathbb{s}"),
2001 |         ("\uD565", "\\mathbb{t}"),
2002 |         ("\uD566", "\\mathbb{u}"),
2003 |         ("\uD567", "\\mathbb{v}"),
2004 |         ("\uD568", "\\mathbb{w}"),
2005 |         ("\uD569", "\\mathbb{x}"),
2006 |         ("\uD56A", "\\mathbb{y}"),
2007 |         ("\uD56B", "\\mathbb{z}"),
2008 |         ("\uD56C", "\\mathslbb{A}"),
2009 |         ("\uD56D", "\\mathslbb{B}"),
2010 |         ("\uD56E", "\\mathslbb{C}"),
2011 |         ("\uD56F", "\\mathslbb{D}"),
2012 |         ("\uD570", "\\mathslbb{E}"),
2013 |         ("\uD571", "\\mathslbb{F}"),
2014 |         ("\uD572", "\\mathslbb{G}"),
2015 |         ("\uD573", "\\mathslbb{H}"),
2016 |         ("\uD574", "\\mathslbb{I}"),
2017 |         ("\uD575", "\\mathslbb{J}"),
2018 |         ("\uD576", "\\mathslbb{K}"),
2019 |         ("\uD577", "\\mathslbb{L}"),
2020 |         ("\uD578", "\\mathslbb{M}"),
2021 |         ("\uD579", "\\mathslbb{N}"),
2022 |         ("\uD57A", "\\mathslbb{O}"),
2023 |         ("\uD57B", "\\mathslbb{P}"),
2024 |         ("\uD57C", "\\mathslbb{Q}"),
2025 |         ("\uD57D", "\\mathslbb{R}"),
2026 |         ("\uD57E", "\\mathslbb{S}"),
2027 |         ("\uD57F", "\\mathslbb{T}"),
2028 |         ("\uD580", "\\mathslbb{U}"),
2029 |         ("\uD581", "\\mathslbb{V}"),
2030 |         ("\uD582", "\\mathslbb{W}"),
2031 |         ("\uD583", "\\mathslbb{X}"),
2032 |         ("\uD584", "\\mathslbb{Y}"),
2033 |         ("\uD585", "\\mathslbb{Z}"),
2034 |         ("\uD586", "\\mathslbb{a}"),
2035 |         ("\uD587", "\\mathslbb{b}"),
2036 |         ("\uD588", "\\mathslbb{c}"),
2037 |         ("\uD589", "\\mathslbb{d}"),
2038 |         ("\uD58A", "\\mathslbb{e}"),
2039 |         ("\uD58B", "\\mathslbb{f}"),
2040 |         ("\uD58C", "\\mathslbb{g}"),
2041 |         ("\uD58D", "\\mathslbb{h}"),
2042 |         ("\uD58E", "\\mathslbb{i}"),
2043 |         ("\uD58F", "\\mathslbb{j}"),
2044 |         ("\uD590", "\\mathslbb{k}"),
2045 |         ("\uD591", "\\mathslbb{l}"),
2046 |         ("\uD592", "\\mathslbb{m}"),
2047 |         ("\uD593", "\\mathslbb{n}"),
2048 |         ("\uD594", "\\mathslbb{o}"),
2049 |         ("\uD595", "\\mathslbb{p}"),
2050 |         ("\uD596", "\\mathslbb{q}"),
2051 |         ("\uD597", "\\mathslbb{r}"),
2052 |         ("\uD598", "\\mathslbb{s}"),
2053 |         ("\uD599", "\\mathslbb{t}"),
2054 |         ("\uD59A", "\\mathslbb{u}"),
2055 |         ("\uD59B", "\\mathslbb{v}"),
2056 |         ("\uD59C", "\\mathslbb{w}"),
2057 |         ("\uD59D", "\\mathslbb{x}"),
2058 |         ("\uD59E", "\\mathslbb{y}"),
2059 |         ("\uD59F", "\\mathslbb{z}"),
2060 |         ("\uD5A0", "\\mathsf{A}"),
2061 |         ("\uD5A1", "\\mathsf{B}"),
2062 |         ("\uD5A2", "\\mathsf{C}"),
2063 |         ("\uD5A3", "\\mathsf{D}"),
2064 |         ("\uD5A4", "\\mathsf{E}"),
2065 |         ("\uD5A5", "\\mathsf{F}"),
2066 |         ("\uD5A6", "\\mathsf{G}"),
2067 |         ("\uD5A7", "\\mathsf{H}"),
2068 |         ("\uD5A8", "\\mathsf{I}"),
2069 |         ("\uD5A9", "\\mathsf{J}"),
2070 |         ("\uD5AA", "\\mathsf{K}"),
2071 |         ("\uD5AB", "\\mathsf{L}"),
2072 |         ("\uD5AC", "\\mathsf{M}"),
2073 |         ("\uD5AD", "\\mathsf{N}"),
2074 |         ("\uD5AE", "\\mathsf{O}"),
2075 |         ("\uD5AF", "\\mathsf{P}"),
2076 |         ("\uD5B0", "\\mathsf{Q}"),
2077 |         ("\uD5B1", "\\mathsf{R}"),
2078 |         ("\uD5B2", "\\mathsf{S}"),
2079 |         ("\uD5B3", "\\mathsf{T}"),
2080 |         ("\uD5B4", "\\mathsf{U}"),
2081 |         ("\uD5B5", "\\mathsf{V}"),
2082 |         ("\uD5B6", "\\mathsf{W}"),
2083 |         ("\uD5B7", "\\mathsf{X}"),
2084 |         ("\uD5B8", "\\mathsf{Y}"),
2085 |         ("\uD5B9", "\\mathsf{Z}"),
2086 |         ("\uD5BA", "\\mathsf{a}"),
2087 |         ("\uD5BB", "\\mathsf{b}"),
2088 |         ("\uD5BC", "\\mathsf{c}"),
2089 |         ("\uD5BD", "\\mathsf{d}"),
2090 |         ("\uD5BE", "\\mathsf{e}"),
2091 |         ("\uD5BF", "\\mathsf{f}"),
2092 |         ("\uD5C0", "\\mathsf{g}"),
2093 |         ("\uD5C1", "\\mathsf{h}"),
2094 |         ("\uD5C2", "\\mathsf{i}"),
2095 |         ("\uD5C3", "\\mathsf{j}"),
2096 |         ("\uD5C4", "\\mathsf{k}"),
2097 |         ("\uD5C5", "\\mathsf{l}"),
2098 |         ("\uD5C6", "\\mathsf{m}"),
2099 |         ("\uD5C7", "\\mathsf{n}"),
2100 |         ("\uD5C8", "\\mathsf{o}"),
2101 |         ("\uD5C9", "\\mathsf{p}"),
2102 |         ("\uD5CA", "\\mathsf{q}"),
2103 |         ("\uD5CB", "\\mathsf{r}"),
2104 |         ("\uD5CC", "\\mathsf{s}"),
2105 |         ("\uD5CD", "\\mathsf{t}"),
2106 |         ("\uD5CE", "\\mathsf{u}"),
2107 |         ("\uD5CF", "\\mathsf{v}"),
2108 |         ("\uD5D0", "\\mathsf{w}"),
2109 |         ("\uD5D1", "\\mathsf{x}"),
2110 |         ("\uD5D2", "\\mathsf{y}"),
2111 |         ("\uD5D3", "\\mathsf{z}"),
2112 |         ("\uD5D4", "\\mathsfbf{A}"),
2113 |         ("\uD5D5", "\\mathsfbf{B}"),
2114 |         ("\uD5D6", "\\mathsfbf{C}"),
2115 |         ("\uD5D7", "\\mathsfbf{D}"),
2116 |         ("\uD5D8", "\\mathsfbf{E}"),
2117 |         ("\uD5D9", "\\mathsfbf{F}"),
2118 |         ("\uD5DA", "\\mathsfbf{G}"),
2119 |         ("\uD5DB", "\\mathsfbf{H}"),
2120 |         ("\uD5DC", "\\mathsfbf{I}"),
2121 |         ("\uD5DD", "\\mathsfbf{J}"),
2122 |         ("\uD5DE", "\\mathsfbf{K}"),
2123 |         ("\uD5DF", "\\mathsfbf{L}"),
2124 |         ("\uD5E0", "\\mathsfbf{M}"),
2125 |         ("\uD5E1", "\\mathsfbf{N}"),
2126 |         ("\uD5E2", "\\mathsfbf{O}"),
2127 |         ("\uD5E3", "\\mathsfbf{P}"),
2128 |         ("\uD5E4", "\\mathsfbf{Q}"),
2129 |         ("\uD5E5", "\\mathsfbf{R}"),
2130 |         ("\uD5E6", "\\mathsfbf{S}"),
2131 |         ("\uD5E7", "\\mathsfbf{T}"),
2132 |         ("\uD5E8", "\\mathsfbf{U}"),
2133 |         ("\uD5E9", "\\mathsfbf{V}"),
2134 |         ("\uD5EA", "\\mathsfbf{W}"),
2135 |         ("\uD5EB", "\\mathsfbf{X}"),
2136 |         ("\uD5EC", "\\mathsfbf{Y}"),
2137 |         ("\uD5ED", "\\mathsfbf{Z}"),
2138 |         ("\uD5EE", "\\mathsfbf{a}"),
2139 |         ("\uD5EF", "\\mathsfbf{b}"),
2140 |         ("\uD5F0", "\\mathsfbf{c}"),
2141 |         ("\uD5F1", "\\mathsfbf{d}"),
2142 |         ("\uD5F2", "\\mathsfbf{e}"),
2143 |         ("\uD5F3", "\\mathsfbf{f}"),
2144 |         ("\uD5F4", "\\mathsfbf{g}"),
2145 |         ("\uD5F5", "\\mathsfbf{h}"),
2146 |         ("\uD5F6", "\\mathsfbf{i}"),
2147 |         ("\uD5F7", "\\mathsfbf{j}"),
2148 |         ("\uD5F8", "\\mathsfbf{k}"),
2149 |         ("\uD5F9", "\\mathsfbf{l}"),
2150 |         ("\uD5FA", "\\mathsfbf{m}"),
2151 |         ("\uD5FB", "\\mathsfbf{n}"),
2152 |         ("\uD5FC", "\\mathsfbf{o}"),
2153 |         ("\uD5FD", "\\mathsfbf{p}"),
2154 |         ("\uD5FE", "\\mathsfbf{q}"),
2155 |         ("\uD5FF", "\\mathsfbf{r}"),
2156 |         ("\uD600", "\\mathsfbf{s}"),
2157 |         ("\uD601", "\\mathsfbf{t}"),
2158 |         ("\uD602", "\\mathsfbf{u}"),
2159 |         ("\uD603", "\\mathsfbf{v}"),
2160 |         ("\uD604", "\\mathsfbf{w}"),
2161 |         ("\uD605", "\\mathsfbf{x}"),
2162 |         ("\uD606", "\\mathsfbf{y}"),
2163 |         ("\uD607", "\\mathsfbf{z}"),
2164 |         ("\uD608", "\\mathsfsl{A}"),
2165 |         ("\uD609", "\\mathsfsl{B}"),
2166 |         ("\uD60A", "\\mathsfsl{C}"),
2167 |         ("\uD60B", "\\mathsfsl{D}"),
2168 |         ("\uD60C", "\\mathsfsl{E}"),
2169 |         ("\uD60D", "\\mathsfsl{F}"),
2170 |         ("\uD60E", "\\mathsfsl{G}"),
2171 |         ("\uD60F", "\\mathsfsl{H}"),
2172 |         ("\uD610", "\\mathsfsl{I}"),
2173 |         ("\uD611", "\\mathsfsl{J}"),
2174 |         ("\uD612", "\\mathsfsl{K}"),
2175 |         ("\uD613", "\\mathsfsl{L}"),
2176 |         ("\uD614", "\\mathsfsl{M}"),
2177 |         ("\uD615", "\\mathsfsl{N}"),
2178 |         ("\uD616", "\\mathsfsl{O}"),
2179 |         ("\uD617", "\\mathsfsl{P}"),
2180 |         ("\uD618", "\\mathsfsl{Q}"),
2181 |         ("\uD619", "\\mathsfsl{R}"),
2182 |         ("\uD61A", "\\mathsfsl{S}"),
2183 |         ("\uD61B", "\\mathsfsl{T}"),
2184 |         ("\uD61C", "\\mathsfsl{U}"),
2185 |         ("\uD61D", "\\mathsfsl{V}"),
2186 |         ("\uD61E", "\\mathsfsl{W}"),
2187 |         ("\uD61F", "\\mathsfsl{X}"),
2188 |         ("\uD620", "\\mathsfsl{Y}"),
2189 |         ("\uD621", "\\mathsfsl{Z}"),
2190 |         ("\uD622", "\\mathsfsl{a}"),
2191 |         ("\uD623", "\\mathsfsl{b}"),
2192 |         ("\uD624", "\\mathsfsl{c}"),
2193 |         ("\uD625", "\\mathsfsl{d}"),
2194 |         ("\uD626", "\\mathsfsl{e}"),
2195 |         ("\uD627", "\\mathsfsl{f}"),
2196 |         ("\uD628", "\\mathsfsl{g}"),
2197 |         ("\uD629", "\\mathsfsl{h}"),
2198 |         ("\uD62A", "\\mathsfsl{i}"),
2199 |         ("\uD62B", "\\mathsfsl{j}"),
2200 |         ("\uD62C", "\\mathsfsl{k}"),
2201 |         ("\uD62D", "\\mathsfsl{l}"),
2202 |         ("\uD62E", "\\mathsfsl{m}"),
2203 |         ("\uD62F", "\\mathsfsl{n}"),
2204 |         ("\uD630", "\\mathsfsl{o}"),
2205 |         ("\uD631", "\\mathsfsl{p}"),
2206 |         ("\uD632", "\\mathsfsl{q}"),
2207 |         ("\uD633", "\\mathsfsl{r}"),
2208 |         ("\uD634", "\\mathsfsl{s}"),
2209 |         ("\uD635", "\\mathsfsl{t}"),
2210 |         ("\uD636", "\\mathsfsl{u}"),
2211 |         ("\uD637", "\\mathsfsl{v}"),
2212 |         ("\uD638", "\\mathsfsl{w}"),
2213 |         ("\uD639", "\\mathsfsl{x}"),
2214 |         ("\uD63A", "\\mathsfsl{y}"),
2215 |         ("\uD63B", "\\mathsfsl{z}"),
2216 |         ("\uD63C", "\\mathsfbfsl{A}"),
2217 |         ("\uD63D", "\\mathsfbfsl{B}"),
2218 |         ("\uD63E", "\\mathsfbfsl{C}"),
2219 |         ("\uD63F", "\\mathsfbfsl{D}"),
2220 |         ("\uD640", "\\mathsfbfsl{E}"),
2221 |         ("\uD641", "\\mathsfbfsl{F}"),
2222 |         ("\uD642", "\\mathsfbfsl{G}"),
2223 |         ("\uD643", "\\mathsfbfsl{H}"),
2224 |         ("\uD644", "\\mathsfbfsl{I}"),
2225 |         ("\uD645", "\\mathsfbfsl{J}"),
2226 |         ("\uD646", "\\mathsfbfsl{K}"),
2227 |         ("\uD647", "\\mathsfbfsl{L}"),
2228 |         ("\uD648", "\\mathsfbfsl{M}"),
2229 |         ("\uD649", "\\mathsfbfsl{N}"),
2230 |         ("\uD64A", "\\mathsfbfsl{O}"),
2231 |         ("\uD64B", "\\mathsfbfsl{P}"),
2232 |         ("\uD64C", "\\mathsfbfsl{Q}"),
2233 |         ("\uD64D", "\\mathsfbfsl{R}"),
2234 |         ("\uD64E", "\\mathsfbfsl{S}"),
2235 |         ("\uD64F", "\\mathsfbfsl{T}"),
2236 |         ("\uD650", "\\mathsfbfsl{U}"),
2237 |         ("\uD651", "\\mathsfbfsl{V}"),
2238 |         ("\uD652", "\\mathsfbfsl{W}"),
2239 |         ("\uD653", "\\mathsfbfsl{X}"),
2240 |         ("\uD654", "\\mathsfbfsl{Y}"),
2241 |         ("\uD655", "\\mathsfbfsl{Z}"),
2242 |         ("\uD656", "\\mathsfbfsl{a}"),
2243 |         ("\uD657", "\\mathsfbfsl{b}"),
2244 |         ("\uD658", "\\mathsfbfsl{c}"),
2245 |         ("\uD659", "\\mathsfbfsl{d}"),
2246 |         ("\uD65A", "\\mathsfbfsl{e}"),
2247 |         ("\uD65B", "\\mathsfbfsl{f}"),
2248 |         ("\uD65C", "\\mathsfbfsl{g}"),
2249 |         ("\uD65D", "\\mathsfbfsl{h}"),
2250 |         ("\uD65E", "\\mathsfbfsl{i}"),
2251 |         ("\uD65F", "\\mathsfbfsl{j}"),
2252 |         ("\uD660", "\\mathsfbfsl{k}"),
2253 |         ("\uD661", "\\mathsfbfsl{l}"),
2254 |         ("\uD662", "\\mathsfbfsl{m}"),
2255 |         ("\uD663", "\\mathsfbfsl{n}"),
2256 |         ("\uD664", "\\mathsfbfsl{o}"),
2257 |         ("\uD665", "\\mathsfbfsl{p}"),
2258 |         ("\uD666", "\\mathsfbfsl{q}"),
2259 |         ("\uD667", "\\mathsfbfsl{r}"),
2260 |         ("\uD668", "\\mathsfbfsl{s}"),
2261 |         ("\uD669", "\\mathsfbfsl{t}"),
2262 |         ("\uD66A", "\\mathsfbfsl{u}"),
2263 |         ("\uD66B", "\\mathsfbfsl{v}"),
2264 |         ("\uD66C", "\\mathsfbfsl{w}"),
2265 |         ("\uD66D", "\\mathsfbfsl{x}"),
2266 |         ("\uD66E", "\\mathsfbfsl{y}"),
2267 |         ("\uD66F", "\\mathsfbfsl{z}"),
2268 |         ("\uD670", "\\mathtt{A}"),
2269 |         ("\uD671", "\\mathtt{B}"),
2270 |         ("\uD672", "\\mathtt{C}"),
2271 |         ("\uD673", "\\mathtt{D}"),
2272 |         ("\uD674", "\\mathtt{E}"),
2273 |         ("\uD675", "\\mathtt{F}"),
2274 |         ("\uD676", "\\mathtt{G}"),
2275 |         ("\uD677", "\\mathtt{H}"),
2276 |         ("\uD678", "\\mathtt{I}"),
2277 |         ("\uD679", "\\mathtt{J}"),
2278 |         ("\uD67A", "\\mathtt{K}"),
2279 |         ("\uD67B", "\\mathtt{L}"),
2280 |         ("\uD67C", "\\mathtt{M}"),
2281 |         ("\uD67D", "\\mathtt{N}"),
2282 |         ("\uD67E", "\\mathtt{O}"),
2283 |         ("\uD67F", "\\mathtt{P}"),
2284 |         ("\uD680", "\\mathtt{Q}"),
2285 |         ("\uD681", "\\mathtt{R}"),
2286 |         ("\uD682", "\\mathtt{S}"),
2287 |         ("\uD683", "\\mathtt{T}"),
2288 |         ("\uD684", "\\mathtt{U}"),
2289 |         ("\uD685", "\\mathtt{V}"),
2290 |         ("\uD686", "\\mathtt{W}"),
2291 |         ("\uD687", "\\mathtt{X}"),
2292 |         ("\uD688", "\\mathtt{Y}"),
2293 |         ("\uD689", "\\mathtt{Z}"),
2294 |         ("\uD68A", "\\mathtt{a}"),
2295 |         ("\uD68B", "\\mathtt{b}"),
2296 |         ("\uD68C", "\\mathtt{c}"),
2297 |         ("\uD68D", "\\mathtt{d}"),
2298 |         ("\uD68E", "\\mathtt{e}"),
2299 |         ("\uD68F", "\\mathtt{f}"),
2300 |         ("\uD690", "\\mathtt{g}"),
2301 |         ("\uD691", "\\mathtt{h}"),
2302 |         ("\uD692", "\\mathtt{i}"),
2303 |         ("\uD693", "\\mathtt{j}"),
2304 |         ("\uD694", "\\mathtt{k}"),
2305 |         ("\uD695", "\\mathtt{l}"),
2306 |         ("\uD696", "\\mathtt{m}"),
2307 |         ("\uD697", "\\mathtt{n}"),
2308 |         ("\uD698", "\\mathtt{o}"),
2309 |         ("\uD699", "\\mathtt{p}"),
2310 |         ("\uD69A", "\\mathtt{q}"),
2311 |         ("\uD69B", "\\mathtt{r}"),
2312 |         ("\uD69C", "\\mathtt{s}"),
2313 |         ("\uD69D", "\\mathtt{t}"),
2314 |         ("\uD69E", "\\mathtt{u}"),
2315 |         ("\uD69F", "\\mathtt{v}"),
2316 |         ("\uD6A0", "\\mathtt{w}"),
2317 |         ("\uD6A1", "\\mathtt{x}"),
2318 |         ("\uD6A2", "\\mathtt{y}"),
2319 |         ("\uD6A3", "\\mathtt{z}"),
2320 |         ("\uD6A8", "\\mathbf{\\Alpha}"),
2321 |         ("\uD6A9", "\\mathbf{\\Beta}"),
2322 |         ("\uD6AA", "\\mathbf{\\Gamma}"),
2323 |         ("\uD6AB", "\\mathbf{\\Delta}"),
2324 |         ("\uD6AC", "\\mathbf{\\Epsilon}"),
2325 |         ("\uD6AD", "\\mathbf{\\Zeta}"),
2326 |         ("\uD6AE", "\\mathbf{\\Eta}"),
2327 |         ("\uD6AF", "\\mathbf{\\Theta}"),
2328 |         ("\uD6B0", "\\mathbf{\\Iota}"),
2329 |         ("\uD6B1", "\\mathbf{\\Kappa}"),
2330 |         ("\uD6B2", "\\mathbf{\\Lambda}"),
2331 |         ("\uD6B5", "\\mathbf{\\Xi}"),
2332 |         ("\uD6B7", "\\mathbf{\\Pi}"),
2333 |         ("\uD6B8", "\\mathbf{\\Rho}"),
2334 |         ("\uD6B9", "\\mathbf{\\vartheta}"),
2335 |         ("\uD6BA", "\\mathbf{\\Sigma}"),
2336 |         ("\uD6BB", "\\mathbf{\\Tau}"),
2337 |         ("\uD6BC", "\\mathbf{\\Upsilon}"),
2338 |         ("\uD6BD", "\\mathbf{\\Phi}"),
2339 |         ("\uD6BE", "\\mathbf{\\Chi}"),
2340 |         ("\uD6BF", "\\mathbf{\\Psi}"),
2341 |         ("\uD6C0", "\\mathbf{\\Omega}"),
2342 |         ("\uD6C1", "\\mathbf{\\nabla}"),
2343 |         ("\uD6C2", "\\mathbf{\\Alpha}"),
2344 |         ("\uD6C3", "\\mathbf{\\Beta}"),
2345 |         ("\uD6C4", "\\mathbf{\\Gamma}"),
2346 |         ("\uD6C5", "\\mathbf{\\Delta}"),
2347 |         ("\uD6C6", "\\mathbf{\\Epsilon}"),
2348 |         ("\uD6C7", "\\mathbf{\\Zeta}"),
2349 |         ("\uD6C8", "\\mathbf{\\Eta}"),
2350 |         ("\uD6C9", "\\mathbf{\\theta}"),
2351 |         ("\uD6CA", "\\mathbf{\\Iota}"),
2352 |         ("\uD6CB", "\\mathbf{\\Kappa}"),
2353 |         ("\uD6CC", "\\mathbf{\\Lambda}"),
2354 |         ("\uD6CF", "\\mathbf{\\Xi}"),
2355 |         ("\uD6D1", "\\mathbf{\\Pi}"),
2356 |         ("\uD6D2", "\\mathbf{\\Rho}"),
2357 |         ("\uD6D3", "\\mathbf{\\varsigma}"),
2358 |         ("\uD6D4", "\\mathbf{\\Sigma}"),
2359 |         ("\uD6D5", "\\mathbf{\\Tau}"),
2360 |         ("\uD6D6", "\\mathbf{\\Upsilon}"),
2361 |         ("\uD6D7", "\\mathbf{\\Phi}"),
2362 |         ("\uD6D8", "\\mathbf{\\Chi}"),
2363 |         ("\uD6D9", "\\mathbf{\\Psi}"),
2364 |         ("\uD6DA", "\\mathbf{\\Omega}"),
2365 |         ("\uD6DB", "\\partial "),
2366 |         ("\uD6DC", "\\in"),
2367 |         ("\uD6DD", "\\mathbf{\\vartheta}"),
2368 |         ("\uD6DE", "\\mathbf{\\varkappa}"),
2369 |         ("\uD6DF", "\\mathbf{\\phi}"),
2370 |         ("\uD6E0", "\\mathbf{\\varrho}"),
2371 |         ("\uD6E1", "\\mathbf{\\varpi}"),
2372 |         ("\uD6E2", "\\mathsl{\\Alpha}"),
2373 |         ("\uD6E3", "\\mathsl{\\Beta}"),
2374 |         ("\uD6E4", "\\mathsl{\\Gamma}"),
2375 |         ("\uD6E5", "\\mathsl{\\Delta}"),
2376 |         ("\uD6E6", "\\mathsl{\\Epsilon}"),
2377 |         ("\uD6E7", "\\mathsl{\\Zeta}"),
2378 |         ("\uD6E8", "\\mathsl{\\Eta}"),
2379 |         ("\uD6E9", "\\mathsl{\\Theta}"),
2380 |         ("\uD6EA", "\\mathsl{\\Iota}"),
2381 |         ("\uD6EB", "\\mathsl{\\Kappa}"),
2382 |         ("\uD6EC", "\\mathsl{\\Lambda}"),
2383 |         ("\uD6EF", "\\mathsl{\\Xi}"),
2384 |         ("\uD6F1", "\\mathsl{\\Pi}"),
2385 |         ("\uD6F2", "\\mathsl{\\Rho}"),
2386 |         ("\uD6F3", "\\mathsl{\\vartheta}"),
2387 |         ("\uD6F4", "\\mathsl{\\Sigma}"),
2388 |         ("\uD6F5", "\\mathsl{\\Tau}"),
2389 |         ("\uD6F6", "\\mathsl{\\Upsilon}"),
2390 |         ("\uD6F7", "\\mathsl{\\Phi}"),
2391 |         ("\uD6F8", "\\mathsl{\\Chi}"),
2392 |         ("\uD6F9", "\\mathsl{\\Psi}"),
2393 |         ("\uD6FA", "\\mathsl{\\Omega}"),
2394 |         ("\uD6FB", "\\mathsl{\\nabla}"),
2395 |         ("\uD6FC", "\\mathsl{\\Alpha}"),
2396 |         ("\uD6FD", "\\mathsl{\\Beta}"),
2397 |         ("\uD6FE", "\\mathsl{\\Gamma}"),
2398 |         ("\uD6FF", "\\mathsl{\\Delta}"),
2399 |         ("\uD700", "\\mathsl{\\Epsilon}"),
2400 |         ("\uD701", "\\mathsl{\\Zeta}"),
2401 |         ("\uD702", "\\mathsl{\\Eta}"),
2402 |         ("\uD703", "\\mathsl{\\Theta}"),
2403 |         ("\uD704", "\\mathsl{\\Iota}"),
2404 |         ("\uD705", "\\mathsl{\\Kappa}"),
2405 |         ("\uD706", "\\mathsl{\\Lambda}"),
2406 |         ("\uD709", "\\mathsl{\\Xi}"),
2407 |         ("\uD70B", "\\mathsl{\\Pi}"),
2408 |         ("\uD70C", "\\mathsl{\\Rho}"),
2409 |         ("\uD70D", "\\mathsl{\\varsigma}"),
2410 |         ("\uD70E", "\\mathsl{\\Sigma}"),
2411 |         ("\uD70F", "\\mathsl{\\Tau}"),
2412 |         ("\uD710", "\\mathsl{\\Upsilon}"),
2413 |         ("\uD711", "\\mathsl{\\Phi}"),
2414 |         ("\uD712", "\\mathsl{\\Chi}"),
2415 |         ("\uD713", "\\mathsl{\\Psi}"),
2416 |         ("\uD714", "\\mathsl{\\Omega}"),
2417 |         ("\uD715", "\\partial "),
2418 |         ("\uD716", "\\in"),
2419 |         ("\uD717", "\\mathsl{\\vartheta}"),
2420 |         ("\uD718", "\\mathsl{\\varkappa}"),
2421 |         ("\uD719", "\\mathsl{\\phi}"),
2422 |         ("\uD71A", "\\mathsl{\\varrho}"),
2423 |         ("\uD71B", "\\mathsl{\\varpi}"),
2424 |         ("\uD71C", "\\mathbit{\\Alpha}"),
2425 |         ("\uD71D", "\\mathbit{\\Beta}"),
2426 |         ("\uD71E", "\\mathbit{\\Gamma}"),
2427 |         ("\uD71F", "\\mathbit{\\Delta}"),
2428 |         ("\uD720", "\\mathbit{\\Epsilon}"),
2429 |         ("\uD721", "\\mathbit{\\Zeta}"),
2430 |         ("\uD722", "\\mathbit{\\Eta}"),
2431 |         ("\uD723", "\\mathbit{\\Theta}"),
2432 |         ("\uD724", "\\mathbit{\\Iota}"),
2433 |         ("\uD725", "\\mathbit{\\Kappa}"),
2434 |         ("\uD726", "\\mathbit{\\Lambda}"),
2435 |         ("\uD729", "\\mathbit{\\Xi}"),
2436 |         ("\uD72B", "\\mathbit{\\Pi}"),
2437 |         ("\uD72C", "\\mathbit{\\Rho}"),
2438 |         ("\uD72D", "\\mathbit{O}"),
2439 |         ("\uD72E", "\\mathbit{\\Sigma}"),
2440 |         ("\uD72F", "\\mathbit{\\Tau}"),
2441 |         ("\uD730", "\\mathbit{\\Upsilon}"),
2442 |         ("\uD731", "\\mathbit{\\Phi}"),
2443 |         ("\uD732", "\\mathbit{\\Chi}"),
2444 |         ("\uD733", "\\mathbit{\\Psi}"),
2445 |         ("\uD734", "\\mathbit{\\Omega}"),
2446 |         ("\uD735", "\\mathbit{\\nabla}"),
2447 |         ("\uD736", "\\mathbit{\\Alpha}"),
2448 |         ("\uD737", "\\mathbit{\\Beta}"),
2449 |         ("\uD738", "\\mathbit{\\Gamma}"),
2450 |         ("\uD739", "\\mathbit{\\Delta}"),
2451 |         ("\uD73A", "\\mathbit{\\Epsilon}"),
2452 |         ("\uD73B", "\\mathbit{\\Zeta}"),
2453 |         ("\uD73C", "\\mathbit{\\Eta}"),
2454 |         ("\uD73D", "\\mathbit{\\Theta}"),
2455 |         ("\uD73E", "\\mathbit{\\Iota}"),
2456 |         ("\uD73F", "\\mathbit{\\Kappa}"),
2457 |         ("\uD740", "\\mathbit{\\Lambda}"),
2458 |         ("\uD743", "\\mathbit{\\Xi}"),
2459 |         ("\uD745", "\\mathbit{\\Pi}"),
2460 |         ("\uD746", "\\mathbit{\\Rho}"),
2461 |         ("\uD747", "\\mathbit{\\varsigma}"),
2462 |         ("\uD748", "\\mathbit{\\Sigma}"),
2463 |         ("\uD749", "\\mathbit{\\Tau}"),
2464 |         ("\uD74A", "\\mathbit{\\Upsilon}"),
2465 |         ("\uD74B", "\\mathbit{\\Phi}"),
2466 |         ("\uD74C", "\\mathbit{\\Chi}"),
2467 |         ("\uD74D", "\\mathbit{\\Psi}"),
2468 |         ("\uD74E", "\\mathbit{\\Omega}"),
2469 |         ("\uD74F", "\\partial "),
2470 |         ("\uD750", "\\in"),
2471 |         ("\uD751", "\\mathbit{\\vartheta}"),
2472 |         ("\uD752", "\\mathbit{\\varkappa}"),
2473 |         ("\uD753", "\\mathbit{\\phi}"),
2474 |         ("\uD754", "\\mathbit{\\varrho}"),
2475 |         ("\uD755", "\\mathbit{\\varpi}"),
2476 |         ("\uD756", "\\mathsfbf{\\Alpha}"),
2477 |         ("\uD757", "\\mathsfbf{\\Beta}"),
2478 |         ("\uD758", "\\mathsfbf{\\Gamma}"),
2479 |         ("\uD759", "\\mathsfbf{\\Delta}"),
2480 |         ("\uD75A", "\\mathsfbf{\\Epsilon}"),
2481 |         ("\uD75B", "\\mathsfbf{\\Zeta}"),
2482 |         ("\uD75C", "\\mathsfbf{\\Eta}"),
2483 |         ("\uD75D", "\\mathsfbf{\\Theta}"),
2484 |         ("\uD75E", "\\mathsfbf{\\Iota}"),
2485 |         ("\uD75F", "\\mathsfbf{\\Kappa}"),
2486 |         ("\uD760", "\\mathsfbf{\\Lambda}"),
2487 |         ("\uD763", "\\mathsfbf{\\Xi}"),
2488 |         ("\uD765", "\\mathsfbf{\\Pi}"),
2489 |         ("\uD766", "\\mathsfbf{\\Rho}"),
2490 |         ("\uD767", "\\mathsfbf{\\vartheta}"),
2491 |         ("\uD768", "\\mathsfbf{\\Sigma}"),
2492 |         ("\uD769", "\\mathsfbf{\\Tau}"),
2493 |         ("\uD76A", "\\mathsfbf{\\Upsilon}"),
2494 |         ("\uD76B", "\\mathsfbf{\\Phi}"),
2495 |         ("\uD76C", "\\mathsfbf{\\Chi}"),
2496 |         ("\uD76D", "\\mathsfbf{\\Psi}"),
2497 |         ("\uD76E", "\\mathsfbf{\\Omega}"),
2498 |         ("\uD76F", "\\mathsfbf{\\nabla}"),
2499 |         ("\uD770", "\\mathsfbf{\\Alpha}"),
2500 |         ("\uD771", "\\mathsfbf{\\Beta}"),
2501 |         ("\uD772", "\\mathsfbf{\\Gamma}"),
2502 |         ("\uD773", "\\mathsfbf{\\Delta}"),
2503 |         ("\uD774", "\\mathsfbf{\\Epsilon}"),
2504 |         ("\uD775", "\\mathsfbf{\\Zeta}"),
2505 |         ("\uD776", "\\mathsfbf{\\Eta}"),
2506 |         ("\uD777", "\\mathsfbf{\\Theta}"),
2507 |         ("\uD778", "\\mathsfbf{\\Iota}"),
2508 |         ("\uD779", "\\mathsfbf{\\Kappa}"),
2509 |         ("\uD77A", "\\mathsfbf{\\Lambda}"),
2510 |         ("\uD77D", "\\mathsfbf{\\Xi}"),
2511 |         ("\uD77F", "\\mathsfbf{\\Pi}"),
2512 |         ("\uD780", "\\mathsfbf{\\Rho}"),
2513 |         ("\uD781", "\\mathsfbf{\\varsigma}"),
2514 |         ("\uD782", "\\mathsfbf{\\Sigma}"),
2515 |         ("\uD783", "\\mathsfbf{\\Tau}"),
2516 |         ("\uD784", "\\mathsfbf{\\Upsilon}"),
2517 |         ("\uD785", "\\mathsfbf{\\Phi}"),
2518 |         ("\uD786", "\\mathsfbf{\\Chi}"),
2519 |         ("\uD787", "\\mathsfbf{\\Psi}"),
2520 |         ("\uD788", "\\mathsfbf{\\Omega}"),
2521 |         ("\uD789", "\\partial "),
2522 |         ("\uD78A", "\\in"),
2523 |         ("\uD78B", "\\mathsfbf{\\vartheta}"),
2524 |         ("\uD78C", "\\mathsfbf{\\varkappa}"),
2525 |         ("\uD78D", "\\mathsfbf{\\phi}"),
2526 |         ("\uD78E", "\\mathsfbf{\\varrho}"),
2527 |         ("\uD78F", "\\mathsfbf{\\varpi}"),
2528 |         ("\uD790", "\\mathsfbfsl{\\Alpha}"),
2529 |         ("\uD791", "\\mathsfbfsl{\\Beta}"),
2530 |         ("\uD792", "\\mathsfbfsl{\\Gamma}"),
2531 |         ("\uD793", "\\mathsfbfsl{\\Delta}"),
2532 |         ("\uD794", "\\mathsfbfsl{\\Epsilon}"),
2533 |         ("\uD795", "\\mathsfbfsl{\\Zeta}"),
2534 |         ("\uD796", "\\mathsfbfsl{\\Eta}"),
2535 |         ("\uD797", "\\mathsfbfsl{\\vartheta}"),
2536 |         ("\uD798", "\\mathsfbfsl{\\Iota}"),
2537 |         ("\uD799", "\\mathsfbfsl{\\Kappa}"),
2538 |         ("\uD79A", "\\mathsfbfsl{\\Lambda}"),
2539 |         ("\uD79D", "\\mathsfbfsl{\\Xi}"),
2540 |         ("\uD79F", "\\mathsfbfsl{\\Pi}"),
2541 |         ("\uD7A0", "\\mathsfbfsl{\\Rho}"),
2542 |         ("\uD7A1", "\\mathsfbfsl{\\vartheta}"),
2543 |         ("\uD7A2", "\\mathsfbfsl{\\Sigma}"),
2544 |         ("\uD7A3", "\\mathsfbfsl{\\Tau}"),
2545 |         ("\uD7A4", "\\mathsfbfsl{\\Upsilon}"),
2546 |         ("\uD7A5", "\\mathsfbfsl{\\Phi}"),
2547 |         ("\uD7A6", "\\mathsfbfsl{\\Chi}"),
2548 |         ("\uD7A7", "\\mathsfbfsl{\\Psi}"),
2549 |         ("\uD7A8", "\\mathsfbfsl{\\Omega}"),
2550 |         ("\uD7A9", "\\mathsfbfsl{\\nabla}"),
2551 |         ("\uD7AA", "\\mathsfbfsl{\\Alpha}"),
2552 |         ("\uD7AB", "\\mathsfbfsl{\\Beta}"),
2553 |         ("\uD7AC", "\\mathsfbfsl{\\Gamma}"),
2554 |         ("\uD7AD", "\\mathsfbfsl{\\Delta}"),
2555 |         ("\uD7AE", "\\mathsfbfsl{\\Epsilon}"),
2556 |         ("\uD7AF", "\\mathsfbfsl{\\Zeta}"),
2557 |         ("\uD7B0", "\\mathsfbfsl{\\Eta}"),
2558 |         ("\uD7B1", "\\mathsfbfsl{\\vartheta}"),
2559 |         ("\uD7B2", "\\mathsfbfsl{\\Iota}"),
2560 |         ("\uD7B3", "\\mathsfbfsl{\\Kappa}"),
2561 |         ("\uD7B4", "\\mathsfbfsl{\\Lambda}"),
2562 |         ("\uD7B7", "\\mathsfbfsl{\\Xi}"),
2563 |         ("\uD7B9", "\\mathsfbfsl{\\Pi}"),
2564 |         ("\uD7BA", "\\mathsfbfsl{\\Rho}"),
2565 |         ("\uD7BB", "\\mathsfbfsl{\\varsigma}"),
2566 |         ("\uD7BC", "\\mathsfbfsl{\\Sigma}"),
2567 |         ("\uD7BD", "\\mathsfbfsl{\\Tau}"),
2568 |         ("\uD7BE", "\\mathsfbfsl{\\Upsilon}"),
2569 |         ("\uD7BF", "\\mathsfbfsl{\\Phi}"),
2570 |         ("\uD7C0", "\\mathsfbfsl{\\Chi}"),
2571 |         ("\uD7C1", "\\mathsfbfsl{\\Psi}"),
2572 |         ("\uD7C2", "\\mathsfbfsl{\\Omega}"),
2573 |         ("\uD7C3", "\\partial "),
2574 |         ("\uD7C4", "\\in"),
2575 |         ("\uD7C5", "\\mathsfbfsl{\\vartheta}"),
2576 |         ("\uD7C6", "\\mathsfbfsl{\\varkappa}"),
2577 |         ("\uD7C7", "\\mathsfbfsl{\\phi}"),
2578 |         ("\uD7C8", "\\mathsfbfsl{\\varrho}"),
2579 |         ("\uD7C9", "\\mathsfbfsl{\\varpi}"),
2580 |         ("\uD7CE", "\\mathbf{0}"),
2581 |         ("\uD7CF", "\\mathbf{1}"),
2582 |         ("\uD7D0", "\\mathbf{2}"),
2583 |         ("\uD7D1", "\\mathbf{3}"),
2584 |         ("\uD7D2", "\\mathbf{4}"),
2585 |         ("\uD7D3", "\\mathbf{5}"),
2586 |         ("\uD7D4", "\\mathbf{6}"),
2587 |         ("\uD7D5", "\\mathbf{7}"),
2588 |         ("\uD7D6", "\\mathbf{8}"),
2589 |         ("\uD7D7", "\\mathbf{9}"),
2590 |         ("\uD7D8", "\\mathbb{0}"),
2591 |         ("\uD7D9", "\\mathbb{1}"),
2592 |         ("\uD7DA", "\\mathbb{2}"),
2593 |         ("\uD7DB", "\\mathbb{3}"),
2594 |         ("\uD7DC", "\\mathbb{4}"),
2595 |         ("\uD7DD", "\\mathbb{5}"),
2596 |         ("\uD7DE", "\\mathbb{6}"),
2597 |         ("\uD7DF", "\\mathbb{7}"),
2598 |         ("\uD7E0", "\\mathbb{8}"),
2599 |         ("\uD7E1", "\\mathbb{9}"),
2600 |         ("\uD7E2", "\\mathsf{0}"),
2601 |         ("\uD7E3", "\\mathsf{1}"),
2602 |         ("\uD7E4", "\\mathsf{2}"),
2603 |         ("\uD7E5", "\\mathsf{3}"),
2604 |         ("\uD7E6", "\\mathsf{4}"),
2605 |         ("\uD7E7", "\\mathsf{5}"),
2606 |         ("\uD7E8", "\\mathsf{6}"),
2607 |         ("\uD7E9", "\\mathsf{7}"),
2608 |         ("\uD7EA", "\\mathsf{8}"),
2609 |         ("\uD7EB", "\\mathsf{9}"),
2610 |         ("\uD7EC", "\\mathsfbf{0}"),
2611 |         ("\uD7ED", "\\mathsfbf{1}"),
2612 |         ("\uD7EE", "\\mathsfbf{2}"),
2613 |         ("\uD7EF", "\\mathsfbf{3}"),
2614 |         ("\uD7F0", "\\mathsfbf{4}"),
2615 |         ("\uD7F1", "\\mathsfbf{5}"),
2616 |         ("\uD7F2", "\\mathsfbf{6}"),
2617 |         ("\uD7F3", "\\mathsfbf{7}"),
2618 |         ("\uD7F4", "\\mathsfbf{8}"),
2619 |         ("\uD7F5", "\\mathsfbf{9}"),
2620 |         ("\uD7F6", "\\mathtt{0}"),
2621 |         ("\uD7F7", "\\mathtt{1}"),
2622 |         ("\uD7F8", "\\mathtt{2}"),
2623 |         ("\uD7F9", "\\mathtt{3}"),
2624 |         ("\uD7FA", "\\mathtt{4}"),
2625 |         ("\uD7FB", "\\mathtt{5}"),
2626 |         ("\uD7FC", "\\mathtt{6}"),
2627 |         ("\uD7FD", "\\mathtt{7}"),
2628 |         ("\uD7FE", "\\mathtt{8}"),
2629 |         ("\uD7FF", "\\mathtt{9}"),
2630 |     )
2631 | 
2632 |     if sys.version_info >= (3, 0):
2633 |         unicode_to_latex = to_latex
2634 |         unicode_to_crappy_latex1 = to_crappy1
2635 |         unicode_to_crappy_latex2 = to_crappy2
2636 |         unicode_to_latex_map = dict(unicode_to_latex)
2637 |     else:
2638 |         unicode_to_latex = tuple((k.decode('unicode-escape'), v) for k, v in to_latex)
2639 |         unicode_to_crappy_latex1 = tuple((k.decode('unicode-escape'), v) for k, v in to_crappy1)
2640 |         unicode_to_crappy_latex2 = tuple((k.decode('unicode-escape'), v) for k, v in to_crappy2)
2641 |         unicode_to_latex_map = dict(unicode_to_latex)
2642 | 
2643 | prepare_unicode_to_latex()
2644 | 


--------------------------------------------------------------------------------
/lib/md2bib.py:
--------------------------------------------------------------------------------
  1 | """
  2 | Functions to extract bibliographic keys from a BibTeX file, using the
  3 | keys used in a Markdown or LaTeX file.
  4 | 
  5 | Modified from md2bib.py [1], which is (c) Copyright 2011-2012 by
  6 | Joseph Reagle and licensed under the GPLv3.
  7 | 
  8 | [1] https://github.com/reagle/pandoc-wrappers/
  9 | 
 10 | """
 11 | 
 12 | from collections import OrderedDict
 13 | import logging
 14 | import re
 15 | 
 16 | 
 17 | BIBKEY_PAT = '([.:;,\-\w]+)'
 18 | 
 19 | 
 20 | def parse_bibtex(text):
 21 |     """Return a dictionary of entry dictionaries, each with a field/value.
 22 |     The parser is simple/fast *and* inflexible, unlike the proper but
 23 |     slow parsers bibstuff and pyparsing-based parsers.
 24 | 
 25 |     """
 26 |     entries = OrderedDict()
 27 |     key_pat = re.compile('@' + BIBKEY_PAT + '\{(.*),')
 28 |     value_pat = re.compile('[\s]*(\w+)[\s]*=[\s]*{(.*)},?')
 29 |     for line in text:
 30 |         key_match = key_pat.match(line)
 31 |         if key_match:
 32 |             entry_type = key_match.group(1)
 33 |             key = key_match.group(2)
 34 |             entries[key] = OrderedDict({'entry_type': entry_type})
 35 |             continue
 36 |         value_match = value_pat.match(line)
 37 |         if value_match:
 38 |             field, value = value_match.groups()
 39 |             entries[key][field] = value
 40 |     return entries
 41 | 
 42 | 
 43 | def emit_entry(identifier, values, outfd):
 44 |     """Emit a single bibtex entry."""
 45 |     outfd.write('@%s{%s,\n' % (values['entry_type'], identifier))
 46 |     for field, value in values.items():
 47 |         if field != 'entry_type':
 48 |             outfd.write('    %s = {%s},\n' % (field, value))
 49 |     outfd.write("}\n\n")
 50 | 
 51 | 
 52 | def emit_bibliography(entries, outfd):
 53 |     """Emit a bibtex file."""
 54 |     for identifier, values in entries.items():
 55 |         emit_entry(identifier, values, outfd)
 56 | 
 57 | 
 58 | def subset_bibliography(entries, keys):
 59 |     """Emit a subset of a bibtex file based on bibtex keys."""
 60 |     subset = OrderedDict()
 61 |     for key in sorted(keys):
 62 |         if key in entries:
 63 |             subset[key] = entries[key]
 64 |         else:
 65 |             logging.critical("%s not in entries" % key)
 66 |             pass
 67 |     return subset
 68 | 
 69 | 
 70 | def get_keys_from_document(filename):
 71 |     """Return a list of keys used in filename by looking for citations
 72 |     like `@citekey`.
 73 | 
 74 |     Also look for citations in the
 75 |     `\cite*{key}` style, where `*` can be any character or none.
 76 | 
 77 |     """
 78 |     k_md = '\[@' + BIBKEY_PAT + '\]|(? Package Settings -> CiteBibtex -> Settings - User`.
5 | 
6 | See `Preferences -> Package Settings -> CiteBibtex -> Settings - Default` for available options.
7 | 


--------------------------------------------------------------------------------