Fixing powers of trig function bug in latex display code