Skip to content

Commit

Permalink
Merge 25f08ad into c299e3f
Browse files Browse the repository at this point in the history
  • Loading branch information
toobaz committed Feb 28, 2014
2 parents c299e3f + 25f08ad commit 6cc331c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions statsmodels/iolib/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -403,13 +403,14 @@ def as_html(self, **fmt_dict):
formatted_rows.extend( row.as_string('html', **fmt) for row in self )
formatted_rows.append('</table>')
return '\n'.join(formatted_rows)
def as_latex_tabular(self, **fmt_dict):
def as_latex_tabular(self, center=True, **fmt_dict):
'''Return string, the table as a LaTeX tabular environment.
Note: will require the booktabs package.'''
#fetch the text format, override with fmt_dict
fmt = self._get_fmt('latex', **fmt_dict)

formatted_rows = ["\\begin{center}"]
if center:
formatted_rows = ["\\begin{center}"]

table_dec_above = fmt['table_dec_above'] or ''
table_dec_below = fmt['table_dec_below'] or ''
Expand Down Expand Up @@ -442,7 +443,8 @@ def as_latex_tabular(self, **fmt_dict):
if self.title:
title = r'%%\caption{%s}' % self.title
formatted_rows.append(title)
formatted_rows.append( "\\end{center}" )
if center:
formatted_rows.append( "\\end{center}" )
return '\n'.join(formatted_rows)
"""
if fmt_dict['strip_backslash']:
Expand Down

0 comments on commit 6cc331c

Please sign in to comment.