From: Darren D. <dd...@co...> - 2006-03-08 12:28:42
|
>> On Wednesday 08 March 2006 5:06 am, Nils Wagner wrote: >> =A0=20 >>> Hi all, >>> >>> How do I use \frac{a}{b} within labels ? >>> >>> from pylab import * >>> from scipy import * >>> x =3D linspace(0,pi,20) >>> plot(x,sin(x)) >>> title(r'\frac{\Theta}{2\pi}') >>> xlabel(r'\frac{\Theta}{2\pi}') =A0# The output is not o.k. >>> show() >>> >>> Am I missing something or is it a bug ? >>> =A0 =A0=20 >> >> What does "The output is not o.k." mean? >> =A0=20 > The output is somewhat like \Theta \frac{}{2\pi} > If I use > xlabel(r'$\frac{\Theta}{2\pi}$') > > it works fine. This is not a bug. Please keep in mind that usetex is really only an interf= ace=20 to latex. For problems specific to LaTeX, it would be best to consult the=20 appropriate sources or lists. As it happens, \frac is only allowed in math= =20 mode. That it produced any output at outside of mathmode is a case of faili= ng=20 silently. Does anyone know how to catch exit status using os.popen and friends? LaTeX= =20 would have returned an exit status of 1 for this example, which could be us= ed=20 to raise a warning. Darren |