我有如下所示的腳本。問題是表格字體大小大於我在第一行中指定的文件字體大小。如何使表格字型使用與文件其餘部分相同的字型大小。
\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}