Open mikldk opened 3 years ago
Currently work in progress at SymPy so currently not possible for release version 1.7. See e.g.:
Also see https://github.com/sympy/sympy/blob/dd08a11b11a9cef066fb80b54a57f83887ccb852/sympy/core/parameters.py. Maybe at some point, instead of overwriting printers we can
from sympy.core.parameters import global_parameters as gp
gp.exp_is_pow = False
@YiquanGu , thanks. I can only come up with being creative:
library(caracas)
x <- as_sym("-1/(theta-1)")
x
#> [caracas]: -1
#> ─────
#> θ - 1
tex(x)
#> [1] "- \\frac{1}{\\theta - 1}"
y <- 1/(1/x)
y
#> [caracas]: 1
#> ─────
#> 1 - θ
tex(y)
#> [1] "\\frac{1}{1 - \\theta}"
See
inst/define_printers.py
.