latexify_py icon indicating copy to clipboard operation
latexify_py copied to clipboard

Support expanding custom functions

Open ZibingZhang opened this issue 2 years ago • 1 comments

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]

ZibingZhang avatar Nov 23 '22 08:11 ZibingZhang

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.

odashi avatar Nov 24 '22 00:11 odashi