I'm trying to make a multi-page table from a txt file by using longtable and pgfplotstable. For some reason, whenever I use
"display columns/0/.style={column name={Col0}}"
for example, the column name doesn't print. I am a beginner so I'm just a bit confused.
I've been through the documentation for pgfplotstable and been trying to debug for hours, but I can't figure it out.
My MWE:
\documentclass{article}
\usepackage{booktabs} % For \toprule, \midrule and \bottomrule
\usepackage{siunitx} % Formats the units and values
\usepackage{pgfplotstable} % Generates table from .csv
\usepackage{longtable} % To display tables on several pages
\usepackage{array}
\usepackage{bm}
\usepackage{hyperref}
\pgfplotsset{compat=1.14} %I was getting backwards compatibility errors
\begin{document}
%%% Code from Dr. Christian for not using headers
\pgfkeysifdefined{/pgfplots/table/output empty row/.@cmd}{
\pgfplotstableset{
empty header/.style={
every head row/.style={output empty row},
}
}
}
\pgfplotstableset{
begin table=\begin{longtable},
end table=\end{longtable},
}
\pgfplotstabletypeset[
empty header,
col sep=space,
column type/.add={|}{},
every head row/.append style={
before row={%
\caption{The caption}
\label{tab:DataTable}
\\ \toprule
\\ \midrule
\endfirsthead
%
\multicolumn{3}{c}{{\bfseries \tablename\ \thetable{} -- continued from previous page}}
\\ \toprule
\\ \midrule
\\ \endhead
%
\midrule
\multicolumn{3}{r}
{{Continued on next page}}
\\ \bottomrule
\endfoot
%
\midrule
\multicolumn{3}{r}{}
\\ \bottomrule
\endlastfoot
}
},
display columns/0/.style={
dec sep align,
sci, sci zerofill,
column name={RA}
},
display columns/1/.style={
dec sep align,
sci, sci zerofill,
column name={Dec}
},
display columns/2/.style={
dec sep align,
sci, sci zerofill,
column type/.add={}{|},
column name={S}
}
]{ra_dec_aveflux_Jy.txt}
\end{document}
UPDATE: Here is a sample of my txt file:
1e+01 2e+01 3e+01
4e+01 5e+01 6e+01
7e+01 8e+01 9e+01