[IPython-User] nbconvert rendering of iPython output cells represented by core.display classes
Sun Dec 23 11:22:09 CST 2012
On Sun, Dec 23, 2012 at 6:08 PM, Todd Matthews <firstname.lastname@example.org> wrote:
> Happy to discover nbconvert and find how well it works - with it, iPython is
> destined to be the right direction for many work flows!
Thanks, for the kind words,
> What is required to represent content in iPython output cells with the
> IPython.core.display subpackages and then in the LaTeX produced code by
> For instance, for the following code -
> from IPython.core.display import HTML
> HTML("<b>This is a test</b> and only a test")
> renders the formatted HTML as expected in the iPython output cell. But,
> saving the ipynb and running it through nbconvert -f latex does not
> display the HTML. Instead, the object text is represented.
> <IPython.core.display.HTML at 0xa37276c>
> So, what is needed to display render the HTML table in latex from
> nbconvert? I suppose the question would be the same for other
> core.display types (figures, latex, etc). Being new to nbconvert (and
> iPython), I may be missing something. Or, perhaps this level of
I don't think there is any plan yet to have a full HTML > latex conversion,
The plan is for object to define a wide range of repr, and use those
when doing the conversion.
So if you have an object with a table representation, then it probably
can have a table representation in latex also.
We try to make nbconvert as modular as possible, so that if you wish
to have a custom converter you just have to
overwrite the fonction that generate anlatex from cell output.
in your case, that would be looking at wether there is HTML and
convert this to latex.
What I would suggest is having a Table object, that have _repr_latex_
and _repr_latex_ (maybe even a _repr_pretty_)
then at convert time, the converter will choose the appropriate
More information about the IPython-User