表格内的数字以粗体显示

表格内的数字以粗体显示

我有一个包含准确度结果的大表格(59 行 11 列)。 在此处输入图片描述

观察粗体数字看起来比常规数字大很多。我想要这样的东西: 在此处输入图片描述

以下是代码:

\documentclass{article}

\usepackage{tabularx}
\usepackage{booktabs}

\begin{document}
\begin{table}[!htbp]
  \scriptsize %\footnotesize
  \centering
    \caption{Summary of mean accuracy results of the second experiment.}
    \hspace*{-1cm} 
    \begin{tabularx}{1.15\linewidth}{Xlllllllll|l}
    \toprule
    Datasets  & {\sc Scg-$\kappa$} & {\sc Scg-mi} & {\sc Gasen} & {\sc Mdsq} & {\sc Re} & {\sc OO} & {\sc Kappa} & {\sc CC} & {\sc BB} & {\sc Bagging} \\
    \midrule
    Anneal & \textbf{83.54} & \textbf{83.54} & 82.78 & 82.78 & 82.78 & 79.11 & 78.33 & 82.34 & 78.35 & 82.78 \\
    Audiology & \textbf{47.17} & 47.08 & 46.46 & 46.46 & 46.46 & 46.46 & 46.46 & 46.46 & 46.46 & 46.46 \\
    Australian  & \textbf{85.51} & \textbf{85.51} & \textbf{85.51} & \textbf{85.51} & \textbf{85.51} & \textbf{85.51} & \textbf{85.51} & \textbf{85.51} & \textbf{85.51} & \textbf{85.51} \\
    \midrule
    \textbf{Average ranks} & \textbf{3.14} & \textbf{3.86} & \textbf{4.69} & \textbf{4.94} & \textbf{4.58} & \textbf{6.66} & \textbf{7.03} & \textbf{8.15} & \textbf{6.62} & \textbf{5.34} \\
    \bottomrule
    \end{tabularx}%
  \label{tab5_3}%
\end{table}%

\end{document}

有什么建议么?

答案1

您可以使用https://tex.stackexchange.com/a/334323/4427

\documentclass{article}

\usepackage{lmodern}
\usepackage{siunitx}
\usepackage{booktabs}
\usepackage{etoolbox}

\begin{document}

\begin{table}[!htbp]
\small
%\scriptsize
%\footnotesize
\centering

\caption{Summary of mean accuracy results of the second experiment.}
\label{tab5_3}

%% local settings
\sisetup{detect-weight,mode=text}
% for avoiding siunitx using bold extended
\renewrobustcmd{\bfseries}{\fontseries{b}\selectfont}
\renewrobustcmd{\boldmath}{}
% abbreviation
\newrobustcmd{\B}{\bfseries}
% shorten the intercolumn spaces
\addtolength{\tabcolsep}{-4.1pt}

\begin{tabular}{ @{} l *{10}{S[table-format=2.2]} @{} }
\toprule
Datasets  &
  {\scshape Scg-$\kappa$} & {\scshape Scg-mi} &
  {\scshape Gasen} & {\scshape Mdsq} &
  {\scshape Re} & {\scshape OO} &
  {\scshape Kappa} & {\scshape CC} &
  {\scshape BB} & {\scshape Bagging} \\
\midrule
Anneal &
  \B 83.54 & \B 83.54 & 82.78 & 82.78 & 82.78 & 79.11 & 78.33 & 82.34 & 78.35 & 82.78 \\
Audiology &
  \B 47.17 & 47.08 & 46.46 & 46.46 & 46.46 & 46.46 & 46.46 & 46.46 & 46.46 & 46.46 \\
Australian &
  \B 85.51 & \B 85.51 & \B 85.51 & \B 85.51 & \B 85.51 & \B 85.51 & \B 85.51 & \B 85.51 & \B 85.51 & \B 85.51 \\
\midrule
\B Average ranks &
  \B 3.14 & \B 3.86 & \B 4.69 & \B 4.94 & \B 4.58 & \B 6.66 & \B 7.03 & \B 8.15 & \B 6.62 & \B 5.34 \\
\bottomrule
\end{tabular}

\end{table}

\end{document}

在此处输入图片描述

相关内容