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

Support substitution of identifiers #64

Merged
merged 12 commits into from
Oct 25, 2022
Merged

Support substitution of identifiers #64

merged 12 commits into from
Oct 25, 2022

Conversation

odashi
Copy link
Collaborator

@odashi odashi commented Oct 24, 2022

Overview

Adds identifiers option to get_latex and with_latex.
CC: @cccntu @alecglen

It works like:
無題

At this point, this feature does not support:

  • direct substitution of LaTeX because of maintaining the correct structure of AST during the whole processing.
  • converting nested attributes (e.g., foo.bar) because it requires recursive analysis and another syntax of substitution rules.

Details

identifiers option takes dict[str, str], in which each key/value represents a substitution rule of identifier names (must follow the Python's naming convention of identifiers). The rule affects against (1) function names, (2) function arguments, and (3) any identifiers in the expression.

The process is implemented as a NodeTransformer and is applied among AST parsing and LaTeX codegen.

References

Blocked by

  • NA

@odashi odashi added the feature label Oct 24, 2022
@odashi odashi added this to the v0.2 milestone Oct 24, 2022
@odashi odashi requested a review from ShigekiKarita October 24, 2022 16:46
Yusuke Oda and others added 2 commits October 25, 2022 14:23
@odashi odashi merged commit 363ffae into main Oct 25, 2022
@odashi odashi deleted the 50-support-substitution branch October 25, 2022 05:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support substitutions of names
2 participants