Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: [Line: 0, Offset 5] Malformed argument. #136

Open
xthyax opened this issue Nov 17, 2022 · 1 comment
Open

TypeError: [Line: 0, Offset 5] Malformed argument. #136

xthyax opened this issue Nov 17, 2022 · 1 comment

Comments

@xthyax
Copy link

xthyax commented Nov 17, 2022

Hi, First of all, thanks for your tools.

I just stumble on this issue(maybe a potential bug), I can't find any solution for it, and I really need help on this.

My input:

'\\frac{ \\left(2^{6} \\cdot 5.7\\right)\\left(5^{4} \\cdot 7^{9}\\right)}{\\left(2.5 .7^{2}\\right)^{5}}'

My code:

from TexSoup import TexSoup
TexSoup('\\frac{ \\left(2^{6} \\cdot 5.7\\right)\\left(5^{4} \\cdot 7^{9}\\right)}{\\left(2.5 .7^{2}\\right)^{5}}')

My error:

TypeError: [Line: 0, Offset 5] Malformed argument. First and last elements must match a valid argument format. In this case, TexSoup could not find matching punctuation for: {.
Just finished parsing: ['{', ' ', TexCmd('left(2'), '^', BraceGroup('6'), ' ', TexCmd('cdot'), ' 5.7', TexCmd('right)'), 'left(5', '^', BraceGroup('4'), ' ', TexCmd('cdot'), ' 7^', BraceGroup('9'), TexCmd('right)}', [BraceGroup(TexCmd('left(2'), '.5 .7^', BraceGroup('2'), TexCmd('right)^', [BraceGroup('5')]))])]

I'm using

TexSoup 0.3.1
Python 3.8.13

Thank you!

@xthyax
Copy link
Author

xthyax commented Nov 17, 2022

I think I find the problem

When this is fine

TexSoup('\\frac{\\right) }{}')

But this will lead to an error

TexSoup('\\frac{\\right)}{}')

The error will be like this:

TypeError: [Line: 0, Offset 5] Malformed argument. First and last elements must match a valid argument format. In this case, TexSoup could not find matching punctuation for: {.
Just finished parsing: ['{', TexCmd('right)}', [BraceGroup()])]

Since this's a bug, but needs to work around for it to work, I'll leave it open

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant