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

IdentifierConverter #139

Merged
merged 4 commits into from
Nov 28, 2022
Merged

IdentifierConverter #139

merged 4 commits into from
Nov 28, 2022

Conversation

odashi
Copy link
Collaborator

@odashi odashi commented Nov 28, 2022

Overview

Introduces a common processing for all identifiers.

Details

This change introduces IdentifierConverter, which converts identifier strings into:

  • foo --> \foo, if use_math_symbols == True and the given identifier matches a supported math symbol name.
  • x --> x, if the given identifier is exactly 1 character (except _)
  • foo_bar --> \mathrm{foo\_bar}, otherwise.

This change also removes use_raw_function_name flag: the rule is applied to all identifiers (not only function names) without exceptions.

IdentifierConverter also returns a boolean flag to express whether the returned expression can be treated as a single character or not. This is potentially used to fix #89 .

References

Blocked by

  • NA

Copy link
Collaborator

@ShigekiKarita ShigekiKarita left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@odashi
Copy link
Collaborator Author

odashi commented Nov 28, 2022

@ShigekiKarita I think \text is used for rendering regular texts with the default font (not constraining it to Roman). In our case, I think always using \mathrm would be better, though I'm not sure how they chose both commands.

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

Successfully merging this pull request may close these issues.

Wrong behavior around multiplication Fine-grained name processing
2 participants