我需要用阿拉伯数字对所有表格进行编号。阿拉伯数字应该在表格标题中,例如:TABLE I, TABLE II
等。当我使用时 \ref{table:1}
。我添加了\renewcommand{\thetable}{\arabic{table}}
,没有变化。这是我的表格:
\documentclass{article}
\usepackage{booktabs,makecell,tabularx}
\renewcommand\theadfont{\small}
\newcolumntype{L}{>{\raggedright\arraybackslash}X}
\usepackage{siunitx}
\renewcommand{\thetable}{\arabic{table}}
\begin{document}
\section{Results}
This is my Table \ref{table:1}:
\begin{table}[h]
\centering
\setlength{\tabcolsep}{5pt}
\small
\begin{tabularx}{\textwidth}{c L S[table-format=6.0]*{2}{S[table-format=2.0]}}
\toprule
\thead{ID} & \thead{UCI Dataset Name}
& {\thead{Samples\\(numbers)}}
& {\thead{Attributes\\(numbers)}}
& {\thead{Classes\\number}} \\
\midrule
DS1 & Cardiotocography & 2126 & 23 & 3 \\
DS2 & Wall-Following Robot Navigation Data & 5456 & 24 & 4 \\
DS3 & Spambase & 4601 & 57 & 2 \\
DS4 & MAGIC Gamma Telescope & 19020 & 11 & 2 \\
DS5 & Letter Recognition & 20000 & 16 & 26 \\
DS6 & MiniBooNE particle identification & 130065& 50 & 2 \\
\bottomrule
\end{tabularx}
\caption{Datasets used for empirical evaluation}
\label{table:1}
\end{table}
\end{document}
答案1
这arabic
是表格的默认设置。如果需要表 I、表 II,则应进行更改\renewcommand{\thetable}{\Roman{table}}