docvortex 0.2.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- docvortex/__init__.py +21 -0
- docvortex/analyzers/__init__.py +3 -0
- docvortex/analyzers/native/__init__.py +37 -0
- docvortex/analyzers/native/_shared/__init__.py +3 -0
- docvortex/analyzers/native/_shared/hyperlink.py +16 -0
- docvortex/analyzers/native/_shared/image.py +8 -0
- docvortex/analyzers/native/_shared/markup/__init__.py +47 -0
- docvortex/analyzers/native/_shared/markup/anchors.py +30 -0
- docvortex/analyzers/native/_shared/markup/formula.py +37 -0
- docvortex/analyzers/native/_shared/markup/projector.py +57 -0
- docvortex/analyzers/native/_shared/markup/styles.py +19 -0
- docvortex/analyzers/native/_shared/mathml.py +17 -0
- docvortex/analyzers/native/_shared/names.py +7 -0
- docvortex/analyzers/native/_shared/xycut.py +414 -0
- docvortex/analyzers/native/contracts.py +44 -0
- docvortex/analyzers/native/csv.py +351 -0
- docvortex/analyzers/native/epub/__init__.py +18 -0
- docvortex/analyzers/native/epub/constants.py +45 -0
- docvortex/analyzers/native/epub/converter.py +80 -0
- docvortex/analyzers/native/epub/errors.py +20 -0
- docvortex/analyzers/native/epub/metadata.py +31 -0
- docvortex/analyzers/native/epub/package.py +649 -0
- docvortex/analyzers/native/epub/xhtml.py +306 -0
- docvortex/analyzers/native/html/__init__.py +6 -0
- docvortex/analyzers/native/html/anchors.py +271 -0
- docvortex/analyzers/native/html/constants.py +25 -0
- docvortex/analyzers/native/html/contracts.py +7 -0
- docvortex/analyzers/native/html/converter.py +117 -0
- docvortex/analyzers/native/html/document.py +389 -0
- docvortex/analyzers/native/html/errors.py +12 -0
- docvortex/analyzers/native/html/resources.py +365 -0
- docvortex/analyzers/native/html/selector.py +421 -0
- docvortex/analyzers/native/models.py +209 -0
- docvortex/analyzers/native/ofd/__init__.py +14 -0
- docvortex/analyzers/native/ofd/constants.py +59 -0
- docvortex/analyzers/native/ofd/converter.py +31 -0
- docvortex/analyzers/native/ofd/errors.py +16 -0
- docvortex/analyzers/native/ofd/geometry.py +215 -0
- docvortex/analyzers/native/ofd/images.py +124 -0
- docvortex/analyzers/native/ofd/metadata.py +53 -0
- docvortex/analyzers/native/ofd/models.py +170 -0
- docvortex/analyzers/native/ofd/package.py +346 -0
- docvortex/analyzers/native/ofd/path.py +201 -0
- docvortex/analyzers/native/ofd/reading_order.py +293 -0
- docvortex/analyzers/native/ofd/resources.py +122 -0
- docvortex/analyzers/native/ofd/scene.py +347 -0
- docvortex/analyzers/native/ofd/table.py +240 -0
- docvortex/analyzers/native/ofd/text.py +521 -0
- docvortex/analyzers/native/office/__init__.py +3 -0
- docvortex/analyzers/native/office/doc/__init__.py +3 -0
- docvortex/analyzers/native/office/doc/bookmarks.py +81 -0
- docvortex/analyzers/native/office/doc/doc_converter.py +573 -0
- docvortex/analyzers/native/office/doc/fib.py +261 -0
- docvortex/analyzers/native/office/doc/fields.py +101 -0
- docvortex/analyzers/native/office/doc/formatting.py +171 -0
- docvortex/analyzers/native/office/doc/images.py +162 -0
- docvortex/analyzers/native/office/doc/lists.py +356 -0
- docvortex/analyzers/native/office/doc/models.py +164 -0
- docvortex/analyzers/native/office/doc/parser.py +851 -0
- docvortex/analyzers/native/office/doc/pieces.py +256 -0
- docvortex/analyzers/native/office/doc/records.py +40 -0
- docvortex/analyzers/native/office/doc/sprm.py +269 -0
- docvortex/analyzers/native/office/doc/styles.py +215 -0
- docvortex/analyzers/native/office/docx/__init__.py +3 -0
- docvortex/analyzers/native/office/docx/context.py +71 -0
- docvortex/analyzers/native/office/docx/docx_converter.py +614 -0
- docvortex/analyzers/native/office/docx/equationxml.py +119 -0
- docvortex/analyzers/native/office/docx/fields.py +816 -0
- docvortex/analyzers/native/office/docx/formatting_types.py +23 -0
- docvortex/analyzers/native/office/docx/main.py +50 -0
- docvortex/analyzers/native/office/docx/numbering.py +491 -0
- docvortex/analyzers/native/office/docx/office_xml.py +57 -0
- docvortex/analyzers/native/office/docx/package_normalizer.py +248 -0
- docvortex/analyzers/native/office/docx/resources.py +526 -0
- docvortex/analyzers/native/office/docx/styles.py +693 -0
- docvortex/analyzers/native/office/docx/tables.py +515 -0
- docvortex/analyzers/native/office/equation/__init__.py +3 -0
- docvortex/analyzers/native/office/equation/image.py +470 -0
- docvortex/analyzers/native/office/equation/latex_dict.py +324 -0
- docvortex/analyzers/native/office/equation/mtef.py +885 -0
- docvortex/analyzers/native/office/equation/mtef_v5.py +941 -0
- docvortex/analyzers/native/office/equation/omml.py +561 -0
- docvortex/analyzers/native/office/equation/ooxml.py +62 -0
- docvortex/analyzers/native/office/errors.py +33 -0
- docvortex/analyzers/native/office/image.py +307 -0
- docvortex/analyzers/native/office/legacy/__init__.py +3 -0
- docvortex/analyzers/native/office/legacy/binary.py +43 -0
- docvortex/analyzers/native/office/legacy/officeart.py +362 -0
- docvortex/analyzers/native/office/legacy/ole.py +110 -0
- docvortex/analyzers/native/office/limits.py +12 -0
- docvortex/analyzers/native/office/odf/__init__.py +3 -0
- docvortex/analyzers/native/office/odf/chart.py +76 -0
- docvortex/analyzers/native/office/odf/constants.py +70 -0
- docvortex/analyzers/native/office/odf/converters.py +403 -0
- docvortex/analyzers/native/office/odf/errors.py +18 -0
- docvortex/analyzers/native/office/odf/metadata.py +91 -0
- docvortex/analyzers/native/office/odf/models.py +176 -0
- docvortex/analyzers/native/office/odf/package.py +270 -0
- docvortex/analyzers/native/office/odf/styles.py +329 -0
- docvortex/analyzers/native/office/odf/table.py +469 -0
- docvortex/analyzers/native/office/odf/text.py +1002 -0
- docvortex/analyzers/native/office/ooxml_chart.py +1016 -0
- docvortex/analyzers/native/office/opc.py +38 -0
- docvortex/analyzers/native/office/ppt/__init__.py +3 -0
- docvortex/analyzers/native/office/ppt/models.py +118 -0
- docvortex/analyzers/native/office/ppt/parser.py +1895 -0
- docvortex/analyzers/native/office/ppt/ppt_converter.py +292 -0
- docvortex/analyzers/native/office/ppt/records.py +131 -0
- docvortex/analyzers/native/office/ppt/style_text.py +247 -0
- docvortex/analyzers/native/office/pptx/__init__.py +3 -0
- docvortex/analyzers/native/office/pptx/context.py +113 -0
- docvortex/analyzers/native/office/pptx/lists.py +558 -0
- docvortex/analyzers/native/office/pptx/main.py +20 -0
- docvortex/analyzers/native/office/pptx/package_normalizer.py +321 -0
- docvortex/analyzers/native/office/pptx/pptx_converter.py +323 -0
- docvortex/analyzers/native/office/pptx/resources.py +329 -0
- docvortex/analyzers/native/office/pptx/shapes.py +393 -0
- docvortex/analyzers/native/office/pptx/text_styles.py +625 -0
- docvortex/analyzers/native/office/pptx/titles.py +178 -0
- docvortex/analyzers/native/office/rich_text.py +420 -0
- docvortex/analyzers/native/office/rtf/__init__.py +3 -0
- docvortex/analyzers/native/office/rtf/converter.py +708 -0
- docvortex/analyzers/native/office/rtf/lexer.py +213 -0
- docvortex/analyzers/native/office/rtf/math.py +339 -0
- docvortex/analyzers/native/office/rtf/models.py +185 -0
- docvortex/analyzers/native/office/rtf/parser.py +1553 -0
- docvortex/analyzers/native/office/spreadsheet/__init__.py +3 -0
- docvortex/analyzers/native/office/spreadsheet/html.py +81 -0
- docvortex/analyzers/native/office/spreadsheet/models.py +79 -0
- docvortex/analyzers/native/office/spreadsheet/projector.py +928 -0
- docvortex/analyzers/native/office/streams.py +18 -0
- docvortex/analyzers/native/office/xls/__init__.py +3 -0
- docvortex/analyzers/native/office/xls/chart.py +132 -0
- docvortex/analyzers/native/office/xls/embedded_chart.py +299 -0
- docvortex/analyzers/native/office/xls/models.py +109 -0
- docvortex/analyzers/native/office/xls/number_format.py +521 -0
- docvortex/analyzers/native/office/xls/parser.py +1145 -0
- docvortex/analyzers/native/office/xls/records.py +201 -0
- docvortex/analyzers/native/office/xls/strings.py +205 -0
- docvortex/analyzers/native/office/xls/xls_converter.py +354 -0
- docvortex/analyzers/native/office/xlsx/__init__.py +3 -0
- docvortex/analyzers/native/office/xlsx/main.py +20 -0
- docvortex/analyzers/native/office/xlsx/ooxml_ole.py +522 -0
- docvortex/analyzers/native/office/xlsx/package_normalizer.py +310 -0
- docvortex/analyzers/native/office/xlsx/xlsx_converter.py +716 -0
- docvortex/analyzers/native/pdf/__init__.py +3 -0
- docvortex/analyzers/native/pdf/auxiliary_text.py +1671 -0
- docvortex/analyzers/native/pdf/char_geometry.py +1662 -0
- docvortex/analyzers/native/pdf/code_blocks.py +535 -0
- docvortex/analyzers/native/pdf/formulas.py +1985 -0
- docvortex/analyzers/native/pdf/geometry.py +281 -0
- docvortex/analyzers/native/pdf/graphics.py +1501 -0
- docvortex/analyzers/native/pdf/index_blocks.py +268 -0
- docvortex/analyzers/native/pdf/inline/__init__.py +3 -0
- docvortex/analyzers/native/pdf/inline/common.py +112 -0
- docvortex/analyzers/native/pdf/inline/detection.py +590 -0
- docvortex/analyzers/native/pdf/inline/matching.py +1185 -0
- docvortex/analyzers/native/pdf/inline/materialize.py +457 -0
- docvortex/analyzers/native/pdf/inline/scripts.py +975 -0
- docvortex/analyzers/native/pdf/inline/types.py +385 -0
- docvortex/analyzers/native/pdf/line_layout.py +1106 -0
- docvortex/analyzers/native/pdf/line_merging.py +1223 -0
- docvortex/analyzers/native/pdf/models.py +246 -0
- docvortex/analyzers/native/pdf/native_text.py +1004 -0
- docvortex/analyzers/native/pdf/pipeline.py +1390 -0
- docvortex/analyzers/native/pdf/script_geometry.py +636 -0
- docvortex/analyzers/native/pdf/shared.py +30 -0
- docvortex/analyzers/native/pdf/spatial_text.py +383 -0
- docvortex/analyzers/native/pdf/table_annotations.py +446 -0
- docvortex/analyzers/native/pdf/table_constants.py +48 -0
- docvortex/analyzers/native/pdf/table_detection.py +227 -0
- docvortex/analyzers/native/pdf/table_filled_grid.py +218 -0
- docvortex/analyzers/native/pdf/table_geometry.py +40 -0
- docvortex/analyzers/native/pdf/table_materialization.py +444 -0
- docvortex/analyzers/native/pdf/table_recovery/__init__.py +15 -0
- docvortex/analyzers/native/pdf/table_recovery/candidate.py +356 -0
- docvortex/analyzers/native/pdf/table_recovery/contracts.py +154 -0
- docvortex/analyzers/native/pdf/table_recovery/engine.py +609 -0
- docvortex/analyzers/native/pdf/table_recovery/geometry.py +164 -0
- docvortex/analyzers/native/pdf/table_recovery/sparse_common.py +85 -0
- docvortex/analyzers/native/pdf/table_recovery/sparse_hybrid.py +804 -0
- docvortex/analyzers/native/pdf/table_recovery/sparse_multiline.py +1122 -0
- docvortex/analyzers/native/pdf/table_recovery/text.py +414 -0
- docvortex/analyzers/native/pdf/table_recovery/text_grid.py +618 -0
- docvortex/analyzers/native/pdf/table_recovery/vector.py +1931 -0
- docvortex/analyzers/native/pdf/table_rows.py +34 -0
- docvortex/analyzers/native/pdf/table_rules.py +1129 -0
- docvortex/analyzers/native/pdf/table_text_styles.py +283 -0
- docvortex/analyzers/native/pdf/tables.py +147 -0
- docvortex/analyzers/native/pdf/text_assembly/__init__.py +3 -0
- docvortex/analyzers/native/pdf/text_assembly/annotations.py +581 -0
- docvortex/analyzers/native/pdf/text_assembly/assembly.py +292 -0
- docvortex/analyzers/native/pdf/text_assembly/common.py +477 -0
- docvortex/analyzers/native/pdf/text_assembly/footnotes.py +394 -0
- docvortex/analyzers/native/pdf/text_assembly/merging.py +1274 -0
- docvortex/analyzers/native/pdf/text_assembly/rows.py +692 -0
- docvortex/analyzers/native/pdf/text_blocks.py +82 -0
- docvortex/analyzers/native/pdf/text_styles.py +55 -0
- docvortex/analyzers/native/pdf/title_analysis/__init__.py +3 -0
- docvortex/analyzers/native/pdf/title_analysis/body_profile.py +215 -0
- docvortex/analyzers/native/pdf/title_analysis/common.py +117 -0
- docvortex/analyzers/native/pdf/title_analysis/document_profile.py +164 -0
- docvortex/analyzers/native/pdf/title_analysis/lane_titles.py +758 -0
- docvortex/analyzers/native/pdf/title_analysis/page_titles.py +1024 -0
- docvortex/analyzers/native/pdf/title_analysis/prototype.py +194 -0
- docvortex/analyzers/native/pdf/title_analysis/structural.py +1081 -0
- docvortex/analyzers/native/pdf/titles.py +75 -0
- docvortex/analyzers/native/pdf/typography.py +19 -0
- docvortex/analyzers/native/pdf/visual_annotations.py +1262 -0
- docvortex/api.py +180 -0
- docvortex/assets/__init__.py +5 -0
- docvortex/assets/store.py +51 -0
- docvortex/cli.py +54 -0
- docvortex/codecs/__init__.py +3 -0
- docvortex/codecs/html/__init__.py +22 -0
- docvortex/codecs/html/contracts.py +236 -0
- docvortex/codecs/html/materializer.py +331 -0
- docvortex/codecs/html/parser.py +763 -0
- docvortex/codecs/html/resources.py +34 -0
- docvortex/codecs/json.py +17 -0
- docvortex/content/__init__.py +5 -0
- docvortex/content/inline.py +248 -0
- docvortex/content/markup/__init__.py +44 -0
- docvortex/content/markup/anchors.py +188 -0
- docvortex/content/markup/formula.py +280 -0
- docvortex/content/markup/projector.py +1237 -0
- docvortex/content/markup/styles.py +327 -0
- docvortex/content/mathml.py +167 -0
- docvortex/content/normalization.py +188 -0
- docvortex/content/spans.py +183 -0
- docvortex/content/table/__init__.py +18 -0
- docvortex/content/table/blocks.py +152 -0
- docvortex/content/table/content.py +425 -0
- docvortex/content/table/document.py +104 -0
- docvortex/content/table/html.py +399 -0
- docvortex/content/table/models.py +76 -0
- docvortex/content/table/rules.py +42 -0
- docvortex/content/table/structure.py +221 -0
- docvortex/content/tree.py +5 -0
- docvortex/document/__init__.py +3 -0
- docvortex/document/contracts.py +22 -0
- docvortex/document/detection.py +389 -0
- docvortex/document/filetypes.py +175 -0
- docvortex/document/page_range.py +167 -0
- docvortex/document/pdf/__init__.py +19 -0
- docvortex/document/pdf/classify.py +1138 -0
- docvortex/document/pdf/constants.py +132 -0
- docvortex/document/pdf/diagnostics.py +350 -0
- docvortex/document/pdf/document.py +582 -0
- docvortex/document/pdf/font_runtime.py +335 -0
- docvortex/document/pdf/geometry.py +31 -0
- docvortex/document/pdf/images.py +654 -0
- docvortex/document/pdf/native_annotations.py +367 -0
- docvortex/document/pdf/native_contracts.py +169 -0
- docvortex/document/pdf/native_coordinates.py +216 -0
- docvortex/document/pdf/native_lifecycle.py +16 -0
- docvortex/document/pdf/native_objects.py +902 -0
- docvortex/document/pdf/native_text_geometry.py +315 -0
- docvortex/document/pdf/pdfium.py +325 -0
- docvortex/document/pdf/raster.py +46 -0
- docvortex/document/pdf/text/__init__.py +62 -0
- docvortex/document/pdf/text/contracts.py +211 -0
- docvortex/document/pdf/text/extract.py +165 -0
- docvortex/document/pdf/text/geometry.py +16 -0
- docvortex/document/pdf/text/groups.py +162 -0
- docvortex/document/pdf/visual_geometry.py +201 -0
- docvortex/document/pdf/visuals.py +343 -0
- docvortex/document/source.py +92 -0
- docvortex/errors.py +21 -0
- docvortex/export/__init__.py +3 -0
- docvortex/export/bundle.py +98 -0
- docvortex/export/files.py +66 -0
- docvortex/export/middle.py +208 -0
- docvortex/foundation/__init__.py +3 -0
- docvortex/foundation/geometry.py +125 -0
- docvortex/foundation/hyperlink.py +65 -0
- docvortex/foundation/image.py +48 -0
- docvortex/foundation/image_encoding.py +30 -0
- docvortex/foundation/image_payload.py +280 -0
- docvortex/foundation/language.py +92 -0
- docvortex/foundation/platform.py +38 -0
- docvortex/foundation/text.py +153 -0
- docvortex/foundation/type_identity.py +20 -0
- docvortex/foundation/xml_names.py +20 -0
- docvortex/options.py +30 -0
- docvortex/postprocess/__init__.py +3 -0
- docvortex/postprocess/content.py +53 -0
- docvortex/postprocess/document.py +19 -0
- docvortex/postprocess/lists.py +236 -0
- docvortex/postprocess/page_blocks.py +214 -0
- docvortex/postprocess/pages.py +95 -0
- docvortex/postprocess/paragraphs.py +580 -0
- docvortex/postprocess/visual.py +715 -0
- docvortex/render/__init__.py +48 -0
- docvortex/render/_internal/__init__.py +3 -0
- docvortex/render/_internal/common/__init__.py +3 -0
- docvortex/render/_internal/common/context.py +43 -0
- docvortex/render/_internal/common/html_table.py +178 -0
- docvortex/render/_internal/common/index.py +33 -0
- docvortex/render/_internal/common/list_items.py +158 -0
- docvortex/render/_internal/common/planner.py +140 -0
- docvortex/render/_internal/docx/__init__.py +3 -0
- docvortex/render/_internal/docx/assets.py +202 -0
- docvortex/render/_internal/docx/inline.py +434 -0
- docvortex/render/_internal/docx/math.py +220 -0
- docvortex/render/_internal/docx/renderer.py +905 -0
- docvortex/render/_internal/docx/styles.py +195 -0
- docvortex/render/_internal/docx/table.py +442 -0
- docvortex/render/_internal/epub/__init__.py +5 -0
- docvortex/render/_internal/epub/assets.py +173 -0
- docvortex/render/_internal/epub/package.py +249 -0
- docvortex/render/_internal/epub/renderer.py +1156 -0
- docvortex/render/_internal/html/__init__.py +3 -0
- docvortex/render/_internal/html/inline.py +346 -0
- docvortex/render/_internal/html/renderer.py +1041 -0
- docvortex/render/_internal/html/sanitizer.py +478 -0
- docvortex/render/_internal/html/table.py +121 -0
- docvortex/render/_internal/latex/__init__.py +1 -0
- docvortex/render/_internal/latex/assets.py +85 -0
- docvortex/render/_internal/latex/inline.py +145 -0
- docvortex/render/_internal/latex/renderer.py +506 -0
- docvortex/render/_internal/latex/table.py +347 -0
- docvortex/render/_internal/markdown/__init__.py +3 -0
- docvortex/render/_internal/markdown/assets.py +78 -0
- docvortex/render/_internal/markdown/blocks.py +635 -0
- docvortex/render/_internal/markdown/escaping.py +51 -0
- docvortex/render/_internal/markdown/inline.py +260 -0
- docvortex/render/_internal/markdown/renderer.py +93 -0
- docvortex/render/_internal/markdown/table.py +281 -0
- docvortex/render/_internal/pdf/__init__.py +3 -0
- docvortex/render/_internal/pdf/assets.py +197 -0
- docvortex/render/_internal/pdf/formula.py +417 -0
- docvortex/render/_internal/pdf/inline.py +343 -0
- docvortex/render/_internal/pdf/renderer.py +734 -0
- docvortex/render/_internal/pdf/styles.py +206 -0
- docvortex/render/_internal/pdf/table.py +272 -0
- docvortex/render/_internal/structured_content/__init__.py +3 -0
- docvortex/render/_internal/structured_content/renderer.py +193 -0
- docvortex/render/api.py +199 -0
- docvortex/render/contracts.py +205 -0
- docvortex/render/docx.py +38 -0
- docvortex/render/epub.py +35 -0
- docvortex/render/fragments.py +70 -0
- docvortex/render/html.py +29 -0
- docvortex/render/latex.py +24 -0
- docvortex/render/markdown.py +50 -0
- docvortex/render/pdf.py +25 -0
- docvortex/render/structured_content.py +23 -0
- docvortex/resources/epub/docvortex.css +91 -0
- docvortex/resources/fasttext-langdetect/lid.176.ftz +0 -0
- docvortex/resources/fonts/DroidSansFallbackFull.ttf +0 -0
- docvortex/resources/fonts/NOTICE +190 -0
- docvortex/resources/fonts/manifest.json +9 -0
- docvortex/resources/html/docvortex.css +601 -0
- docvortex/resources/html/docvortex.min.css +1 -0
- docvortex/result.py +91 -0
- docvortex/schema.py +1141 -0
- docvortex/version.py +3 -0
- docvortex-0.2.1.dist-info/METADATA +193 -0
- docvortex-0.2.1.dist-info/RECORD +364 -0
- docvortex-0.2.1.dist-info/WHEEL +5 -0
- docvortex-0.2.1.dist-info/entry_points.txt +2 -0
- docvortex-0.2.1.dist-info/licenses/LICENSE.md +21 -0
- docvortex-0.2.1.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,324 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Adapted from https://github.com/xiilei/dwml/blob/master/dwml/latex_dict.py
|
|
3
|
+
On 23/01/2025
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
CHARS = ("{", "}", "_", "^", "#", "&", "$", "%")
|
|
7
|
+
|
|
8
|
+
BLANK = ""
|
|
9
|
+
BACKSLASH = "\\"
|
|
10
|
+
ALN = "&"
|
|
11
|
+
|
|
12
|
+
CHR = {
|
|
13
|
+
# Unicode : Latex Math Symbols
|
|
14
|
+
# Top accents
|
|
15
|
+
"\u0300": "\\grave{{{0}}}",
|
|
16
|
+
"\u0301": "\\acute{{{0}}}",
|
|
17
|
+
"\u0302": "\\hat{{{0}}}",
|
|
18
|
+
"\u0303": "\\tilde{{{0}}}",
|
|
19
|
+
"\u0304": "\\bar{{{0}}}",
|
|
20
|
+
"\u0305": "\\overbar{{{0}}}",
|
|
21
|
+
"\u0306": "\\breve{{{0}}}",
|
|
22
|
+
"\u0307": "\\dot{{{0}}}",
|
|
23
|
+
"\u0308": "\\ddot{{{0}}}",
|
|
24
|
+
"\u0309": "\\ovhook{{{0}}}",
|
|
25
|
+
"\u030a": "\\ocirc{{{0}}}",
|
|
26
|
+
"\u030c": "\\check{{{0}}}",
|
|
27
|
+
"\u0310": "\\candra{{{0}}}",
|
|
28
|
+
"\u0312": "\\oturnedcomma{{{0}}}",
|
|
29
|
+
"\u0315": "\\ocommatopright{{{0}}}",
|
|
30
|
+
"\u031a": "\\droang{{{0}}}",
|
|
31
|
+
"\u0338": "\\not{{{0}}}",
|
|
32
|
+
"\u20d0": "\\leftharpoonaccent{{{0}}}",
|
|
33
|
+
"\u20d1": "\\rightharpoonaccent{{{0}}}",
|
|
34
|
+
"\u20d2": "\\vertoverlay{{{0}}}",
|
|
35
|
+
"\u20d6": "\\overleftarrow{{{0}}}",
|
|
36
|
+
"\u20d7": "\\vec{{{0}}}",
|
|
37
|
+
"\u20db": "\\dddot{{{0}}}",
|
|
38
|
+
"\u20dc": "\\ddddot{{{0}}}",
|
|
39
|
+
"\u20e1": "\\overleftrightarrow{{{0}}}",
|
|
40
|
+
"\u20e7": "\\annuity{{{0}}}",
|
|
41
|
+
"\u20e9": "\\widebridgeabove{{{0}}}",
|
|
42
|
+
"\u20f0": "\\asteraccent{{{0}}}",
|
|
43
|
+
# Bottom accents
|
|
44
|
+
"\u0330": "\\wideutilde{{{0}}}",
|
|
45
|
+
"\u0331": "\\underbar{{{0}}}",
|
|
46
|
+
"\u20e8": "\\threeunderdot{{{0}}}",
|
|
47
|
+
"\u20ec": "\\underrightharpoondown{{{0}}}",
|
|
48
|
+
"\u20ed": "\\underleftharpoondown{{{0}}}",
|
|
49
|
+
"\u20ee": "\\underleftarrow{{{0}}}",
|
|
50
|
+
"\u20ef": "\\underrightarrow{{{0}}}",
|
|
51
|
+
# Over | group
|
|
52
|
+
"\u23b4": "\\overbracket{{{0}}}",
|
|
53
|
+
"\u23dc": "\\overparen{{{0}}}",
|
|
54
|
+
"\u23de": "\\overbrace{{{0}}}",
|
|
55
|
+
# Under| group
|
|
56
|
+
"\u23b5": "\\underbracket{{{0}}}",
|
|
57
|
+
"\u23dd": "\\underparen{{{0}}}",
|
|
58
|
+
"\u23df": "\\underbrace{{{0}}}",
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
CHR_BO = {
|
|
62
|
+
# Big operators,
|
|
63
|
+
"\u2140": "\\Bbbsum",
|
|
64
|
+
"\u220f": "\\prod",
|
|
65
|
+
"\u2210": "\\coprod",
|
|
66
|
+
"\u2211": "\\sum",
|
|
67
|
+
"\u222b": "\\int",
|
|
68
|
+
"\u222c": "\\iint",
|
|
69
|
+
"\u222d": "\\iiint",
|
|
70
|
+
"\u222e": "\\oint",
|
|
71
|
+
"\u222f": "\\oiint",
|
|
72
|
+
"\u2230": "\\oiiint",
|
|
73
|
+
"\u22c0": "\\bigwedge",
|
|
74
|
+
"\u22c1": "\\bigvee",
|
|
75
|
+
"\u22c2": "\\bigcap",
|
|
76
|
+
"\u22c3": "\\bigcup",
|
|
77
|
+
"\u2a00": "\\bigodot",
|
|
78
|
+
"\u2a01": "\\bigoplus",
|
|
79
|
+
"\u2a02": "\\bigotimes",
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
T = {
|
|
83
|
+
# Whitespace characters
|
|
84
|
+
" ": " ", # NON-BREAKING SPACE (U+00A0) — pylatexenc maps this to "~" (text-mode),
|
|
85
|
+
# which escape_latex would mangle to "\~" (invalid in math mode);
|
|
86
|
+
# use a plain space instead.
|
|
87
|
+
# Greek letters
|
|
88
|
+
"\U0001d6fc": "\\alpha ",
|
|
89
|
+
"\U0001d6fd": "\\beta ",
|
|
90
|
+
"\U0001d6fe": "\\gamma ",
|
|
91
|
+
"\U0001d6ff": "\\delta ",
|
|
92
|
+
"\U0001d700": "\\epsilon ",
|
|
93
|
+
"\U0001d701": "\\zeta ",
|
|
94
|
+
"\U0001d702": "\\eta ",
|
|
95
|
+
"\U0001d703": "\\theta ",
|
|
96
|
+
"\U0001d704": "\\iota ",
|
|
97
|
+
"\U0001d705": "\\kappa ",
|
|
98
|
+
"\U0001d706": "\\lambda ",
|
|
99
|
+
"\U0001d707": "\\mu ",
|
|
100
|
+
"\U0001d708": "\\nu ",
|
|
101
|
+
"\U0001d709": "\\xi ",
|
|
102
|
+
"\U0001d70a": "\\omicron ",
|
|
103
|
+
"\U0001d70b": "\\pi ",
|
|
104
|
+
"\U0001d70c": "\\rho ",
|
|
105
|
+
"\U0001d70d": "\\varsigma ",
|
|
106
|
+
"\U0001d70e": "\\sigma ",
|
|
107
|
+
"\U0001d70f": "\\tau ",
|
|
108
|
+
"\U0001d710": "\\upsilon ",
|
|
109
|
+
"\U0001d711": "\\phi ",
|
|
110
|
+
"\U0001d712": "\\chi ",
|
|
111
|
+
"\U0001d713": "\\psi ",
|
|
112
|
+
"\U0001d714": "\\omega ",
|
|
113
|
+
"\U0001d715": "\\partial ",
|
|
114
|
+
"\U0001d716": "\\varepsilon ",
|
|
115
|
+
"\U0001d717": "\\vartheta ",
|
|
116
|
+
"\U0001d718": "\\varkappa ",
|
|
117
|
+
"\U0001d719": "\\varphi ",
|
|
118
|
+
"\U0001d71a": "\\varrho ",
|
|
119
|
+
"\U0001d71b": "\\varpi ",
|
|
120
|
+
# Relation symbols
|
|
121
|
+
"\u2190": "\\leftarrow ",
|
|
122
|
+
"\u2191": "\\uparrow ",
|
|
123
|
+
"\u2192": "\\rightarrow ",
|
|
124
|
+
"\u2193": "\\downarrow ",
|
|
125
|
+
"\u2194": "\\leftrightarrow ",
|
|
126
|
+
"\u2195": "\\updownarrow ",
|
|
127
|
+
"\u2196": "\\nwarrow ",
|
|
128
|
+
"\u2197": "\\nearrow ",
|
|
129
|
+
"\u2198": "\\searrow ",
|
|
130
|
+
"\u2199": "\\swarrow ",
|
|
131
|
+
"\u2026": "\\ldots ", # HORIZONTAL ELLIPSIS (…) — pylatexenc maps this to \textellipsis (text-mode), override to \ldots (math-mode)
|
|
132
|
+
"\u22ee": "\\vdots ",
|
|
133
|
+
"\u22ef": "\\cdots ",
|
|
134
|
+
"\u22f0": "\\adots ",
|
|
135
|
+
"\u22f1": "\\ddots ",
|
|
136
|
+
"\u2260": "\\ne ",
|
|
137
|
+
"\u2264": "\\leq ",
|
|
138
|
+
"\u2265": "\\geq ",
|
|
139
|
+
"\u2266": "\\leqq ",
|
|
140
|
+
"\u2267": "\\geqq ",
|
|
141
|
+
"\u2268": "\\lneqq ",
|
|
142
|
+
"\u2269": "\\gneqq ",
|
|
143
|
+
"\u226a": "\\ll ",
|
|
144
|
+
"\u226b": "\\gg ",
|
|
145
|
+
"\u2208": "\\in ",
|
|
146
|
+
"\u2209": "\\notin ",
|
|
147
|
+
"\u220b": "\\ni ",
|
|
148
|
+
"\u220c": "\\nni ",
|
|
149
|
+
# Ordinary symbols
|
|
150
|
+
"\u221e": "\\infty ",
|
|
151
|
+
# Binary relations
|
|
152
|
+
"\u00b1": "\\pm ",
|
|
153
|
+
"\u2213": "\\mp ",
|
|
154
|
+
# Characters whose pylatexenc text-mode mappings are invalid in math environments
|
|
155
|
+
"\u00f0": "\\eth ", # ð LATIN SMALL LETTER ETH — pylatexenc: \dh (tipa, not in KaTeX/MathJax)
|
|
156
|
+
"\u0131": "\\imath ", # ı LATIN SMALL LETTER DOTLESS I — pylatexenc: \i (text-mode only)
|
|
157
|
+
"\u2127": "\\mho ", # ℧ INVERTED OHM SIGN — pylatexenc: \textmho (textcomp, not in KaTeX/MathJax)
|
|
158
|
+
"\u212e": "e", # ℮ ESTIMATED SIGN — pylatexenc: \textestimated (no math equivalent; use 'e')
|
|
159
|
+
"\u00c5": "\\mathring{A} ", # Å LATIN CAPITAL LETTER A WITH RING — pylatexenc: \r{A} (text-mode only)
|
|
160
|
+
"\u2103": "\\text{°C}", # ℃ DEGREE CELSIUS — pylatexenc: \textcelsius (textcomp, not in KaTeX/MathJax)
|
|
161
|
+
# Multiplication/division operators (text-mode pylatexenc mappings overridden to math-mode)
|
|
162
|
+
"\u00b7": "\\cdot ", # MIDDLE DOT (·) — common in Chinese scientific notation
|
|
163
|
+
"\u22c5": "\\cdot ", # DOT OPERATOR (⋅)
|
|
164
|
+
"\u2219": "\\bullet ", # BULLET OPERATOR (∙)
|
|
165
|
+
"\u00d7": "\\times ", # MULTIPLICATION SIGN (×)
|
|
166
|
+
"\u00f7": "\\div ", # DIVISION SIGN (÷)
|
|
167
|
+
"\u2212": "-", # MINUS SIGN (−)
|
|
168
|
+
"\u2010": "-", # HYPHEN
|
|
169
|
+
"\u2011": "-", # NON-BREAKING HYPHEN
|
|
170
|
+
"\u2012": "-", # FIGURE DASH
|
|
171
|
+
"\u2013": "-", # EN DASH
|
|
172
|
+
"\u2014": "-", # EM DASH
|
|
173
|
+
"\u2015": "-", # HORIZONTAL BAR
|
|
174
|
+
# Degree / prime — avoid ^{} syntax since escape_latex will mangle bare ^ and braces
|
|
175
|
+
"\u00b0": "\\circ ", # DEGREE SIGN (°) — caller's context (e.g. 90°) provides the ^
|
|
176
|
+
"\u2032": "'", # PRIME (′)
|
|
177
|
+
"\u2033": "''", # DOUBLE PRIME (″)
|
|
178
|
+
# Superscript digits — avoid \texttwosuperior / \textthreesuperior from pylatexenc
|
|
179
|
+
"\u00b2": "2",
|
|
180
|
+
"\u00b3": "3",
|
|
181
|
+
"\u00b9": "1",
|
|
182
|
+
# Big operators as plain text characters — pylatexenc maps some to non-KaTeX commands
|
|
183
|
+
# (e.g. ∯→\surfintegral, ∰→\volintegral, ∱→\clwintegral) which don't render in KaTeX/MathJax.
|
|
184
|
+
# Override with standard KaTeX-compatible commands; if no KaTeX equivalent exists, keep Unicode.
|
|
185
|
+
"\u222f": "\\oiint ", # ∯ SURFACE INTEGRAL — pylatexenc: \surfintegral (not in KaTeX)
|
|
186
|
+
"\u2230": "\\oiiint ", # ∰ VOLUME INTEGRAL — pylatexenc: \volintegral (not in KaTeX)
|
|
187
|
+
"\u2231": "\u2231", # ∱ CLOCKWISE INTEGRAL — pylatexenc: \clwintegral (not in KaTeX); keep Unicode
|
|
188
|
+
"\u2232": "\u2232", # ∲ CLOCKWISE CONTOUR INTEGRAL — no KaTeX equivalent; keep Unicode
|
|
189
|
+
"\u2233": "\u2233", # ∳ ANTICLOCKWISE CONTOUR INTEGRAL — no KaTeX equivalent; keep Unicode
|
|
190
|
+
# N-ary operators: ⨀⨁⨂ have KaTeX commands; ⨃⨄ do not — keep Unicode for those
|
|
191
|
+
"\u2a00": "\\bigodot ", # ⨀ N-ARY CIRCLED DOT OPERATOR
|
|
192
|
+
"\u2a01": "\\bigoplus ", # ⨁ N-ARY CIRCLED PLUS OPERATOR
|
|
193
|
+
"\u2a02": "\\bigotimes ", # ⨂ N-ARY CIRCLED TIMES OPERATOR
|
|
194
|
+
"\u2a03": "\u2a03", # ⨃ N-ARY UNION WITH DOT — no exact KaTeX equivalent; keep Unicode
|
|
195
|
+
"\u2a04": "\u2a04", # ⨄ N-ARY UNION WITH PLUS — no exact KaTeX equivalent; keep Unicode
|
|
196
|
+
# Wave arrows — pylatexenc: \arrowwaveleft / \arrowwaveright (not in KaTeX); keep Unicode
|
|
197
|
+
"\u219c": "\u219c", # ↜ LEFTWARDS WAVE ARROW
|
|
198
|
+
"\u219d": "\u219d", # ↝ RIGHTWARDS WAVE ARROW
|
|
199
|
+
# Italic, Latin, uppercase
|
|
200
|
+
"\U0001d434": "A",
|
|
201
|
+
"\U0001d435": "B",
|
|
202
|
+
"\U0001d436": "C",
|
|
203
|
+
"\U0001d437": "D",
|
|
204
|
+
"\U0001d438": "E",
|
|
205
|
+
"\U0001d439": "F",
|
|
206
|
+
"\U0001d43a": "G",
|
|
207
|
+
"\U0001d43b": "H",
|
|
208
|
+
"\U0001d43c": "I",
|
|
209
|
+
"\U0001d43d": "J",
|
|
210
|
+
"\U0001d43e": "K",
|
|
211
|
+
"\U0001d43f": "L",
|
|
212
|
+
"\U0001d440": "M",
|
|
213
|
+
"\U0001d441": "N",
|
|
214
|
+
"\U0001d442": "O",
|
|
215
|
+
"\U0001d443": "P",
|
|
216
|
+
"\U0001d444": "Q",
|
|
217
|
+
"\U0001d445": "R",
|
|
218
|
+
"\U0001d446": "S",
|
|
219
|
+
"\U0001d447": "T",
|
|
220
|
+
"\U0001d448": "U",
|
|
221
|
+
"\U0001d449": "V",
|
|
222
|
+
"\U0001d44a": "W",
|
|
223
|
+
"\U0001d44b": "X",
|
|
224
|
+
"\U0001d44c": "Y",
|
|
225
|
+
"\U0001d44d": "Z",
|
|
226
|
+
# Italic, Latin, lowercase
|
|
227
|
+
"\U0001d44e": "a",
|
|
228
|
+
"\U0001d44f": "b",
|
|
229
|
+
"\U0001d450": "c",
|
|
230
|
+
"\U0001d451": "d",
|
|
231
|
+
"\U0001d452": "e",
|
|
232
|
+
"\U0001d453": "f",
|
|
233
|
+
"\U0001d454": "g",
|
|
234
|
+
"\U0001d456": "i",
|
|
235
|
+
"\U0001d457": "j",
|
|
236
|
+
"\U0001d458": "k",
|
|
237
|
+
"\U0001d459": "l",
|
|
238
|
+
"\U0001d45a": "m",
|
|
239
|
+
"\U0001d45b": "n",
|
|
240
|
+
"\U0001d45c": "o",
|
|
241
|
+
"\U0001d45d": "p",
|
|
242
|
+
"\U0001d45e": "q",
|
|
243
|
+
"\U0001d45f": "r",
|
|
244
|
+
"\U0001d460": "s",
|
|
245
|
+
"\U0001d461": "t",
|
|
246
|
+
"\U0001d462": "u",
|
|
247
|
+
"\U0001d463": "v",
|
|
248
|
+
"\U0001d464": "w",
|
|
249
|
+
"\U0001d465": "x",
|
|
250
|
+
"\U0001d466": "y",
|
|
251
|
+
"\U0001d467": "z",
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
FUNC = {
|
|
255
|
+
"sin": "\\sin({fe})",
|
|
256
|
+
"cos": "\\cos({fe})",
|
|
257
|
+
"tan": "\\tan({fe})",
|
|
258
|
+
"arcsin": "\\arcsin({fe})",
|
|
259
|
+
"arccos": "\\arccos({fe})",
|
|
260
|
+
"arctan": "\\arctan({fe})",
|
|
261
|
+
"arccot": "\\arccot({fe})",
|
|
262
|
+
"sinh": "\\sinh({fe})",
|
|
263
|
+
"cosh": "\\cosh({fe})",
|
|
264
|
+
"tanh": "\\tanh({fe})",
|
|
265
|
+
"coth": "\\coth({fe})",
|
|
266
|
+
"sec": "\\sec({fe})",
|
|
267
|
+
"csc": "\\csc({fe})",
|
|
268
|
+
"mod": "\\mod {fe}",
|
|
269
|
+
"max": "\\max({fe})",
|
|
270
|
+
"min": "\\min({fe})",
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
FUNC_PLACE = "{fe}"
|
|
274
|
+
|
|
275
|
+
BRK = "\\\\"
|
|
276
|
+
|
|
277
|
+
CHR_DEFAULT = {
|
|
278
|
+
"ACC_VAL": "\\hat{{{0}}}",
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
POS = {
|
|
282
|
+
"top": "\\overline{{{0}}}", # not sure
|
|
283
|
+
"bot": "\\underline{{{0}}}",
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
POS_DEFAULT = {
|
|
287
|
+
"BAR_VAL": "\\overline{{{0}}}",
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
SUB = "_{{{0}}}"
|
|
291
|
+
|
|
292
|
+
SUP = "^{{{0}}}"
|
|
293
|
+
|
|
294
|
+
F = {
|
|
295
|
+
"bar": "\\frac{{{num}}}{{{den}}}",
|
|
296
|
+
"skw": r"^{{{num}}}/_{{{den}}}",
|
|
297
|
+
"noBar": "\\genfrac{{}}{{}}{{0pt}}{{}}{{{num}}}{{{den}}}",
|
|
298
|
+
"lin": "{{{num}}}/{{{den}}}",
|
|
299
|
+
}
|
|
300
|
+
F_DEFAULT = "\\frac{{{num}}}{{{den}}}"
|
|
301
|
+
|
|
302
|
+
D = "\\left{left}{text}\\right{right}"
|
|
303
|
+
|
|
304
|
+
D_DEFAULT = {
|
|
305
|
+
"left": "(",
|
|
306
|
+
"right": ")",
|
|
307
|
+
"null": ".",
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
RAD = "\\sqrt[{deg}]{{{text}}}"
|
|
311
|
+
RAD_DEFAULT = "\\sqrt{{{text}}}"
|
|
312
|
+
ARR = "\\begin{{array}}{{c}}{text}\\end{{array}}"
|
|
313
|
+
|
|
314
|
+
LIM_FUNC = {
|
|
315
|
+
"lim": "\\lim_{{{lim}}}",
|
|
316
|
+
"max": "\\max_{{{lim}}}",
|
|
317
|
+
"min": "\\min_{{{lim}}}",
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
LIM_TO = ("\\rightarrow", "\\to")
|
|
321
|
+
|
|
322
|
+
LIM_UPP = "\\overset{{{lim}}}{{{text}}}"
|
|
323
|
+
|
|
324
|
+
M = "\\begin{{matrix}}{text}\\end{{matrix}}"
|