Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
ENH: Allow use of longtable package in to_latex. #6617
Closed
Commits
Jump to file or symbol
Failed to load files and symbols.
| @@ -1380,15 +1380,18 @@ def to_html(self, buf=None, columns=None, col_space=None, colSpace=None, | ||
| def to_latex(self, buf=None, columns=None, col_space=None, colSpace=None, | ||
| header=True, index=True, na_rep='NaN', formatters=None, | ||
| float_format=None, sparsify=None, index_names=True, | ||
| - bold_rows=True, force_unicode=None): | ||
| + bold_rows=True, force_unicode=None, longtable=False): | ||
| """ | ||
| - Render a DataFrame to a tabular environment table. | ||
| - You can splice this into a LaTeX document. | ||
| + Render a DataFrame to a tabular environment table. You can splice | ||
| + this into a LaTeX document. Requires \\usepackage(booktabs}. | ||
| `to_latex`-specific options: | ||
| bold_rows : boolean, default True | ||
| Make the row labels bold in the output | ||
| + longtable : boolean, default False | ||
| + Use a longtable environment instead of tabular. Requires adding | ||
| + a \\usepackage{longtable} to your LaTeX preamble. | ||
jorisvandenbossche
Owner
|
||
| """ | ||
| @@ -1409,7 +1412,7 @@ def to_latex(self, buf=None, columns=None, col_space=None, colSpace=None, | ||
| bold_rows=bold_rows, | ||
| sparsify=sparsify, | ||
| index_names=index_names) | ||
| - formatter.to_latex() | ||
| + formatter.to_latex(longtable=longtable) | ||
| if buf is None: | ||
| return formatter.buf.getvalue() | ||
@jorisvandenbossche I think this is being interpreted as unicode in the doc-string, maybe use a
ras a raw string?