Skip to content

Instantly share code, notes, and snippets.

@bstellato
Created February 1, 2021 14:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bstellato/ef82bd272bb1dcf37595c5c93f33042c to your computer and use it in GitHub Desktop.
Save bstellato/ef82bd272bb1dcf37595c5c93f33042c to your computer and use it in GitHub Desktop.
Booktabs table from csv
\usepackage{booktabs}
\usepackage{csvsimple}
...
...
\begin{table}
\centering
\caption{Example table.}
\label{tab:tablelabel}
\begin{tabular}{ll}
\toprule
$A$ & $B$\\
\midrule
% Add directly from csv reader
% the csv file has names colnameA, colnameB
\csvreader[head to column names, late after line=\\]{./data_file.csv}{
colnameA=\colA,
colnameB=\colB
}{\colA & \colB}
\bottomrule
\end{tabular}
\end{table}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment