ENH: Styler.to_latex() · Issue #21673 · pandas-dev/pandas (original) (raw)

I have created a branch adding a to_latex method to Styler.

It is nowhere near readiness, and in particular:

This said, if anyone feels like experimenting, it might be slightly better than starting from scratch.

One aspect which I think is useful, even aside from this branch, and might benefit some discussion, is the pair of methods _latex_preserve and _latex_restore, which basically replace LaTeX commands so that they are not disturbed by escaping, and then restores them. There might be better way to code this, but I really think this is something we need to implement, and to offer to users who happen to nest LaTeX code in their cells.