我正在尝试使用包含许多列的表格环境制作一个表格,但生成的表格看起来非常小且难以阅读(字体也太小了)。我对 LaTeX 还很陌生,任何帮助都将不胜感激!我的代码如下。
\documentclass[12pt]{article}
\usepackage{setspace}
\doublespacing
\usepackage[utf8]{inputenc}
\usepackage [english]{babel}
\usepackage [autostyle, english = american]{csquotes}
\usepackage{multirow}
\usepackage[tmargin=1in,bmargin=1in,lmargin=1in,rmargin=1in]{geometry}
\usepackage[labelsep=period]{caption}
\captionsetup[table]{name=Table}
\renewcommand{\thetable}{\Roman{table}}
\begin{table}[!h]
\centering
\caption{Sampling Conditions for each run.}
\resizebox{\columnwidth}{!}{
\begin{tabular}{ |c|c|c|c|c|c|c|c| }
\hline
Run & Position (in) & Burst Threshold (mV) & Bandpass Filter (MHz) & Downmix Frequency (MHz) & Transceiver Orientation & Freestream Seeder Condition & Jet Seeder Condition \\
\hline
1 & 0 & 30 & 1-10 & 38 & 90$^\circ$ & On & On\\
\hline
2 & 0 & 30 & 1-10 & 38 & 90$^\circ$ & On & On\\
\hline
3 & 0.5 & 30 & 1-10 & 38 & 90$^\circ$ & On & On\\
\hline
4 & 1.0 & 30 & 1-10 & 38 & 90$^\circ$ & On & On\\
\hline
5,6,7 & 1.25 & 30 & 1-10 & 38 & 90$^\circ$ & On & On\\
\hline
8 & 1.5 & 30 & 1-10 & 38 & 90$^\circ$ & On & On\\
\hline
9,10,11 & 1.75 & 30 & 1-10 & 38 & 90$^\circ$ & On & On\\
\hline
12 & 2 & 30 & 1-10 & 38 & 90$^\circ$ & On & On\\
\hline
13 & 2.25 & 30 & 1-10 & 38 & 90$^\circ$ & On & On\\
\hline
14,15,16 & 2.5 & 30 & 1-10 & 38 & 90$^\circ$ & On & On\\
\hline
17 & 2.75 & 30 & 1-10 & 38 & 90$^\circ$ & On & On\\
\hline
18 & 3.0 & 30 & 1-10 & 38 & 90$^\circ$ & On & On\\
\hline
19 & 3.25 & 30 & 1-10 & 38 & 90$^\circ$ & On & On\\
\hline
20 & 3.5 & 30 & 1-10 & 38 & 90$^\circ$ & On & On\\
\hline
21 & 3.75 & 30 & 1-10 & 38 & 90$^\circ$ & On & On\\
\hline
22 & 4.0 & 30 & 1-10 & 38 & 90$^\circ$ & On & On\\
\hline
23,24,25 & 4.25 & 30 & 1-10 & 38 & 90$^\circ$ & On & On\\
\hline
26 & 4.5 & 30 & 1-10 & 38 & 90$^\circ$ & On & On\\
\hline
27 & 4.75 & 30 & 1-10 & 38 & 90$^\circ$ & On & On\\
\hline
28 & 5 & 30 & 1-10 & 38 & 90$^\circ$ & On & On\\
\hline
29 & 5.25 & 30 & 1-10 & 38 & 90$^\circ$ & On & On\\
\hline
30 & 5.5 & 30 & 1-10 & 38 & 90$^\circ$ & On & On\\
\hline
31 & 1.25 & 30 & 0.3-3 & 40 & 90$^\circ$ & On & On\\
\hline
32 & 4.5 & 30 & 0.3-3 & 40 & 90$^\circ$ & On & On\\
\hline
33 & 4.5 & 150 & 1-10 & 38 & 90$^\circ$ & On & On\\
\hline
34 & 4.5 & 30 & ?? & ?? & 90$^\circ$ & Off & On\\
\hline
35 & 4.5 & 30 & ?? & ?? & 90$^\circ$ & On & Off\\
\hline
36 & 4.5 & ?? & ?? & ?? & 0$^\circ$ & On & On\\
\hline
\end{tabular}
}
\end{table}
答案1
\documentclass[12pt]{article}
\usepackage{setspace}
\doublespacing
\usepackage[utf8]{inputenc}
\usepackage [english]{babel}
\usepackage [autostyle, english = american]{csquotes}
\usepackage{multirow}
\usepackage[tmargin=1in,bmargin=1in,lmargin=1in,rmargin=1in]{geometry}
\usepackage[labelsep=period]{caption}
\captionsetup[table]{name=Table}
\renewcommand{\thetable}{\Roman{table}}
\newcommand\hd[1]{\begin{tabular}[t]{@{}c@{}}#1\end{tabular}}
\begin{document}
\begin{table}[htp]
\centering
\caption{Sampling Conditions for each run.}
\small
\setlength\tabcolsep{5pt}
\begin{tabular}{@{}|c|c|c|c|c|c|c|c|@{}}
\hline
\hd{Run} &
\hd{Position\\(in)} &
\hd{Burst\\Threshold\\ (mV)} &
\hd{Bandpass\\Filter\\ (MHz)}&
\hd{Downmix\\Frequency\\ (MHz)} &
\hd{Transceiver\\ Orientation} &
\hd{Freestream\\ Seeder\\ Condition} &
\hd{Jet\\ Seeder\\Condition} \\
\hline
1 & 0 & 30 & 1-10 & 38 & 90$^\circ$ & On & On\\
\hline
2 & 0 & 30 & 1-10 & 38 & 90$^\circ$ & On & On\\
\hline
3 & 0.5 & 30 & 1-10 & 38 & 90$^\circ$ & On & On\\
\hline
4 & 1.0 & 30 & 1-10 & 38 & 90$^\circ$ & On & On\\
\hline
5,6,7 & 1.25 & 30 & 1-10 & 38 & 90$^\circ$ & On & On\\
\hline
8 & 1.5 & 30 & 1-10 & 38 & 90$^\circ$ & On & On\\
\hline
9,10,11 & 1.75 & 30 & 1-10 & 38 & 90$^\circ$ & On & On\\
\hline
12 & 2 & 30 & 1-10 & 38 & 90$^\circ$ & On & On\\
\hline
13 & 2.25 & 30 & 1-10 & 38 & 90$^\circ$ & On & On\\
\hline
14,15,16 & 2.5 & 30 & 1-10 & 38 & 90$^\circ$ & On & On\\
\hline
17 & 2.75 & 30 & 1-10 & 38 & 90$^\circ$ & On & On\\
\hline
18 & 3.0 & 30 & 1-10 & 38 & 90$^\circ$ & On & On\\
\hline
19 & 3.25 & 30 & 1-10 & 38 & 90$^\circ$ & On & On\\
\hline
20 & 3.5 & 30 & 1-10 & 38 & 90$^\circ$ & On & On\\
\hline
21 & 3.75 & 30 & 1-10 & 38 & 90$^\circ$ & On & On\\
\hline
22 & 4.0 & 30 & 1-10 & 38 & 90$^\circ$ & On & On\\
\hline
23,24,25 & 4.25 & 30 & 1-10 & 38 & 90$^\circ$ & On & On\\
\hline
26 & 4.5 & 30 & 1-10 & 38 & 90$^\circ$ & On & On\\
\hline
27 & 4.75 & 30 & 1-10 & 38 & 90$^\circ$ & On & On\\
\hline
28 & 5 & 30 & 1-10 & 38 & 90$^\circ$ & On & On\\
\hline
29 & 5.25 & 30 & 1-10 & 38 & 90$^\circ$ & On & On\\
\hline
30 & 5.5 & 30 & 1-10 & 38 & 90$^\circ$ & On & On\\
\hline
31 & 1.25 & 30 & 0.3-3 & 40 & 90$^\circ$ & On & On\\
\hline
32 & 4.5 & 30 & 0.3-3 & 40 & 90$^\circ$ & On & On\\
\hline
33 & 4.5 & 150 & 1-10 & 38 & 90$^\circ$ & On & On\\
\hline
34 & 4.5 & 30 & ?? & ?? & 90$^\circ$ & Off & On\\
\hline
35 & 4.5 & 30 & ?? & ?? & 90$^\circ$ & On & Off\\
\hline
36 & 4.5 & ?? & ?? & ?? & 0$^\circ$ & On & On\\
\hline
\end{tabular}
\end{table}
\end{document}
答案2
最严重的问题是标题太长,占用了最多的空间。我建议将它们设置为缩写形式,并在表格下方添加图例。
我还删除了大部分规则,特别是那些毫无用处地占用宝贵空间的垂直规则。
我建议siunitx
任何包含数字数据的表格。
\documentclass[12pt]{article}
\usepackage{siunitx,booktabs,threeparttable}
\newcommand{\splitcell}[1]{{%
\begin{tabular}[t]{@{}c@{}}#1\end{tabular}%
}}
\begin{document}
\begin{table}[!htp]
\caption{Sampling Conditions for each run.}
\setlength{\tabcolsep}{0pt} % let TeX compute the spacing
\begin{tabular*}{\textwidth}{
@{\extracolsep{\fill}}
c
S[table-format=1.2]
S[table-format=3.0]
c
S[table-format=2.0]
S[table-format=2.0]
c
c
@{}
}
\toprule
Run &
\splitcell{P \\ (\si{in})} &
\splitcell{BT \\ (\si{mV})} &
\splitcell{BF \\ (\si{MHz})} &
\splitcell{DF \\ (\si{MHz})} &
\splitcell{TO \\ (\si{\degree})} &
FSC &
JSC \\
\midrule
1 & 0 & 30 & 1-10 & 38 & 90 & On & On\\
2 & 0 & 30 & 1-10 & 38 & 90 & On & On\\
3 & 0.5 & 30 & 1-10 & 38 & 90 & On & On\\
4 & 1.0 & 30 & 1-10 & 38 & 90 & On & On\\
5,6,7 & 1.25 & 30 & 1-10 & 38 & 90 & On & On\\
8 & 1.5 & 30 & 1-10 & 38 & 90 & On & On\\
9,10,11 & 1.75 & 30 & 1-10 & 38 & 90 & On & On\\
12 & 2 & 30 & 1-10 & 38 & 90 & On & On\\
13 & 2.25 & 30 & 1-10 & 38 & 90 & On & On\\
14,15,16 & 2.5 & 30 & 1-10 & 38 & 90 & On & On\\
17 & 2.75 & 30 & 1-10 & 38 & 90 & On & On\\
18 & 3.0 & 30 & 1-10 & 38 & 90 & On & On\\
19 & 3.25 & 30 & 1-10 & 38 & 90 & On & On\\
20 & 3.5 & 30 & 1-10 & 38 & 90 & On & On\\
21 & 3.75 & 30 & 1-10 & 38 & 90 & On & On\\
22 & 4.0 & 30 & 1-10 & 38 & 90 & On & On\\
23,24,25 & 4.25 & 30 & 1-10 & 38 & 90 & On & On\\
26 & 4.5 & 30 & 1-10 & 38 & 90 & On & On\\
27 & 4.75 & 30 & 1-10 & 38 & 90 & On & On\\
28 & 5 & 30 & 1-10 & 38 & 90 & On & On\\
29 & 5.25 & 30 & 1-10 & 38 & 90 & On & On\\
30 & 5.5 & 30 & 1-10 & 38 & 90 & On & On\\
31 & 1.25 & 30 & 0.3-3 & 40 & 90 & On & On\\
32 & 4.5 & 30 & 0.3-3 & 40 & 90 & On & On\\
33 & 4.5 & 150 & 1-10 & 38 & 90 & On & On\\
34 & 4.5 & 30 & {??} & {??} & 90 & Off & On\\
35 & 4.5 & 30 & {??} & {??} & 90 & On & Off\\
36 & 4.5 & {??} & {??} & {??} & 0 & On & On\\
\midrule[\heavyrulewidth]
\end{tabular*}
\raggedright
P: Position; BT: Burst~Threshold; BF:~Bandpass~Filter;
DF:~Downmix~Frequency; TO:~Transceiver~Orientation;
FSC:~Freestream~Seeder~Condition; JSC:~Jet~Seeder~Condition.
\end{table}
\end{document}