我的表格溢出到右侧,无法容纳列的大小。如何才能使其容纳列,而不减小字体大小?我无法减小表格的大小,因为我正在提交论文,并且他们有规定禁止减小表格的字体大小以适应页面限制。
下面是我使用的代码:
\documentclass[sigconf]{acmart}
\usepackage{booktabs} % For formal tables
\usepackage{algorithmic}
\usepackage{fixltx2e}
\usepackage{algorithm}
\usepackage{enumitem}
\usepackage{multirow}
\usepackage{hhline}
\usepackage{amsmath}
\usepackage{lmodern}
\usepackage[T1]{fontenc}
\newcommand\vn[1]{\mathit{#1}} % or: \mathrm{#1}
\newcommand\Or{\mathrel{\big\Vert}}
\setcopyright{acmcopyright}
% DOI
\acmDOI{xx.xxx/xxx_x}
% ISBN
\acmISBN{978-1-4503-8104-8/21/03}
%Conference
\acmConference[SAC'21]{ACM SAC Conference}{March 22-March 26, 2021}{Gwangju, South Korea}
\acmYear{2021}
\copyrightyear{2021}
%\thispagestyle{plain}
\acmArticle{4}
\acmPrice{15.00}
\pagestyle{plain}
\settopmatter{printfolios=true}
\begin{document}
\title{test}
\author{Anonymous Author(s)}
\begin{abstract}
abstract
\end{abstract}
\maketitle
{NoCallers/NoCallees}$=$0\\
{LowCallers/LowCallees}$=$1\\
1$<${LowCallers/LowCallees}$<=$5\\
5$<${HighCallers/HighCallees}
\begin{table}
\setlength{\tabcolsep}{2.5pt}
\centering
\caption{Quantifying the requirement-to-method rtm\textsubscript{m} Input Gold Standard}
\label{GoldStandardInputCompleteness}
\tabcolsep=2.5pt
\begin{tabular}{|r|r|r|r|r|r|r|r|}
\hline \textbf{System}
& \textbf{T\textsubscript{m}(\#)} & \textbf{N\textsubscript{m}(\#)} &
\textbf{U\textsubscript{m}(\#)}&
\textbf{Total} & \textbf{T\textsubscript{m}(\%)} &
\textbf{N\textsubscript{m}(\%)} & \textbf{U\textsubscript{m}(\%)} \\ \hline
\textbf{Chess} & 563 & 2389 & 3064 & \textbf{6016} & 9.36 & 39.71 & 50.93 \\ \hline
\textbf{Gantt} & 343 & 23166 & 66725 & \textbf{90234} & 0.38 & 25.67 & 73.95 \\
\hline
\textbf{iTrust} & 307 & 7173 & 159562 & \textbf{167042} & 0.18 & 4.30 & 95.52 \\
\hline
\textbf{JHot.} & 439 & 12219 & 124262 & \textbf{136920} & 0.32 & 8.92 & 90.76 \\
\hline
\end{tabular}
\end{table}
\end{document}
答案1
您可以通过减小几列的宽度来使表格适合。
% acmtableprob.tex SE 562055
\documentclass[sigconf]{acmart}
\usepackage{booktabs} % For formal tables
\usepackage{algorithmic}
\usepackage{fixltx2e}
\usepackage{algorithm}
\usepackage{enumitem}
\usepackage{multirow}
\usepackage{hhline}
\usepackage{amsmath}
\usepackage{lmodern}
\usepackage[T1]{fontenc}
\newcommand\vn[1]{\mathit{#1}} % or: \mathrm{#1}
\newcommand\Or{\mathrel{\big\Vert}}
\setcopyright{acmcopyright}
% DOI
\acmDOI{xx.xxx/xxx_x}
% ISBN
\acmISBN{978-1-4503-8104-8/21/03}
%Conference
\acmConference[SAC'21]{ACM SAC Conference}{March 22-March 26, 2021}{Gwangju, South Korea}
\acmYear{2021}
\copyrightyear{2021}
%\thispagestyle{plain}
\acmArticle{4}
\acmPrice{15.00}
\pagestyle{plain}
\settopmatter{printfolios=true}
\begin{document}
\title{test}
\author{Anonymous Author(s)}
\begin{abstract}
abstract
\end{abstract}
\maketitle
{NoCallers/NoCallees}$=$0\\
{LowCallers/LowCallees}$=$1\\
1$<${LowCallers/LowCallees}$<=$5\\
5$<${HighCallers/HighCallees}
\begin{table}
\setlength{\tabcolsep}{2.5pt}
\centering
\caption{Quantifying the requirement-to-method rtm\textsubscript{m} Input Gold Standard}
\label{GoldStandardInputCompleteness}
\tabcolsep=2.5pt
\begin{tabular}{|r|p{2em}|p{3em}|p{3em}|r|p{2em}|p{2.5em}|p{2.5em}|}
\hline \textbf{System}
& \textbf{T\textsubscript{m} (\#)} & \textbf{N\textsubscript{m} (\#)} &
\textbf{U\textsubscript{m} (\#)}&
\textbf{Total} & \textbf{T\textsubscript{m} (\%)} &
\textbf{N\textsubscript{m} (\%)} & \textbf{U\textsubscript{m} (\%)} \\ \hline
\textbf{Chess} & 563 & 2389 & 3064 & \textbf{6016} & 9.36 & 39.71 & 50.93 \\ \hline
\textbf{Gantt} & 343 & 23166 & 66725 & \textbf{90234} & 0.38 & 25.67 & 73.95 \\
\hline
\textbf{iTrust} & 307 & 7173 & 159562 & \textbf{167042} & 0.18 & 4.30 & 95.52 \\
\hline
\textbf{JHot.} & 439 & 12219 & 124262 & \textbf{136920} & 0.32 & 8.92 & 90.76 \\
\hline
\end{tabular}
\end{table}
\end{document}
它适合但对我来说看起来不太好。如果你对它满意,那就去做吧,否则尝试调整列tabular
参数和行数据。