Skip to content

BUG: Latex fails to render in Jupyter Notebook (in VS Code) #51940

@jrmagers

Description

@jrmagers

Pandas version checks

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

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

  • I have confirmed this bug exists on the main branch of pandas.

Reproducible Example

import pandas as pd
import numpy as np

df = pd.DataFrame(np.random.randn(3, 3), columns=list("ABC"))
df.style.format('$\\beta=$ {:.2%}').set_caption('This is the result with $\\alpha=5$')

Issue Description

When the code above is executed in a Jupyter notebook inside of VS code, the latex is not rendered:

image

Expected Behavior

The expected behavior is the following:

image

Notably, this output was produced by using VS Code Export to HTML (which works as expected).

Installed Versions

INSTALLED VERSIONS

commit : 2e218d1
python : 3.10.3.final.0
python-bits : 64
OS : Windows
OS-release : 10
Version : 10.0.19044
machine : AMD64
processor : Intel64 Family 6 Model 142 Stepping 12, GenuineIntel
byteorder : little
LC_ALL : None
LANG : None
LOCALE : English_United States.1252

pandas : 1.5.3
numpy : 1.22.3
pytz : 2022.1
dateutil : 2.8.2
setuptools : 58.1.0
pip : 23.0.1
Cython : None
pytest : None
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : 3.0.3
lxml.etree : 4.9.1
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : 3.1.2
IPython : 8.5.0
pandas_datareader: None
bs4 : 4.11.1
bottleneck : None
brotli : None
fastparquet : None
fsspec : 2022.8.2
gcsfs : None
matplotlib : 3.6.1
numba : 0.56.2
numexpr : None
odfpy : None
openpyxl : 3.0.10
pandas_gbq : None
pyarrow : None
pyreadstat : None
pyxlsb : None
s3fs : None
scipy : 1.9.1
snappy : None
sqlalchemy : None
tables : None
tabulate : None
xarray : 2022.12.0
xlrd : None
xlwt : 1.3.0
zstandard : None
tzdata : None

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugIO LaTeXto_latexNeeds InfoClarification about behavior needed to assess issueStylerconditional formatting using DataFrame.style

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions