我正在创建两个表,但不知何故,这两个表之间有一行空行。
\begin{table}[!htb]
\begin{center}
\captionof{table}{Properties of the magnetic Resolver}\label{tab:resvprop}
\begin{tabular}{|c|c|}
\hline
\textbf{Parameter} & \textbf{Value}\\
\hline
Maximum amplitude of the excitation voltage & 9.0V \\
Excitation frequency & 10kHz \\
Number of Pole pairs & 4 \\
\hline
\end{tabular}
\end{center}
\end{table}
\begin{table}[!htb]
\begin{center}
\captionof{table}{Properties of the Reference Encoder}\label{tab:Encprop}
\begin{tabular}{|c|c|}
\hline
\textbf{Parameter} & \textbf{Value}\\
\hline
Pulses per Revolution/ Line count & 1024 \\
Output signals & Sine, Cosine \\
Output signal amplitude & 1.0V\\
Accuracy & \pm 0.0176\textdegree \\
Power supply & DC 5\pm 0.5 V\\
\hline
\end{tabular}
\end{center}
\end{table}
我怎样才能删除两个表格之间的空白区域?
答案1
空间过剩是由于两个因素
center
增加垂直空间;改用\centering
;- 两个连续的浮点数之间隔着 的量
\floatsep
。
下面介绍了如何减少它,同时仍然保持单独的浮点数。
\documentclass{article}
\usepackage{siunitx}
\sisetup{separate-uncertainty}
\begin{document}
\begin{table}[!htb]
\centering
\caption{Properties of the magnetic Resolver}\label{tab:resvprop}
\begin{tabular}{|l|c|}
\hline
\multicolumn{1}{|c|}{\textbf{Parameter}} & \textbf{Value}\\
\hline
Maximum amplitude of the excitation voltage & \SI{9.0}{\volt} \\
Excitation frequency & \SI{10}{\kilo\hertz} \\
Number of Pole pairs & 4 \\
\hline
\end{tabular}
\end{table}
\begin{table}[!htb]
\centering
\caption{Properties of the Reference Encoder}\label{tab:Encprop}
\begin{tabular}{|l|c|}
\hline
\multicolumn{1}{|c|}{\textbf{Parameter}} & \textbf{Value}\\
\hline
Pulses per Revolution/Line count & 1024 \\
Output signals & Sine, Cosine \\
Output signal amplitude & \SI{1.0}{\volt} \\
Accuracy & \SI{\pm 0.0176}{\degree} \\
Power supply & DC \SI{5\pm 0.5}{\volt} \\
\hline
\end{tabular}
\end{table}
\end{document}
我使用siunitx
这个命令来获得正确的测量值及其单位的输出。我还将第一列的对齐方式改为向左对齐。
不过,您可能更喜欢使用单一table
环境。在这里,我还修改了表格代码,以获得更好的外观。但是,如果您愿意,您可以采纳这个想法并保留笼状表格。
\documentclass{article}
\usepackage{siunitx}
\usepackage{booktabs}
\sisetup{separate-uncertainty}
\AtBeginEnvironment{table}{%
\setlength{\belowcaptionskip}{\medskipamount}
\setlength{\abovecaptionskip}{0pt}%
}
\begin{document}
\begin{table}[!htb]
\centering
\caption{Properties of the magnetic Resolver}\label{tab:resvprop}
\begin{tabular}{@{}lc@{}}
\toprule
\multicolumn{1}{c}{Parameter} & Value \\
\midrule
Maximum amplitude of the excitation voltage & \SI{9.0}{\volt} \\
Excitation frequency & \SI{10}{\kilo\hertz} \\
Number of Pole pairs & 4 \\
\bottomrule
\end{tabular}
\bigskip
\caption{Properties of the Reference Encoder}\label{tab:Encprop}
\begin{tabular}{@{}lc@{}}
\toprule
\multicolumn{1}{c}{Parameter} & Value\\
\midrule
Pulses per Revolution/Line count & 1024 \\
Output signals & Sine, Cosine \\
Output signal amplitude & \SI{1.0}{\volt} \\
Accuracy & \SI{\pm 0.0176}{\degree} \\
Power supply & DC \SI{5\pm 0.5}{\volt} \\
\bottomrule
\end{tabular}
\end{table}
\end{document}