3

The methods I am aware of for modifying vertical spacing in a table are \renewcommand{\arraystretch}{<length>} and \setlength{\extrarowheight}{<length>}. However, these commands affect the arrays inside the table as well.

Is there any command similar to \setlength{\tabcolsep}{10pt} but for row spacing?

This is the code for my table, and I'd like to increase the spacing between the matrices, as they look too close to each other.

    \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}

enter image description here

0

2 Answers 2

2

Here is an alternative using the cellspace package:

\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}

enter image description here

3
  • The package cellspace worked perfectly. Thank you very much for the help. Commented Apr 1, 2019 at 3:11
  • When I included the vertical lines as $|c|c|$, it removed all the spacing added in-between the matrices. Would there be any way to avoid this issue? Thank you.
    – dezdichado
    Commented Jun 8, 2022 at 1:34
  • To be honest, based on the information you provided so far, I can't really deduce what you changed on comparison to my answer. Probably it would be better to ask your request as a follow up question including a complete and compilable MWE.
    – leandriis
    Commented Jun 9, 2022 at 16:13
2

A tabstackengine approach. Column gap set with \setstacktabbedgap{}, and extra matrix vertical gap set by optional argument of \addstackgap (found in \zz definition).

If you wish to adjust the row spacing of the inner arrays, use \setstackgap{L}{<length>} to define the baselineskip.

\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}

enter image description here

1
  • The tabstackengine package worked just fine. Thank you for your time! Commented Apr 1, 2019 at 3:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .