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

Parsing the arguments of \def as separate objects #131

Open
SengerM opened this issue Jul 30, 2021 · 0 comments
Open

Parsing the arguments of \def as separate objects #131

SengerM opened this issue Jul 30, 2021 · 0 comments

Comments

@SengerM
Copy link

SengerM commented Jul 30, 2021

The output of this

import TexSoup

latex = r'\def\lagrangian{\mathscr{L}}'

soup = TexSoup.TexSoup(latex)

print(soup.contents)

is

[\def{\}{lagrangian}, {\mathscr{L}}]

Is this the correct behavior? Sorry if not, I am not a LaTeX expert. But to me it is more logical to have everything parsed into the same object.

masonproffitt added a commit to masonproffitt/TexSoup that referenced this issue Dec 3, 2021
masonproffitt added a commit to masonproffitt/TexSoup that referenced this issue Dec 6, 2021
Don't surround new command with braces, and make sure it's parsed as a TexCmd.
This makes \def more consistent with \newcommand.
alvinwan pushed a commit that referenced this issue Feb 4, 2023
* fix \def without braces around command #118 #131

e.g., \def\commandname{command text}

* improve \def parsing #118 #131

Don't surround new command with braces, and make sure it's parsed as a TexCmd.
This makes \def more consistent with \newcommand.

* fix required arguments parsing logic
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