%3A%20%60c%60%EA%B0%80%20%EC%82%AC%EC%9A%A9%EB%90%98%EC%97%88%EC%8A%B5%EB%8B%88%EB%8B%A4..png)
왜 이 오류가 발생하나요?
내 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}
답변1
유형 c
열은 선택적 인수를 허용하지 않으므로 오류 메시지가 표시됩니다. 코드를 컴파일 가능하게 만들려면 c
를 S
. 후자는 패키지에 의해 정의된 열 유형으로 siunitx
, 특히 table-format
사용자가 사용한 옵션을 허용합니다. 숫자의 올바른 정렬과 올바른 열 너비를 얻으려면 table-format
해당 테이블 열의 내용에 따라 값도 수정해야 합니다. 다음 예에서는 @{\extracolsep{\fill}}
테이블이 지정된 너비만큼 넓고 열이 고르게 퍼지도록 추가했습니다 .
\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}