ipy_table
ipy_table copied to clipboard
Added _repr_latex_ for latex support
My implementation of_repr_latex_ for Latex support. It is pretty much identical to Heoj’s, so maybe its a bit pointless.
neocarlitos & heoj,
Thank you very much, both of you, for your work on LaTeX support! Before working on these pulls I had no previous experience with the LaTeX syntax. As the IP[y] notebook model is moving toward nbconvert I definitely see the need to strive for LaTeX support so I'm on board with trying to get it working. I haven't yet dug into all the LaTeX syntax capabilities, so I don't yet know whether all of ipy_table's style options are achievable in LaTeX, but hopefully I can eventually support them all.
I've created a LaTeX branch to do work on LaTeX support and merged it with the last pull request from neocarlitos (as a starting point, since that pull adds color support). In that branch you'll find a new notebook "LaTeX_debugging.ipynb" which explains the issues I've found surrounding the debugging workflow for LaTeX development, issues with the current implementation, and some success criteria for LaTeX support. That notebook can be viewed in nbviewer here: http://nbviewer.ipython.org/github/epmoyer/ipy_table/blob/LaTeX/LaTeX_debugging.ipynb but some of the rendering issues discussed in that notebook can only be seen by running nbconvert, so you'll also need to look at the pdf version in the LaTeX branch (which was rendered though LaTeX using nbconvert).
In addition, if the LaTeX renderer is destined to support color then it should ultimately support the full standard pallet of named web colors (since that is what the HTML renderer supports). I haven't yet looked into whether there exists a Python library that can convert web color names to RGB; if so then I'll head down that path.
I need to go learn some LaTeX before I can start to resolve the current issues, so that's my next objective. I'd like to get to a point where the LaTeX renderer supports basic tables with colors and doesn't crash on any of the current styles (i.e. can parse the ipy_table-Reference.ipynb notebook without error), then extend the syntax from there to include as many style options as (easily) possible, maybe merge to master at that point, and then work on any remaining styles that are difficult to render in LaTeX.
Apologies for the delay; the day job has been overwhelming for a long time now and I finally got time over the holiday to work through the pulls.
Cheers!
Eric,
I've tried converting LaTeX_debugging.ipynb and ipy_table-Test.ipynb. They both seem ok. However, it does need the ipy_template.tplx to be used:
ipython nbconvert ipy_table-Test.ipynb --to latex --template ipy_template.tplx
otherwise, the \usepackages required are not included.
A few more adjustments are still required, for example escaping latex characters, etc.
Cheers!