tabularx 和 spreadtab:包数组错误:非法的 pream-token(

tabularx 和 spreadtab:包数组错误:非法的 pream-token(

以下示例给出

! Package array Error:  Illegal pream-token ([): `c' used.
! Package array Error:  Illegal pream-token (t): `c' used.
! Package array Error:  Illegal pream-token (a): `c' used.
...(e) ...(-) ...(f) ...(o) ...(=) ...(3) ...(.) ...(2)
...(,) ...(u) ...(i) ...(g) ...(d) ...(s) ...(]): `c' used.

我真的很难理解这 18 个错误指的是什么。这是我的 main.tex:

\documentclass{article}
\usepackage[a4paper, margin=2cm]{geometry}
\usepackage{datetime}
\usepackage{spreadtab}
\usepackage{numprint}
 \npdecimalsign{.}
\usepackage{tabularx}
\setlength\parindent{0pt}
\hbadness=99999  % or any number >=10000
\begin{document}

\STautoround*{2}
\begin{spreadtab}{{tabularx}{\textwidth}{ 
   >{\raggedright\arraybackslash\hsize=0.6\hsize}X 
   >{\raggedright\arraybackslash\hsize=1.8\hsize}X
   >{\raggedleft\arraybackslash\hsize=0.6\hsize}X[table-format=3.2, round-integer-to-decimal, round-mode = places, round-precision = 2] }}
    \textbf{@Date} & \textbf{@Description} & \textbf{@Amount}\\
    \hline
     @Jan 2019 & @Bookkeeping and Accounts & 44.30tag(lastrow)\\ %tag(lastrow)
    %  & @Year End 2019 & 6.31\\
    %  & @Payroll & 2.05tag(lastrow)\\
     \hline
     & @\textbf{TOTAL} & sum(c1:cell(lastrow))\\
\end{spreadtab}

\end{document}

谢谢你的帮助

答案1

这是你想要的?

在此处输入图片描述

\documentclass{article}
\usepackage[a4paper, margin=2cm]{geometry}
\usepackage{datetime}
\usepackage{spreadtab}
\usepackage{numprint}
\npdecimalsign{.}
\usepackage{tabularx}
\setlength\parindent{0pt}
\hbadness=99999  % or any number >=10000
\begin{document}

\STautoround*{2}
\begin{spreadtab}{{tabularx}{\textwidth}{ 
   >{\raggedright\arraybackslash\hsize=0.6\hsize}X 
   >{\raggedright\arraybackslash\hsize=1.8\hsize}X
   >{\raggedleft\arraybackslash\hsize=0.6\hsize}X}}

    \textbf{@Date} & \textbf{@Description}     & \textbf{@Amount}       \\ \hline
     @Jan 2019     & @Bookkeeping and Accounts & 44.30tag(lastrow)      \\
                   & @Year End 2019            & 6.31                   \\
                   & @Payroll                  & 2.05                    \\  \hline
                   & @\textbf{TOTAL}           & sum(c1:cell(lastrow))   \\
\end{spreadtab}

\end{document}

相关内容