alvinwan / TexSoup

fault-tolerant Python3 package for searching, navigating, and modifying LaTeX documents
https://texsoup.alvinwan.com
BSD 2-Clause "Simplified" License
290 stars 43 forks source link

Parsing the arguments of \def as separate objects #131

Open SengerM opened 3 years ago

SengerM commented 3 years ago

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.