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

adapt LatexWalker context while walking #87

Open
nschloe opened this issue Feb 25, 2022 · 1 comment
Open

adapt LatexWalker context while walking #87

nschloe opened this issue Feb 25, 2022 · 1 comment

Comments

@nschloe
Copy link

nschloe commented Feb 25, 2022

One can adapt the LaTeX contet (how to parse macros, environments etc.) with

w = LatexWalker(self.string, latex_context=latex_context)

This, however is not how LaTeX works. Macro names can take different meaning throughout the document, depending on what \[re]newcommands appear. I would hence suggest to add a mechanism to adapt the walker context while walking through it. This implies that the walker only ever decodes the next keyword, not the whole document at once.

(Perhaps there already is a way to handle this and I've missed it.)

@phfaist
Copy link
Owner

phfaist commented Sep 17, 2022

There is an undocumented way to handle state changes in pylatexenc 2, and there will be an official way of doing that in the upcoming pylatexenc 3.

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

No branches or pull requests

2 participants