Support for sqrt-like nth-roots when rendering x**(1/p)?
jonbarron opened this issue · 2 comments
Description
When I latexify something like x**(1/p)
, I get $x^{1/p}$
, which makes complete sense, but isn't quite as nice looking as $\sqrt[p]{x}$
.
Ideas of the solution
Is there a way to coax latexify to look for patterns like 1/expr
in the exponent, and use sqrt[expr]
in those cases?
Alternative ideas
having a flag for the latexify decorator that renders all powers p
as sqrt[1/p]
would probably still be useful if the fully automatic version isn't possible
Additional context
Thanks for the suggestion. It is basically possible to implement the ideas above, but we also need to carefully choose the default behavior.
I think introducing some flags (such as ensure_root_op
?) to choose the representation x**(1/p)
is better. Using x**(q/p)
will be literally converted to
yeah I like that!