print(py2tex('theta = w_k * a ** 4 / t ** 4 / E',simplify_fractions=True)) prints out: $$\theta=\frac{\frac{w_k a^4}{t^4}}{E}$$ instead of: $$\theta=\frac{w_k a^4}{t^4E}$$