[SciPy-dev] Latex and docstrings

David Cournapeau david@silveregg.co...
Tue Feb 9 20:12:14 CST 2010


Hi,

I noticed that some of the docstrings I have written for DCT have been 
changed to latex format. While I have no issue with having latex in the 
documentation, I thought the consensus was to use them sparingly in 
docstrings ?

For example, the dct I formula used to be (fixed width font assumed):

for 0 <= k < N,

                                    N-1
y[k] = x[0] + (-1)**k x[N-1] + 2 * sum x[n]*cos(pi*k*n/(N-1))
                                    n=0

But now, it is:

y_k = x_0 + (-1)^k x_{N-1} + 2\\sum_{n=1}^{N-2} x_n
         \\cos\\left({\\pi nk\\over N-1}\\right),
         \\qquad 0 \\le k < N.

I much prefer the former (the latter is unreadable in a terminal IMO). I 
have of course no issue in putting the latex formula in the scipy docs,

thanks,

David


More information about the SciPy-Dev mailing list