Skip to content

BUG: to_latex(filename) truncates #41388

Closed
@michaelaye

Description

@michaelaye
  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of pandas.

  • (optional) I have confirmed this bug exists on the master branch of pandas.


Code Sample, a copy-pastable example

# Your code here
import pandas as pd
df = pd.DataFrame(
    {
        "Node": ["Atmosphere"],
        "Description": [
            "The Planetary Atmospheres Node (ATM) is responsible for the acquisition, preservation, and distribution of all non-imaging atmospheric data from NASA's planetary missions, including higher-order products derived from those data. In addition to providing user consultation, the node makes available a number of tools and services supporting researchers."
        ],
    }
)
df.to_latex('table.tex')

output created:

$ cat table.tex                                                                              (py39)
\begin{tabular}{lll}
\toprule
{} &        Node &                                                                                          Description \\
\midrule
0 &  Atmosphere &  The Planetary Atmospheres Node (ATM) is responsible for the acquisition, preservation, and distr... \\
\bottomrule
\end{tabular}

Problem description

According to what I have read in previous issues about to_latex(), it should not truncate by default for the file output (and it would be a bad API if it would).

Expected Output

A complete table in the output tex file.

Output of pd.show_versions()

INSTALLED VERSIONS

commit : 2cb9652
python : 3.8.8.final.0
python-bits : 64
OS : Darwin
OS-release : 19.6.0
Version : Darwin Kernel Version 19.6.0: Tue Jan 12 22:13:05 PST 2021; root:xnu-6153.141.16~1/RELEASE_X86_64
machine : x86_64
processor : i386
byteorder : little
LC_ALL : None
LANG : en_US.UTF-8
LOCALE : en_US.UTF-8

pandas : 1.2.4
numpy : 1.20.2
pytz : 2021.1
dateutil : 2.8.1
pip : 21.1.1
setuptools : 49.6.0.post20210108
Cython : 0.29.23
pytest : 6.2.4
hypothesis : None
sphinx : 3.5.4
blosc : None
feather : None
xlsxwriter : 1.4.2
lxml.etree : 4.6.3
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : 2.11.3
IPython : 7.23.1
pandas_datareader: None
bs4 : None
bottleneck : None
fsspec : 2021.04.0
fastparquet : None
gcsfs : None
matplotlib : 3.4.2
numexpr : 2.7.3
odfpy : None
openpyxl : 3.0.7
pandas_gbq : None
pyarrow : 4.0.0
pyxlsb : None
s3fs : None
scipy : 1.6.3
sqlalchemy : None
tables : 3.6.1
tabulate : None
xarray : 0.18.0
xlrd : 2.0.1
xlwt : 1.3.0
numba : 0.53.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions