我有下面显示的脚本。问题是表格字体大小大于我在第一行指定的文档字体大小。如何使表格字体使用与文档其余部分相同的字体大小。
\documentclass[compsoc, conference, letterpaper, 10pt, times]{IEEEtran}
\ifCLASSOPTIONcompsoc
% IEEE Computer Society needs nocompress option
% requires cite.sty v4.0 or later (November 2003)
\usepackage[nocompress]{cite}
\else
\usepackage{cite}
\fi
\ifCLASSINFOpdf
\else
\fi
\usepackage{graphicx} %for images
\usepackage{array}
\usepackage{booktabs}
\usepackage{multirow}
\newcommand{\head}[1]{\textnormal{\textbf{#1}}}
\newcommand{\normal}[1]{\multicolumn{1}{l}{#1}}
\usepackage{amssymb}% http://ctan.org/pkg/amssymb
\usepackage{pifont}% http://ctan.org/pkg/pifont
\newcommand{\cmark}{\ding{51}}%
\newcommand{\xmark}{\ding{55}}%
\newcommand*\rot{\rotatebox{90}}
\begin{document}
\title{Test Document}
% make the title area
\maketitle
\section{Introduction}
This is an introduction.
\begin{table}[bt!]
\caption{A map}
\centering
\resizebox{\columnwidth}{!} {
\begin{tabular} {@{} lc*{3}l @{}}
\hline
Message Name &
Abbreviation &
Used In\\
\hline
Hello & H & Fig. \\
\hline
\end{tabular}
}%end resize box
\end{table}
\end{document}
答案1
使用tabularx
。您永远不应该使用\resizebox
来包含文本的代码。还可以使用 中的规则booktabs
为您的规则提供一些填充:
\documentclass[compsoc, conference, letterpaper, 10pt, times]{IEEEtran}
\ifCLASSOPTIONcompsoc
% IEEE Computer Society needs nocompress option
% requires cite.sty v4.0 or later (November 2003)
\usepackage[nocompress]{cite}
\else
\usepackage{cite}
\fi
\ifCLASSINFOpdf
\else
\fi
\usepackage{graphicx} %for images
\usepackage{array}
\usepackage{booktabs}
\usepackage{multirow}
\newcommand{\head}[1]{\textnormal{\textbf{#1}}}
\newcommand{\normal}[1]{\multicolumn{1}{l}{#1}}
\usepackage{amssymb}% http://ctan.org/pkg/amssymb
\usepackage{pifont}% http://ctan.org/pkg/pifont
\newcommand{\cmark}{\ding{51}}%
\newcommand{\xmark}{\ding{55}}%
\newcommand*\rot{\rotatebox{90}}
\usepackage{tabularx, lipsum}
\begin{document}
\title{Test Document}
% make the title area
\maketitle
\section{Introduction}
This is an introduction.
\begin{table}[!hbt]
\caption{A map}
\centering
\begin{tabularx}{\columnwidth} {@{} l*{3}{X} @{}}
\toprule
Message Name &
Abbreviation &
Used In\\
\midrule
Hello & H & Fig. \\
\bottomrule
\end{tabularx}
\end{table}
\lipsum
\end{document}