-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
ENC: better pandas typesetting in ipython nbconvert --to latex #9821
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Currently, when IPython notebooks are converted to latex, pandas `DataFrame`s are appear as raw (verbatim) text. One simple solution is to include a `_repl_latex_` function. I have tried this solution and works. See ipython/ipython#8261
This is a nice idea! Could you please add a basic test? Could be something as simple as Also, this will need a release note in the what's new: |
|
||
|
||
def _repr_latex_(self): | ||
return self.to_latex() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you add a comment to note that this is for ipython? adding a reference to this GH issue would probably also be a good idea.
Nice idea indeed, I was only wondering if there is a way to make this configurable? Maybe on the nbconvert side? |
Well, yes... I was thinking of a simple fix... but it would be nice to be able to pass options in the way that you can pass them no to |
We already have So that would be a pretty easy way to add this customization if you're interested. But (from my perspective), that shouldn't be a requirement for this PR. |
@lmarti can you update with a test and options as described above |
@jreback yes! in the next couple of days. Sorry for the delay. |
@lmarti can you add a test |
@lmarti can you add a basic tests for this? |
@lmarti pls update according to the comments |
@lmarti can you update according to comments |
I have sent a new PR (#11399) that contains all the requested modifications. Thanks for the wait. |
Currently, when IPython notebooks are converted to latex, pandas
DataFrame
s are appear as raw (verbatim) text. One simple solution is to include a_repl_latex_
function. I have tried this solution and works. See ipython/ipython#8261