In [1]:
%run setup.ipynb
In [2]:
tbl = etl.wrap(
[['foo', 'bar', 'baz'],
[1, 'a', True],
[2, 'b', False]]
)
tbl
Out[2]:
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
In [ ]: