论文里,希望表格里的数字+单位按单位起始位置对齐~
这样比起直接左对齐,右对齐和居中都好看很多。
类似的美观表示还有小数点对齐,可参考:siunitx table: column with and without units



1. 单位对齐

  • 方法

    • 将数字和单位分为两列,数字右对齐,单位左对齐
    • 论文里的物理单位我统一用了\usepackage{siunitx}

  • 效果

在这里插入图片描述
有没有好看很多!!!!

  • 代码

	\begin{table}[ht]
		\begin{center}
			\caption{Cartesian space limits of Panda robot}
			\label{table_c_limit}
			\begin{tabular}{c r@{\,}l r@{\,}l r@{\,}l}
				\toprule
				\multicolumn{1}{c}{Name} & \multicolumn{2}{c}{Translation} & \multicolumn{2}{c}{Rotation} & \multicolumn{2}{c}{Elbow} \\ 
				\midrule
				$\boldsymbol{p}^{\rm max}$ 
				& $ 1.700 $  & \si[per-mode=symbol]{\meter\per\second} 
				& $ 2.500 $  & \si[per-mode=symbol]{\radian\per\second} 
				& $ 2.175 $  & \si[per-mode=symbol]{\radian\per\second} 
				\\
				$\dot{\boldsymbol{p}}^{\rm max}$ 
				& $ 13 $& \si[per-mode=symbol]{\meter\per\second^2} 
				& $ 25 $& \si[per-mode=symbol]{\radian\per\second^2} 
				& $ 10 $& \si[per-mode=symbol]{\radian\per\second^2} 
				\\
				$\ddot{\boldsymbol{p}}^{\rm max}$ 
				& $ 6500  $& \si[per-mode=symbol]{\meter\per\second^3} 
				& $ 12500 $& \si[per-mode=symbol]{\radian\per\second^3} 
				& $ 5000  $& \si[per-mode=symbol]{\radian\per\second^3} 
				\\
				\bottomrule
			\end{tabular}
		\end{center}
	\end{table}



2. 小数点对齐

  • 重点

一般的数字表格里!!不可以加括号!!否则就直接居中了,不会小数点对齐。
Ref :siunitx — A comprehensive (SI) units package

  • 效果

在这里插入图片描述
最后一行文字加数字也对齐了,有点搞笑…

  • 代码

\begin{table}
	\caption{Standard behavior of the \texttt{S} column type}
	\label{tab:S:standard}
	\centering
	\begin{tabular}{S}
		\toprule
		{Some Values} \\
		\midrule
		2.3456 \\
		34.2345 \\
		-6.7835 \\
		90.473 \\
		5642.5 \\
		1.2e3 \\
		{$ 10^{-6} $} \\
		abccccc\\
		ab111222\\
		\bottomrule
	\end{tabular}
\end{table}
Logo

有“AI”的1024 = 2048,欢迎大家加入2048 AI社区

更多推荐