[NumPy-Tickets] [NumPy] #1935: numpydoc - latex longtables error

NumPy Trac numpy-tickets@scipy....
Mon Aug 15 17:26:44 CDT 2011

#1935: numpydoc - latex longtables error
 Reporter:  matthew.brett  |       Owner:  somebody   
     Type:  defect         |      Status:  new        
 Priority:  normal         |   Milestone:  Unscheduled
Component:  Other          |     Version:  1.6.0      
 Keywords:                 |  
 I've run into an odd problem that seems to be an interaction of
 numpydoc and autosummary and large classes.

 In summary, large classes and numpydoc lead to large tables of class
 methods, and there seems to be an error in the creation of the large
 tables in latex.

 Specifically, if I run 'make latexpdf' with the attached minimal
 sphinx setup, I get a pdflatex error ending thus:

 l.118 \begin{longtable}{LL}

 and this is because longtable does not accept LL as an argument, but
 needs '|l|l|' (bar - el - bar - el - bar).

 I see in sphinx.writers.latex.py, around line 657, that sphinx knows
 about this in general, and long tables in standard ReST work fine with the
 el-bar arguments passed to longtable.

        if self.table.colspec:
            if self.table.has_problematic:
                colwidth = 0.95 / self.table.colcount
                colspec = ('p{%.3f\\linewidth}|' % colwidth) * \
                self.body.append('{|' + colspec + '}\n')
            elif self.table.longtable:
                self.body.append('{|' + ('l|' * self.table.colcount) +
                self.body.append('{|' + ('L|' * self.table.colcount) +

 However, using numpydoc and autosummary (see the conf.py file), what
 seems to happen is that, when we reach the self.table.colspec test at the
 beginning of the snippet above, 'self.table.colspec' is defined:

 In [1]: self.table.colspec
 Out[1]: '{LL}\n'

 and thus the LL gets written as the arg to longtable:


 and the pdf build breaks.

 I'm using the numpydoc out of the current numpy source tree.

Ticket URL: <http://projects.scipy.org/numpy/ticket/1935>
NumPy <http://projects.scipy.org/numpy>
My example project

More information about the NumPy-Tickets mailing list