summaryrefslogtreecommitdiff
path: root/docutils/utils/math
Commit message (Collapse)AuthorAgeFilesLines
* LaTeX to MathML: fix ``\mspace``.milde2023-04-081-6/+7
| | | | | | | LaTeX width unit "mu" (mathematical unit) must be converted for MathML. Typo in the code resulted in wrong "width" argument for `<mspace>`. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@9338 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Use "pathlib" to simplify path manipulations. No change to behaviour.milde2022-11-241-3/+3
| | | | | | | | | | | Rely on `utils.relative_path()` to normalize paths. No need to use `os.normpath()` or `os.abspath()` separately. `utils.DependencyList.add()` accepts `pathlib.Path` instances. Small code cleanups. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@9272 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix "shebang on non-executable files".milde2022-11-162-2/+0
| | | | | | | | Based on patch in opensuse.org RPM package spec. - Change mode of files supporting use as command-line script. - Remove "shebang line" from library modules. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@9250 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Support `pandoc` as an external LaTeX to MathML converter.milde2022-11-041-2/+36
| | | | | | Patch by Ximin Luo [patches:#197]. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@9216 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* MathML: Small fixes for external latex -> MathML converters.milde2022-11-041-7/+7
| | | | | | | latexml: support amsfonts commands (``\mathbb`` etc.) ttm: decode output git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@9215 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* MathML: Use (re)generated version of tex2unichar.py.milde2022-11-041-21/+47
| | | | | | | | | Fixup [r9135] by updating the generating script and re-generating the file from the database. Only cosmetic/style changes. No change to the data. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@9214 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* MathML: support "mod" notation for modulo operation/arithmetic.milde2022-11-041-4/+53
| | | | | | TeX to HTML/css support still missing, cf. [feature-requests:#93]. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@9213 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Resolve flake8 ``E261`` errors in ``math2html``aa-turner2022-10-201-36/+36
| | | | | | | All ``E261`` errors are now resolved. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@9137 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Resolve flake8 ``E261`` errors in ``latex2mathml``aa-turner2022-10-201-187/+198
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@9136 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Resolve flake8 ``E261`` errors in ``tex2unichar``aa-turner2022-10-201-684/+684
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@9135 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Use 4 space indentation in ``math2html`` per PEP 8aa-turner2022-10-201-2767/+2767
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@9132 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Minor error message fixmilde2022-09-131-1/+1
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@9123 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Unify naming of the "utf-8" codec.milde2022-06-131-11/+11
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@9068 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Remove unused local variablesmilde2022-03-051-1/+0
| | | | | | | | flake rule F841: local variable 'foo' is assigned to but never used In test_odt.py, a no-op class definition is removed completely. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@9038 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Remove unused imports.milde2022-03-051-1/+0
| | | | | | flake8 rule F401 git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@9037 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Avoid ambiguous variable name l (may be mixed up with 1).milde2022-03-051-2/+2
| | | | | | flake8 rule E741 git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@9034 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Simplify code as dicts have fixed order since 3.6milde2022-03-051-8/+6
| | | | | | | We no longer need to sort a dictionary from `**kwargs` in order to have a fixed order for stable tests. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@9029 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Ensure 2 blank lines around top-level functions and classes.milde2022-03-044-1/+78
| | | | | | | | flake8 rules E302: expected 2 blank lines, found 1 E305: expected 2 blank lines after class or function definition git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@9026 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Remove excess blank lines.milde2022-03-042-6/+0
| | | | | | flakei rule E303: too many blank lines (N) git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@9025 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix (some) missing blank linesmilde2022-03-041-0/+2
| | | | | | | | flake8 rules E301: expected 1 blank line, found 0 E306: expected 1 blank line before a nested definition, found 0 git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@9024 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Ensure comments start with '# 'milde2022-03-041-6/+6
| | | | | | | | | | | flake rules E262: inline comment should start with '# ' E265: block comment should start with '# ' E266: too many leading '#' for block comment Exception for latex2e (legacy convention to mark disabled code with ##). git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@9022 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Ensure at least two spaces before inline comment.milde2022-03-042-6/+6
| | | | | | | | | flake 8 rule E261 Exceptions for modules sheduled for removal or with 3rd-party origin and for data collections. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@9021 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix unexpected spaces around equals indicating keyword arguments.milde2022-03-031-7/+7
| | | | | | flake8 rule E251 git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@9020 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix missing whitespace after ',' or ':'.milde2022-03-032-81/+80
| | | | | | | | flake8 rule E231. Mostly trailing commas in list and dictionary literals. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@9018 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix missing whitespace around operator.milde2022-03-032-2/+3
| | | | | | | | | | | | | | flake8 rules E225: missing whitespace around operator E226: missing whitespace around arithmetic operator E228: missing whitespace around modulo operator Keep ignoring the latter two rules: PEP8 limits the recommendation to "operators with lowest priority" "if operators with different priorities are used". flake8 also flags top level operators. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@9017 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix multiple spaces before/after operatormilde2022-03-031-1/+1
| | | | | | | E221 multiple spaces before operator E222 multiple spaces after operator git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@9016 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix whitespace before/after delimiters and colon.milde2022-03-031-1/+1
| | | | | | | | | | | | | | Flake rules E201 whitespace after '(' E202 whitespace before '}' E203 whitespace before ':' E211 whitespace before '(' Exception: : as binary operator in extended slices (cf. https://www.python.org/dev/peps/pep-0008/#pet-peeves). git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@9015 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix code indentationmilde2022-01-293-29/+31
| | | | | | | | | | | | | | | | | | | | Check conformance to our coding policies with flake8. Fix the following problems: E111 indentation is not a multiple of four E114 indentation is not a multiple of four (comment) E115 expected an indented block (comment) E116 unexpected indentation (comment) E117 over-indented E121 continuation line under-indented for hanging indent E122 continuation line missing indentation or outdented E124 closing bracked does not match visual indentaion E127 continuation line over-indented for visual indent E128 continuation line under-indented for visual indent E131 continuation line unaligned for hanging indent git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8994 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Do not use combining Unicode characters without base in literal strings.milde2022-01-271-11/+11
| | | | | | | Add an example for LaTeX accent functions in mathematical text to the mathematics documentation. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8986 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Leftovers and fixes after the big clean-up.milde2022-01-273-16/+16
| | | | | | Patch set by Adam Turner. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8985 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* New style classes no longer need to inherit from `object`.milde2022-01-262-22/+22
| | | | | | Patch by Adam Turner. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8984 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Drop string prefix "u".milde2022-01-265-1919/+1919
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8983 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Skip assigning to a variable when immediately returningmilde2022-01-262-4/+2
| | | | | | Patch by Adam Turner git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8980 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Remove unused importsmilde2022-01-261-2/+0
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8979 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Use "x not in y" over "not x in y"milde2022-01-261-9/+9
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8978 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Use "is" to check for Nonemilde2022-01-261-1/+1
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8977 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Remove redundant parenthesesmilde2022-01-261-1/+1
| | | | | | Patch by Adam Turner. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8976 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Use yield frommilde2022-01-261-2/+1
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8974 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Small fixes and clean-ups by Adam Turner.milde2022-01-261-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | Remove duplicate definitions in language modules. Import locale_encoding from `docutils.io` Use decorator for staticmethod Use True/False over 1/0. `collections.OrderedDict` no longer required, all dictionaries are ordered from Python 3.7 Remove obsolete `__cmp__` method cf. https://docs.python.org/3/whatsnew/3.0.html#ordering-comparisons Use str instead of type(''). Zero-argument ``super()`` Simplify test support module as "u" prefix isn't used by repr in Python 3. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8973 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Use generator expressions with functions expecting a sequence.milde2022-01-264-9/+9
| | | | | | Based on patches by Adam Turner git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8970 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Code modernisation. Use literals.milde2022-01-261-4/+4
| | | | | | Merger of 2 patches by Adam Turner. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8969 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix flake8 warnings.milde2022-01-212-22/+5
| | | | | | | | math2html.py: remove not required class latex2mathml.py: silence warning for now frontend.py: prefix variable that moved to "io" module. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8958 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix : string containing backslash to rawgrubert2022-01-091-1/+1
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8939 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Drop (most) special-casing for Python 2.x.milde2022-01-032-86/+33
| | | | | | Simplifications for nodes.py and error_reporting.py will follow. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8928 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Remove "coding:" slugmilde2022-01-034-10/+2
| | | | | | Only required with Python 2.x. Encoding in Py3k is utf8 by default. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8926 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Remove 2.7-compatibility __future__ imports.milde2022-01-031-2/+1
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8925 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Document image formats, small documentation fixes and updates.milde2021-11-091-2/+5
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8883 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Mark "latex2mathml" module as provisional.milde2021-11-051-3/+6
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8878 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Small fixes in interpreted text role definitions.milde2021-11-011-1/+1
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8873 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix spellingmilde2021-10-222-2/+2
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8860 929543f6-e4f2-0310-98a6-ba3bd3dd1d04