pgfplotstable:当存在“S”时解析字符串数据

pgfplotstable:当存在“S”时解析字符串数据

下表有效:

\documentclass[border=5mm]{standalone}
\usepackage{siunitx}
\usepackage{pgfplotstable}
\usepackage{booktabs}
\begin{document}

   \pgfplotstabletypeset[
    columns/0/.style={
        column name=z,
        string type},
    columns/1/.style={
        column name=x,
        string type,
        column type={S[table-format=2.1]},
    },
    columns/2/.style={
        column name={y},
        string type,
        column type={S[table-format=3.0]},
    },
    columns/3/.style={
        column name={y},
        string type,
        column type={S[table-format=2.0]},
    },
    columns/4/.style={
        column name={y},
        string type,
        column type={S[table-format=2.0]},
    },
    every head row/.style={before row=\toprule,after row=\midrule},
    every last row/.style={after row=\bottomrule},
   ]{
2017-09-26    9.2    144 80  62
2017-09-27   10.2    144 80  62
   }
\end{document}

但如果我在第一列之后添加一列时间列(参见姆韦下面),我收到错误:

 Package PGF Math Error: Could not parse input 2017-09-27 as a floating point number, sorry. The unreadable part was near ?-09-27'..

这不起作用:

\documentclass[border=5mm]{standalone}
\usepackage{siunitx}
\usepackage{pgfplotstable}
\pgfplotsset{compat=1.15}
\usepackage{booktabs}

\begin{document}
   \pgfplotstabletypeset[
    columns/0/.style={
        column name=z,
        string type},
    columns/1/.style={
        column name=z,
        string type},
    columns/2/.style={
        column name=x,
        string type,
        column type={S[table-format=2.1]},
    },
    columns/3/.style={
        column name={y},
        string type,
        column type={S[table-format=3.0]},
    },
    columns/4/.style={
        column name={y},
        string type,
        column type={S[table-format=2.0]},
    },
    columns/5/.style={
        column name={y},
        string type,
        column type={S[table-format=2.0]},
    },
    every head row/.style={before row=\toprule,after row=\midrule},
    every last row/.style={after row=\bottomrule},
   ]{
2017-09-26   9:00    9.2    144 80  62
2017-09-27  11:30   10.2    144 80  62
   }
\end{document}

为什么现在第一列没有像第一个例子那样进行解析?

相关内容