roniemartinez / latex2mathml

Pure Python library for LaTeX to MathML conversion
MIT License
183 stars 25 forks source link

list index out of range #96

Closed roniemartinez closed 4 years ago

roniemartinez commented 4 years ago

Input:

(\frac{1+x^{2}}{1+y^{2}})^{t}\leq2^{|t|}(1+(x+y)^{2})^{|t|}
(\sin(x)^{2}+3\cos(x)^{2})^{4}
(\frac{1+x^{2}}{1+y^{2}})\leq2^{|t|}(1+(x-y)^{2})^{|t|}

Error:

Traceback (most recent call last):
  File "/Users/<path>/latex2mathml/example.py", line 23, in <module>
    print(convert_to_mathml(string))
  File "/Users/<path>/latex2mathml/example.py", line 13, in convert_to_mathml
    mathml_output = convert(latex_input)
  File "/Users/<path>/latex2mathml/latex2mathml/converter.py", line 26, in convert
    _classify_subgroup(aggregate(latex), row)
  File "/Users/<path>/latex2mathml/latex2mathml/converter.py", line 137, in _classify_subgroup
    _convert_command(element, elements, i, iterable, row)
  File "/Users/<path>/latex2mathml/latex2mathml/converter.py", line 166, in _convert_command
    param = elements[index]
IndexError: list index out of range