Erro: Matriz de pacote Erro: pream-toke ilegal ([): `c` usado

Erro: Matriz de pacote Erro: pream-toke ilegal ([): `c` usado

Por que tenho esse erro?

insira a descrição da imagem aqui

Meu MWE:

\documentclass[12pt,oneside]{book}

\usepackage[showframe]{geometry}
\usepackage{amsmath}
\usepackage{ragged2e}
\usepackage{booktabs, makecell, multirow, tabularx,
            threeparttable, tabulary}
\renewcommand\theadfont{\small\bfseries} % for bold in table using \small
\renewcommand\theadgape{}
\usepackage[svgnames, table]{xcolor}
\usepackage{siunitx} %for table spacing to second row
\usepackage{graphicx}

\usepackage[font=small,
            labelfont={bf,sf}, textfont={sf}, 
            justification=centering]{caption}

\begin{document}


\begin{table}[h!]
\centering 
\begin{tabular*}{0.80\textwidth}{
  @{}
  l
  c[table-format=6]
  c[table-format=6]
  c[table-format=6]
  c[table-format=6]
  @{}  
}
\toprule
{\thead{Sample Setting \\ Configuration}} 
  & {\thead{Verification \\ 
  Status}}
  & {\thead{Precision \\ (\textit{P})}}
  & {\thead{Recall \\ (\textit{R}) }}
  & {\thead{\textit{F}-samples }} \\
\midrule

No. 4   &   66.07   &   0.6786  &   0.6552  &   0.6667  \\
No. 5   &   71.43   &   0.7097  &   0.7586  &   0.7333  \\


\bottomrule
\end{tabular*}
\end{table}



\end{document}

Responder1

A ccoluna type não aceita um argumento opcional, daí a mensagem de erro que você recebe. Para tornar seu código compilável, substitua cpor S. Este último é um tipo de coluna definido pelo siunitxpacote, que, entre outras, aceita a table-formatopção que você utilizou. Para obter o alinhamento correto dos números, bem como as larguras corretas das colunas, você também deve corrigir os valores de table-formatacordo com o conteúdo das colunas correspondentes da tabela. No exemplo a seguir, também adicionei @{\extracolsep{\fill}}para garantir que a tabela seja tão larga quanto a largura especificada, enquanto as colunas estão distribuídas uniformemente:

insira a descrição da imagem aqui

\documentclass[12pt,oneside]{book}

\usepackage[showframe]{geometry}
\usepackage{amsmath}
\usepackage{ragged2e}
\usepackage{booktabs, makecell, multirow, tabularx,
            threeparttable, tabulary}
\renewcommand\theadfont{\small\bfseries} % for bold in table using \small
\renewcommand\theadgape{}
\usepackage[svgnames, table]{xcolor}
\usepackage{siunitx} %for table spacing to second row
\usepackage{graphicx}

\usepackage[font=small,
            labelfont={bf,sf}, textfont={sf}, 
            justification=centering]{caption}

\begin{document}


\begin{table}[h!]
\centering 
\begin{tabular*}{0.80\textwidth}{
  @{}
  @{\extracolsep{\fill}}
  l
  S[table-format=2.2]
  S[table-format=1.4]
  S[table-format=1.4]
  S[table-format=1.4]
  @{}  
}
\toprule
{\thead{Sample Setting \\ Configuration}} 
  & {\thead{Verification \\ 
  Status}}
  & {\thead{Precision \\ (\textit{P})}}
  & {\thead{Recall \\ (\textit{R}) }}
  & {\thead{\textit{F}-samples }} \\
\midrule

No. 4   &   66.07   &   0.6786  &   0.6552  &   0.6667  \\
No. 5   &   71.43   &   0.7097  &   0.7586  &   0.7333  \\


\bottomrule
\end{tabular*}
\end{table}



\end{document}

informação relacionada