I like to type in 2d maths into Mathematica and then generate latex code for it. It has been working fine so far until I attempted this expression:

```
TeXForm[HoldForm[
  S (k*L) = (4*l + 1)/
    2 (Integrate[
      LegendreP[2*l, x]*SphericalBesselJ[0, 1/2*kl*x], {x, -1, 1}])^2/
    Integrate[SphericalBesselJ[0, 1/2*kl*x]^2, {x, -1, 1}]]]

```

The output latex is 

```
S (k L)=\frac{(4 l+1) \left(\int_{-1}^1 P_{2 l}(x) j_0\left(\frac{\text{kl} x}{2}\right) \,
   dx\right){}^2}{2 \int_{-1}^1 j_0\left(\frac{\text{kl} x}{2}\right){}^2 \, dx}

```

Which looks like this when compiled.

![Mathematica generated code](https://i.stack.imgur.com/NyHi1.png)

As you can see there are many style errors (in my opinon). The Integral signs are too small with limits too big, the brackets look weird. The ^2 does not seem in the right place. The problem is if I were to type this out by hand, I come to pretty much the same code as mathematica. 

Any help on making this equation beautiful is greatly appreciated.

Thanks