jupyter-book / jupyter-book

Create beautiful, publication-quality books and documents from computational content.
http://jupyterbook.org
BSD 3-Clause "New" or "Revised" License
3.86k stars 661 forks source link

LaTeX not rendered in DataFrame.Styler with HTML output #1826

Open quantitative-technologies opened 2 years ago

quantitative-technologies commented 2 years ago

Describe the bug

I have latex in my formatted DataFrame. When I run the code cell in jupyter-lab the latex gets correctly rendered:

Screenshot_2022-08-31_20-59-17

However, when I build the book from the console, the latex does not render:

$ jupyter-book build test-issue

is shown in the browser as:

Screenshot_2022-08-31_21-04-57

This may be related to #1501.

Reproduce the bug

Here is the code cell of my MyST Markdown notebook:

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$')

List your environment

Jupyter Book : 0.13.0 External ToC : 0.2.4 MyST-Parser : 0.15.2 MyST-NB : 0.13.2 Sphinx Book Theme : 0.3.2 Jupyter-Cache : 0.4.3 NbClient : 0.5.13

xgarrido commented 1 year ago

I'm also facing this issue. Is there any workaround or any news on how to fix it ?

alcrene commented 1 year ago

@xgarrido @jrmagers If you are still looking for a workaround, I posted one in the original issue. It’s not perfect but at least for me it is serviceable.

jrmagers commented 1 year ago

Thanks!

On Fri, Sep 15, 2023 at 7:33 AM Alexandre René @.***> wrote:

@xgarrido https://github.com/xgarrido @jrmagers https://github.com/jrmagers If you are still looking for a workaround, I posted one https://github.com/executablebooks/jupyter-book/issues/1501#issuecomment-1721378476 in the original issue. It’s not perfect but at least for me it is serviceable.

— Reply to this email directly, view it on GitHub https://github.com/executablebooks/jupyter-book/issues/1826#issuecomment-1721383193, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADSGCFMQOE7RKQVQ7IC65XLX2RRNNANCNFSM6AAAAAAQBNKOOM . You are receiving this because you were mentioned.Message ID: @.***>