我正在尝试将一个非常长的 csv 文件读入 longtable,但在编译时出现错误missing \endgroup inserted
。我不知道缺少了什么。
\documentclass{standalone}
\usepackage{csvsimple}
\usepackage{rotating}
\usepackage{tabularx}
\usepackage{longtable}
\usepackage{booktabs}
\begin{document}
%\begin{sidewaystable}
\begin{longtable}{c|c|c|c|c|c|c|c}%
\toprule
\bfseries Obsid & \bfseries Source & \bfseries Raw Soft Counts & \bfseries Raw Medium Counts & \bfseries Raw Hard Counts & \bfseries Background Soft Counts & \bfseries Background Medium Counts & \bfseries Background Hard Counts % specify table head
\\&&\bfseries (.3-1.0 keV)&\bfseries (1.0-2.1 keV)&\bfseries (2.1-7.5 keV)&\bfseries (.3-1.0 keV)&\bfseries (1.0-2.1 keV)&\bfseries (2.1-7.5 keV) \\
\midrule \endhead
\bottomrule \endfoot
\csvreader[
late after line=\\,
late after last line=,
before reading={\catcode`\#=12},
after reading={\catcode`\#=6},
respect all,
head to column names]%
{counts_info_from_csc.csv}{RAW_COUNTS[.3-1]=\rawcountsS,RAW_COUNTS[1-2.1]=\rawcountsM,RAW_COUNTS[2.1-7.5]=\rawcountsH,BKG_COUNTS[.3-1]=\bkgcountsS,BKG_COUNTS[1-2.1]=\bkgcountsM,BKG_COUNTS[2.1-7.5]=\bkgcountsH}{\OBSID & \SOURCE & \rawcountsS & \rawcountsM & \rawcountsH & \bkgcountsS & \bkgcountsM & \bkgcountsH}%
\end{longtable}
%\end{sidewaystable}
\end{document}
csv 文件是读入正确;当我尝试用tabular
而不是 时,longtable
它确实读入,但底部被截断。我搞不清楚缺少了什么。