In [1]:
%run setup.ipynb



In [2]:
tbl = etl.wrap(
    [['foo', 'bar', 'baz'],
     [1, 'a', True],
     [2, 'b', False]]
)
tbl


Out[2]:
0|foo 1|bar 2|baz
1 a True
2 b False

In [3]:
prologue = r"""
\begin{tabular}{rll}
\toprule
Foo & Bar & Baz \\
\midrule
"""
template = r"""
{foo} & {bar} & {baz} \\
"""
epilogue = r"""
\bottomrule
\end{tabular}
"""
tbl.totext('../tables/demo.tex', 
           encoding='ascii',
           prologue=prologue, 
           template=template,
           epilogue=epilogue)

In [4]:
!cat ../tables/demo.tex


\begin{tabular}{rll}
\toprule
Foo & Bar & Baz \\
\midrule

1 & a & True \\

2 & b & False \\

\bottomrule
\end{tabular}

In [ ]: