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

Underscores in function names conflict with LaTeX and shown as subscripts #31

Closed
ryosuketc opened this issue Oct 8, 2020 · 3 comments · Fixed by #35
Closed

Underscores in function names conflict with LaTeX and shown as subscripts #31

ryosuketc opened this issue Oct 8, 2020 · 3 comments · Fixed by #35

Comments

@ryosuketc
Copy link
Contributor

Underscores in function names conflict with LaTeX and thus it is represented as subscript in LaTeX.

image

In Jupyter Notebook:

@latexify.with_latex
def func_with_underscore(x):
  return 1

func_with_underscore
@odashi
Copy link
Collaborator

odashi commented Oct 9, 2020

Yeah the underscores in identifiers should be escaped normally, but in some few cases they are worthy for special treatment (as #6 discussed).

@1MLightyears
Copy link
Contributor

It looks like only "_" the underline is the only character that has the problem
See if I could fix it 🤔

@yasirroni
Copy link

For those that come here and confused to implement it:

@latexify.with_latex(use_raw_function_name=True)
def forward_diff(f, h, x):
    return f(x + h) / h

See #82

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

Successfully merging a pull request may close this issue.

4 participants