我在使用 tabularx 环境和 pgfplotstable 包时遇到了麻烦。只要我在 tabularx 中指定列类型,就会收到一系列错误。如果没有指定列类型,代码就会运行。不用说,我正在使用 tabularx 来指定列类型 ;-)
任何帮助都将不胜感激!
% minimal example
\documentclass{article}
\usepackage{pgfplotstable}
\usepackage{array}
\usepackage{booktabs}
\usepackage{tabularx}
\begin{filecontents*}{dummyData.csv}
median,Q1,Q3,IQR,QGR2,QGR3,mean,std,N
1,2,3,4,5,6,7,8,22
1,2,3,4,5,6,7,8,10
\end{filecontents*}
\begin{document}
% doesn't work
\pgfplotstableset{
begin table=\begin{tabularx}{\textwidth}{XXXXXXXXX},
end table=\end{tabularx}
}
% works
%\pgfplotstableset{
% begin table=\begin{tabularx}{\textwidth},
% end table=\end{tabularx}
%}
\begin{table}[!h]
\centering
\pgfplotstabletypeset[
col sep = comma,
every column/.style={fixed, fixed zerofill, precision=1,dec sep align},
every head row/.style={before row=\toprule},
every last row/.style={after row=\bottomrule},
string type
]{dummyData.csv}
\end{table}
\end{document}