latexify_py
latexify_py copied to clipboard
Support expanding custom functions
follows https://github.com/google/latexify_py/issues/65
Description
We already have a expand_functions: set[str] | None
in the config which the user can use to specific a set of predetermined function expansions. It would be nice for users to somehow register their own function expansions.
Ideas of the solution
- User's function expansions should take priority over default ones, even if both are specified
- Maybe a
register_function_expansions: dict[str, Callable]
Since the library still has many remaining issues under the hood, this should be a nice-to-have, not urgent feature. But feel free to implement any PoCs for this; I never block any researches using this library.
I think providing a good default behavior is prioritized than providing many user-side control particularly in this kind of library, since I think of users may not want to write any other things than just adding @latexify.function
.