[IPython-User] nbconvert rendering of iPython output cells represented by core.display classes
Wed Dec 26 16:23:01 CST 2012
On Wed, Dec 26, 2012 at 6:01 AM, Todd <firstname.lastname@example.org> wrote:
> are there python
> packages that render a python list of list into Latex?
This function convert a Numpy array or a list of lists into a Latex
table (without the headers, but that's easy to add).
It is based on this:
def array_to_tex(a, fmt=None):
"""Latex representation of a NumPy array.
If `fmt` is not `None` use it to format each entry of `a`, otherwise use
Based on http://bit.ly/Qrr9t4
if fmt is not None:
f = lambda x, fmt=fmt: fmt % x
f = str
s = ' \\\\\n'.join([' & '.join(map(f, line)) for line in a])
s += ' \\\\'
More information about the IPython-User