Last active
August 1, 2021 10:00
-
-
Save fmitha/5b56efb42c6023db71d81c2aacaef4e4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
% Execute with `pdflatex lt3.tex` | |
% Please check whether the following LaTeX warning appears with the | |
% most recent version of Pandas, currently 1.3.0. This appears to be a | |
% bug in the Python library Pandas. | |
% LaTeX Warning: Label `table' multiply defined. | |
% [...] | |
% LaTeX Warning: There were multiply-defined labels. | |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
\documentclass[12pt, twoside=semi]{scrartcl} | |
\usepackage{longtable} | |
\usepackage{booktabs} | |
\begin{filecontents}[overwrite,noheader]{lt.py} | |
import pandas as pd | |
d = {'one': list(range(1, 50)), 'two': list(range(51, 100))} | |
df = pd.DataFrame(d) | |
with open('lt3inc.tex', 'w') as tf: | |
tf.write(df.to_latex(longtable=True, caption='Table', index=False, label='table')) | |
\end{filecontents} | |
\immediate\write18{python3 lt.py} | |
\begin{document} | |
\input{lt3inc.tex} | |
\end{document} | |
%%% Local Variables: | |
%%% mode: latex | |
%%% TeX-master: t | |
%%% End: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment