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

Best way to to go into LatexGroupNodes? #108

Open
flimofly opened this issue Jul 6, 2024 · 0 comments
Open

Best way to to go into LatexGroupNodes? #108

flimofly opened this issue Jul 6, 2024 · 0 comments

Comments

@flimofly
Copy link

flimofly commented Jul 6, 2024

Congratulations on thank you for this magnificent tool!

I was wondering whether a recursive function is needed to parse LatexGroupNodes?

E.g.

def traverse(node):
    #Parsing for enumerate environments
        if node.isNodeType(LatexEnvironmentNode) and node.environmentname == "enumerate":
           
[omitted]
                   
#check for enumeration nested within LatexGroupNodes
        if node.isNodeType(LatexGroupNode): #Recurse into groupnodes
            traverse(node)

#loop through nodes 
for node in nodes:
    traverse(node)

If so, what's the best approach to avoid infinite recursion?

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