如何在 pgfplotstable 中包装和居中标题以及右对齐列数据

如何在 pgfplotstable 中包装和居中标题以及右对齐列数据

我正在使用 pgfplotstable 将 csv 数据导入表格。标题需要很长的单词,占用太多宽度,需要换行,行内容只有大约 14 个字符(小数)。到目前为止,我能够换行并居中,而无需右对齐数据,或者右对齐而不换行。我需要两者。

    \pgfplotstabletypeset[col sep=comma, every head row/.style={before row=\toprule, after row=\midrule\endhead}, 
every last row/.style={after row=\bottomrule},
columns={pn,DetConv,DetTak,HypConv,HypTak}, 
columns/pn/.style={column name=$p_n$,fixed,precision=1},
    columns/DetConv/.style={column type=r, column name=Deterministic - Convolution,fixed,fixed zerofill,precision=12},
    columns/DetTak/.style={column type=r, column name=Deterministic - Takacs,fixed,fixed zerofill,precision=12},
    columns/HypConv/.style={column type=r, column name=Hyperexponential - Convolution,fixed,fixed zerofill,precision=12},   
columns/HypTak/.style={column type=r, column name=Hyperexponential - Takacs,fixed,fixed zerofill,precision=12}
    ]{table.csv}

我发现了一个“黑匣子”建议,即使用 \newcolumntype{C}{>{\centering\arraybackslash}m{8em}},它给出了正确的标题,但没有右对齐数据。没有解释这些参数实际上在做什么,也没有解释在哪里可以找到更多信息(pgfplotstable 手册中没有提供样式选项)。如果能做到这一点就好了,但到目前为止已经浪费了很多时间——如果能提出有用的建议就好了。

相关内容