summaryrefslogtreecommitdiff
path: root/docutils/docutils/utils/math/math2html.py
Commit message (Collapse)AuthorAgeFilesLines
* 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@9272 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@9137 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@9132 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@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@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@9034 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Ensure 2 blank lines around top-level functions and classes.milde2022-03-041-0/+47
| | | | | | | | 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@9026 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Remove excess blank lines.milde2022-03-041-3/+0
| | | | | | flakei rule E303: too many blank lines (N) git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9025 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@9020 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix missing whitespace after ',' or ':'.milde2022-03-031-75/+74
| | | | | | | | flake8 rule E231. Mostly trailing commas in list and dictionary literals. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9018 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix missing whitespace around operator.milde2022-03-031-1/+2
| | | | | | | | | | | | | | 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@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@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@9015 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix code indentationmilde2022-01-291-4/+5
| | | | | | | | | | | | | | | | | | | | 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@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@8986 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Leftovers and fixes after the big clean-up.milde2022-01-271-11/+11
| | | | | | Patch set by Adam Turner. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8985 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* New style classes no longer need to inherit from `object`.milde2022-01-261-21/+21
| | | | | | Patch by Adam Turner. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8984 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Drop string prefix "u".milde2022-01-261-340/+340
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8983 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Skip assigning to a variable when immediately returningmilde2022-01-261-2/+1
| | | | | | Patch by Adam Turner git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8980 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@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@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@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@8974 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Use generator expressions with functions expecting a sequence.milde2022-01-261-2/+2
| | | | | | Based on patches by Adam Turner git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@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@8969 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix flake8 warnings.milde2022-01-211-17/+1
| | | | | | | | 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@8958 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Drop (most) special-casing for Python 2.x.milde2022-01-031-83/+32
| | | | | | Simplifications for nodes.py and error_reporting.py will follow. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8928 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Remove "coding:" slugmilde2022-01-031-3/+1
| | | | | | 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@8926 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix spellingmilde2021-10-221-1/+1
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8860 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Math: fix some LaTeX character mappings.milde2021-07-121-27/+36
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8799 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* math2html: Prefer STIX fonts for formulas.milde2021-07-121-35/+41
| | | | | | | | | | | | | | STIX is free, widely supported, and comprehensive. (On the downside: it is considerably smaller than DejaVu: no problem with Chromium/Chrome but in Firefox a larger font-size might be advised.) Work around bugs/problems in STIX: "medium mathematical space" is too wide, "vertical line" glyphs leave gaps when stacked, upright integrals provide better alignment of limits. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8798 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* math2html: make "math.css" valid CSS 2.1.milde2021-07-121-36/+12
| | | | | | | | | Don't use inline-flex. Fix order of super/subscript in the conversion code, so that an inline-table can be used instead. Also go back to constructing big brackets from pieces. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8797 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* math2html: Improve handling of big symbols.milde2021-07-121-33/+34
| | | | | | | | | | Scale variable sized operators with CSS instead of constructing from pieces. Fix Unicode translations for N-ary operators. Scale stretch big delimiters instead of scaling. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8796 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* math2html: support decorations under base character.milde2021-07-121-43/+76
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8795 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* math2html: support small symbols, refactor math accent handling.milde2021-07-121-78/+55
| | | | | | | | | | | | | | | math accents/combining characters: - insert combining character after first character of argument (mimic LaTeX behaviour). - support non alphabetical base-character (\not{\in} and similar). - use precomposed characters if possible (normalization) Cleanup: update comments, remove not required code. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8794 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Major rework of math2html converter.milde2021-07-121-2512/+323
| | | | | | | | | | | | | Fork from elyxer (https://github.com/alexfernandez/elyxer). Remove code that is not requried for math conversion. Fix/update LaTeX/Unicode character translation, use common codebase with MathML. Support more commands. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8793 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* HTML math output fixes.milde2021-05-021-7/+10
| | | | | | | | | | | Fix bug #244 Wrong subscript/superscript order with ``math-output=HTML``. Don't use <tt> element (deprecated in HTML5). Support commands ``\Bbbk`` and ``operatorname``. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8717 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix link to 2-Clause BSD license.milde2020-09-041-1/+1
| | | | git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@8554 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* trivial: Misc whitespace fixesmilde2019-08-271-650/+631
| | | | | | Signed-off-by: Stephen Finucane <stephen@that.guru> git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@8376 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* py3: Wrap 'foo.keys()', 'zip(foo, bar') in 'list'milde2019-08-271-1/+1
| | | | | | | | | | | In Python 3, 'dict.keys()', 'zip' and 'map' no longer return a list but rather types 'dict_keys', 'zip' and 'map', respectively. You can't append to these types nor can you delete from them while in a loop. The simple solution to both issues is to wrap things in 'list'. Signed-off-by: Stephen Finucane <stephen@that.guru> git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@8372 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* py3: Fix magic methodsmilde2019-08-271-14/+79
| | | | | | | | | Python 3 uses '__bool__' and '__next__', where Python 2 used '__nonzero__' and 'next'. Use the new names but add aliases. Based on patch by Stephen Finucane <stephen@that.guru> git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@8371 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* py3: Handle 'urllib', 'urllib2' to 'urlib.*' renamemilde2019-08-271-2/+6
| | | | | | Signed-off-by: Stephen Finucane <stephen@that.guru> git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@8370 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Formatting changes to facilitate integration of "py3" patchset.milde2019-08-271-3/+3
| | | | git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@8367 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* py3: Replace 'foo.next()' with 'next(foo)'milde2019-08-261-1/+1
| | | | | | | | | The former only works in Python 2, while the latter works in Python 2.7 and 3.x. Signed-off-by: Stephen Finucane <stephen@that.guru> git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@8361 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* py3: Use 'sorted(foo)' instead of 'foo.sort()'milde2019-08-261-2/+1
| | | | | | | | This works with iterators also (like 'dict.keys()' in Python 3) Signed-off-by: Stephen Finucane <stephen@that.guru> git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@8357 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* py3: Resolve some additional undefined symbolsmilde2019-08-261-4/+4
| | | | | | | | Found with flake8 Signed-off-by: Stephen Finucane <stephen@that.guru> git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@8352 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* py3: Add aliases for removed symbolsmilde2019-08-261-47/+12
| | | | | | | | | | Add aliases for symbols that have been removed in Python 3.x, namely basestring, unicode, unichr and StandardError. Signed-off-by: Stephen Finucane <stephen@that.guru> small fixes by Günter Milde. git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@8348 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Apply patch [ 140 ] by Ville Skyttä (escape sequence deprecation fix).milde2017-05-301-1/+1
| | | | git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@8094 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Apply patch by Neil Schemenauer to fix bad string escapesmilde2016-12-101-1/+1
| | | | | | (http://permalink.gmane.org/gmane.text.docutils.devel/7521). git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@7995 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* New upstream version (additional macros, piecewise integrals and sums).milde2015-02-271-138/+258
| | | | git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@7806 929543f6-e4f2-0310-98a6-ba3bd3dd1d04