latexify_py icon indicating copy to clipboard operation
latexify_py copied to clipboard

Config class

Open odashi opened this issue 1 year ago • 9 comments

Follows #65

It may be good if we provide a config class integrating every setting, which are currently passed directly to with_latex:

import latexify

config = latexify.Config.defaults()
config.use_math_symbols()
config.expand_function("expit")

@latexify.with_latex(config)
def f(x):
    return expit(x)

# Will generate: \mathrm{f}(x) \triangleq \frac{1}{1+\exp{(-x)}}

odashi avatar Oct 25 '22 17:10 odashi

possible logic:

inner_config = copy(config if config is not None else Config.defaults())
for each kwarg:
    inner_config.update(kwarg)

inner_process(fn, inner_config)

odashi avatar Oct 25 '22 17:10 odashi

working on this

chunibyo-wly avatar Nov 08 '22 13:11 chunibyo-wly

@chunibyo-wly Thanks for working on this. Since this feature should be carefully designed, could you provide your idea about the implementation before throwing PRs?

odashi avatar Nov 08 '22 18:11 odashi

hello, thanks for your reply, could you please give me some time to do some tests? I will give you answer later

chunibyo-wly avatar Nov 09 '22 15:11 chunibyo-wly

@chunibyo-wly Sure. I targeted this feature on the release after the next (0.3) so we don't need to rush at this point.

odashi avatar Nov 10 '22 01:11 odashi