在 LateX 中编辑表格

在 LateX 中编辑表格

下面是一个表格,我希望它出现在两列页面的顶部。但它看起来不太好,所以如果有人能帮助我的话。

\begin{table*}[t]
\centering\setlength{\tabcolsep}{.3\tabcolsep}
\begin{tabularx}{\linewidth}{|*2{>{\centering\hsize=1.6666\hsize}X|}*8{>{\centering\arraybackslash\hsize=.83333\hsize}X|}}
\hline
{\bf Point of Comparison} & {\bf Microsoft Kinect} & {\bf Asus Xtion} \\
\hline
Hardware Compatibility & Stable work with various hardware models & Does not work with some USB controllers (especially USB 3.0) \\
\hline
View Adjustment & Has motor that can be controlled remotely by the application & No motor, allow only manual positioning \\
\hline
  Size & 12" x 3" x 2.5" & 7" x 2" x 1.5" \\
\hline
Weight &     3.0 lb &     0.5 lb \\
\hline
Power Supply & USB + ACDC power supply &        USB \\
\hline
Power Consumption & 12 watts & below 2.5 watts  \\
\hline
Distance of Use & between 0.8m and 4m in normal field of view
 & between 0.8m and 3.5m \\
~& between 0.4m and 3m in narrow field of view &~\\
\hline
Field of View & 57\degree horizontal, 43\degree vertical & 58\degree Horizontal, 45\degree Vertical \\
\hline
Vertical tilt range  &     $\pm$27\degree & Not applicable \\
\hline
Frame rate & 30 frames per second (FPS) & 30 frames per second (FPS) \\
\hline
Depth Image Size - Resolution  &  640 x 480 pixels &  640 x 480 pixels \\
\hline
OS Platform Support & Xbox 360 & Microsoft Windows
 \\
 & Microsoft Windows & Linux\\
&  Linux & MacOS\\
& MacOS & \\ 
\hline
Programming Language & C++/C\# (Windows)
 & C++/C\# (Windows) \\
& C++(Linux) & C++(Linux)\\
& JAVA & JAVA\\
\hline
\end{tabularx}
\caption{Comparison between Microsoft Kinect and Asus Xtion Specifications}
\label{tab:template}
\end{table*}

答案1

我真的不太了解如何组织材料身体表格。对于表格的整体布局,我建议您不要更改的设置\tabcolsep,不要使用任何垂直线,也不要\hline在表格主体中使用说明;相反,只需在行组之间插入更多水平空白即可。请使用包中的命令\toprule\midrule和。您的示例代码定义了一个包含十 [10] 列的表格,但您似乎只使用了其中的三列;更改类型列的宽度时,请记住相对列宽的总和应等于列数。您可能需要尝试相对列宽 0.8、1.1 和 1.1。\bottomrulebooktabsX\hsize

那么,类似下面的内容可能是该过程的中间点:

在此处输入图片描述

\documentclass[twocolumn]{article}
\usepackage{tabularx,booktabs}
\newcommand\degree{${}^\circ$\,}
\begin{document}\pagestyle{empty}
\begin{table*}[t]
\begin{tabularx}{\linewidth}{@{}>{\hsize=0.8\hsize}X *2{>{\hsize=1.1\hsize}X}@{}}
\toprule
\textbf{Point of Comparison} & \textbf{Microsoft Kinect} & \textbf{Asus Xtion} \\
\midrule
Hardware Compatibility & Stable work with various hardware models & Does not work with some USB controllers (especially USB 3.0) \\[0.7ex]
View Adjustment & Has motor that can be controlled remotely by the application & No motor, allow only manual positioning \\[0.7ex]
Size & 12" x 3" x 2.5" & 7" x 2" x 1.5" \\[0.7ex]
Weight &     3.0 lb &     0.5 lb \\[0.7ex]
Power Supply & USB + ACDC power supply &    USB \\[0.7ex]
Power Consumption & 12 watts & below 2.5 watts  \\[0.7ex]
Distance of Use & between 0.8m and 4m in normal field of view
 & between 0.8m and 3.5m \\
 & between 0.4m and 3m in narrow field of view \\[0.7ex]
Field of View & 57\degree horizontal, 43\degree vertical & 58\degree Horizontal, 45\degree Vertical \\[0.7ex]
Vertical tilt range  &     $\pm$27\degree & Not applicable \\[0.7ex]
Frame rate & 30 frames per second (FPS) & 30 frames per second (FPS) \\[0.7ex]
Depth Image Size - Resolution  &  640 x 480 pixels &  640 x 480 pixels \\[0.7ex]
OS Platform Support & Xbox 360 & Microsoft Windows \\
 & Microsoft Windows & Linux\\
 &  Linux & MacOS\\
 & MacOS & \\[0.7ex] 
Programming Language & C++/C\# (Windows)
 & C++/C\# (Windows) \\
 & C++(Linux) & C++(Linux)\\
 & JAVA & JAVA\\
\bottomrule
\end{tabularx}
\caption{Comparison between Microsoft Kinect and Asus Xtion Specifications}
\label{tab:template}
\end{table*}
\end{document}

附录:正如 Barbara Beeton 在评论中指出的那样,以窄尺寸排版的文本(例如本表的三个窄列)通常如果设置为右对齐而不是对齐,则看起来会更好。在本例中,可以通过 (i) 加载包ragged2e、(ii) 指定一种新的列类型(例如 )来实现此外观Y,如下所示:

\usepackage{booktabs,tabularx,ragged2e}
\newcolumntype{Y}{>{\RaggedRight\arraybackslash}X}

(iii)将环境中的三列指定tabularx为 typeY而不是 type 。(当然,X您还需要保留说明。)\hsize

相关内容