0

The following example gives

! 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.

I'm really struggling to understand what these 18 errors refer to. Here is my 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}

Thanks for any help

6
  • 3
    it is complaining about the[ in X[table... tabularx X columns have no [..] syntax. Feb 11, 2020 at 18:11
  • How would I resolve it? Feb 11, 2020 at 19:03
  • 3
    You haven't said what you want to do, only posted some code with a syntax error. I guess you could remove [table-format=3.2, round-integer-to-decimal, round-mode = places, round-precision = 2] if you want to use X or perhaps you meant to use S[table-format=3.2, round-integer-to-decimal, round-mode = places, round-precision = 2] with S from the siunitx package? Feb 11, 2020 at 19:07
  • I would like to use spreadtab with full pagewidth option, and with my tabularx values as stated above, if possible. Thanks :) Feb 11, 2020 at 20:09
  • 3
    but X[...] isn't a tabularx syntax, you presumably intended it to do something but it's just a syntax error. so "as stated above" doesn't really help say what you intended. I guess you intended S but that's a guess. Feb 11, 2020 at 20:11

1 Answer 1

1

Is this what you are looking for?

enter image description here

\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}
1
  • Hey. Can I ask how does \hsize=0.6\hsize work here? I came across this construct before. Thanks.
    – Celdor
    Jul 1, 2022 at 12:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .