
我的表格向右溢出,不適合列的大小。如何使其適合列而不減小字體大小?我無法減小表格的大小,因為我正在提交論文,並且他們有規定禁止減小表格的字體大小以適應頁面限制。
這是我正在使用的程式碼:
\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
列參數和行資料。