我知道的修改表格垂直间距的方法是\renewcommand{\arraystretch}{<length>}
和\setlength{\extrarowheight}{<length>}
。但是,这些命令也会影响表格内的数组。
是否有类似\setlength{\tabcolsep}{10pt}
但用于行距的命令?
这是我的表格的代码,我想增加矩阵之间的间距,因为它们看起来太靠近彼此了。
\begin{table}[hbt!]
\centering
\begin{tabular}{ccc}
\hline
Description & Symbol & Value\\ \hline
State-Space Matrix & $A$ & $\left(\begin{array}{cccc} 0 & 0 & 1.0 & 0\\ 0 & 0 & 0 & 1.0\\ 0 & 744.7 & -40.32 & 0\\ 0 & -1152.0 & 40.32 & 0 \end{array}\right)$\\
State-Space Matrix & $B$ & $\left(\begin{array}{c} 0\\ 0\\ 61.63\\ -61.63 \end{array}\right)$\\
State-Space Matrix & $C$ & $\left(\begin{array}{cccc} 1.0 & 0 & 0 & 0\\ 0 & 1.0 & 0 & 0 \end{array}\right)$\\
State-Space Matrix & $D$ & $\left(\begin{array}{c} 0\\ 0 \end{array}\right)$\\
Open-loop Poles & $OL$ & $\left(\begin{array}{cccc} 0 & 0 & 0 & 0\\ 0 & -9.187+25.78{}\mathrm{i} & 0 & 0\\ 0 & 0 & -9.187-25.78{}\mathrm{i} & 0\\ 0 & 0 & 0 & -21.95 \end{array}\right)$\\
\hline
\end{tabular}
\caption{Pre-Lab Parameters}
\end{table}
答案1
以下是使用该cellspace
包的替代方法:
\documentclass{article}
\usepackage{cellspace}
\setlength\cellspacetoplimit{6pt}
\setlength\cellspacebottomlimit{6pt}
\begin{document}
\begin{table}[hbt!]
\centering
\begin{tabular}{ccSc}
\hline
Description & Symbol & Value\\ \hline
State-Space Matrix & $A$ & $\left(\begin{array}{cccc} 0 & 0 & 1.0 & 0\\ 0 & 0 & 0 & 1.0\\ 0 & 744.7 & -40.32 & 0\\ 0 & -1152.0 & 40.32 & 0 \end{array}\right)$\\
State-Space Matrix & $B$ & $\left(\begin{array}{c} 0\\ 0\\ 61.63\\ -61.63 \end{array}\right)$\\
State-Space Matrix & $C$ & $\left(\begin{array}{cccc} 1.0 & 0 & 0 & 0\\ 0 & 1.0 & 0 & 0 \end{array}\right)$\\
State-Space Matrix & $D$ & $\left(\begin{array}{c} 0\\ 0 \end{array}\right)$\\
Open-loop Poles & $OL$ & $\left(\begin{array}{cccc} 0 & 0 & 0 & 0\\ 0 & -9.187+25.78{}\mathrm{i} & 0 & 0\\ 0 & 0 & -9.187-25.78{}\mathrm{i} & 0\\ 0 & 0 & 0 & -21.95 \end{array}\right)$\\
\hline
\end{tabular}
\caption{Pre-Lab Parameters}
\end{table}
\end{document}
答案2
一种tabstackengine
方法。列间隙设置为\setstacktabbedgap{}
,额外矩阵垂直间隙由可选参数设置\addstackgap
(在定义中找到\zz
)。
如果您希望调整内部数组的行间距,请使用\setstackgap{L}{<length>}
定义基线跳跃。
\documentclass{article}
\usepackage{tabstackengine,array}
\setstacktabbedgap{1.5ex}% INTER-COLUMN GAP
\setlength\extrarowheight{3pt}
\newcommand\zz[1]{\addstackgap[5pt]{$\parenMatrixstack{#1}$}}
\begin{document}
\begin{table}[hbt!]
\centering
\begin{tabular}{ccc}
\hline
Description & Symbol & Value\\ \hline
State-Space Matrix & $A$ & \zz {0 & 0 & 1.0 & 0\\ 0 & 0 & 0 & 1.0\\ 0 & 744.7 & -40.32 & 0\\ 0 & -1152.0 & 40.32 & 0} \\
State-Space Matrix & $B$ & \zz{ 0\\ 0\\ 61.63\\ -61.63 }\\
State-Space Matrix & $C$ & \zz{ 1.0 & 0 & 0 & 0\\ 0 & 1.0 & 0 & 0 }\\
State-Space Matrix & $D$ & \zz{ 0\\ 0 }\\
Open-loop Poles & $OL$ & \zz{ 0 & 0 & 0 & 0\\ 0 & -9.187+25.78{}\mathrm{i} & 0 & 0\\ 0 & 0 & -9.187-25.78{}\mathrm{i} & 0\\ 0 & 0 & 0 & -21.95}\\
\hline
\end{tabular}
\caption{Pre-Lab Parameters}
\end{table}
\end{document}