5

I have a problem with the spacing of my equations. According to this https://tex.stackexchange.com/a/50348/15360 booktabs one should rarely have to regulate the spacing.

But the result of the code below gives me:

Table with equations

\documentclass[a4paper,10pt,twoside]{article}
\usepackage[cmex10]{amsmath}
\usepackage{booktabs}
\usepackage{multirow}
\usepackage{floatrow}
\begin{document}
\begin{table}[htb!]
  \renewcommand{\arraystretch}{1.2}
  \caption{Parameters which Torque logs.}
  \label{tbl:2_1_1}
  \begin{tabular}{c|c|c} 
                                                                \toprule
  {$\mathbf{q_1/q_2}$} & {$\mathbf{0}$} & {$\mathbf{1}$}       \\ \midrule
  \multirow{2}{*}{$\mathbf{0}$}                                & 
    $\displaystyle\frac{\mathrm{d}v_C}{\mathrm{d}t} = 
-\frac{1}{C}I_\mathrm{load}$                                  &
    $\displaystyle\frac{\mathrm{d}v_C}{\mathrm{d}t} = 
\frac{1}{C}i_L - \frac{1}{C}I_\mathrm{load}$                  \\
                                                             &
    $\displaystyle\frac{\mathrm{d}i_L}{\mathrm{d}t} = 
-\frac{R_L}{L}i_L$                                            &     
    $\displaystyle\frac{\mathrm{d}i_L}{\mathrm{d}t} = 
-\frac{1}{L}v_C - \frac{R_L}{L}i_L$                       \\ \hline
  \multirow{2}{*}{$\mathbf{1}$}                            &
    $\displaystyle\frac{\mathrm{d}v_C}{\mathrm{d}t} = 
-\frac{R_L}{L}i_L - \frac{1}{L}V_s$                       &
    $\displaystyle\frac{\mathrm{d}v_C}{\mathrm{d}t} = 
\frac{1}{C}i_L - \frac{1}{C}I_\mathrm{load}$                  \\
                                                             &
    $\displaystyle\frac{\mathrm{d}i_L}{\mathrm{d}t} = 
-\frac{1}{C}I_\mathrm{load}$                                  &
    $\displaystyle\frac{\mathrm{d}i_L}{\mathrm{d}t} = 
-\frac{1}{L}v_L - \frac{R_L}{L}i_L + \frac{1}{L}V_s$          \\ \bottomrule
  \end{tabular}
\end{table}
\end{document}

I also used $\begin{aligned} ... \end{aligned}$ for combining the equations such that you don't have to use the \multirow command.

\documentclass[a4paper,10pt,twoside]{article}
\usepackage[cmex10]{amsmath}
\usepackage{booktabs}
\usepackage{multirow}
\usepackage{floatrow}
\begin{document}
\begin{table}[htb!]
  \caption{Parameters which Torque logs.}
  \label{tbl:2_1_1}
  \begin{tabular}{c|c|c} 
                                                               \toprule
  {$\mathbf{q_1/q_2}$} & {$\mathbf{0}$} & {$\mathbf{1}$}            \\ \midrule
  {$\mathbf{0}$} & 
$\begin{aligned}
\frac{\mathrm{d}v_C}{\mathrm{d}t} &= -\frac{1}{C}I_\mathrm{load}
\\
\frac{\mathrm{d}i_L}{\mathrm{d}t} &= -\frac{R_L}{L}i_L
\\
\end{aligned}$ 
                &
$\begin{aligned}
\frac{\mathrm{d}v_C}{\mathrm{d}t} &= \frac{1}{C}i_L - \frac{1}{C}I_\mathrm{load}
\\
\frac{\mathrm{d}i_L}{\mathrm{d}t} &= -\frac{1}{L}v_C - \frac{R_L}{L}i_L
\\
\end{aligned}$                                  \\ \hline 
  {$\mathbf{1}$} &  
$\begin{aligned}
\frac{\mathrm{d}v_C}{\mathrm{d}t} &= -\frac{R_L}{L}i_L - \frac{1}{L}V_s
\\
\frac{\mathrm{d}i_L}{\mathrm{d}t} &= -\frac{1}{C}I_\mathrm{load}
\\
\end{aligned}$
                &
$\begin{aligned}
\frac{\mathrm{d}v_C}{\mathrm{d}t} &= \frac{1}{C}i_L - \frac{1}{C}I_\mathrm{load}
\\
\frac{\mathrm{d}i_L}{\mathrm{d}t} &= -\frac{1}{L}v_L - \frac{R_L}{L}i_L +
\frac{1}{L}V_s 
\\
\end{aligned}$                                  \\ \bottomrule
  \end{tabular}
\end{table}
\end{document}

Playing with arraystretch or \\[8mm] didn't help either.

  • 2
    I suggest dropping the use of vertical rules, as purported in the booktabs documentation. See also How to add extra spaces between rows in tabular environment? Why didn't playing [around] with \arraystretch or \\[<len>] help? – Werner Mar 2 '13 at 0:49
  • @Werner \arraystretch did work at some value but the header then got far to big, e.g. to much vertical spacing. But I fixed it now... I don't know why \[<len>] didn't help but \addlinespace did. – WG- Mar 2 '13 at 1:03
  • @Werner: I think you mean "proposed" or "propounded", not "purported", which doesn't make sense here. :P – Noldorin Aug 25 '13 at 17:10
6

Here's a possibility; I omitted the vertical rules: there's (almost) never need for them.

\documentclass[a4paper,10pt,twoside]{article}
\usepackage{amsmath}
\usepackage{booktabs}
\usepackage{caption}
\captionsetup[table]{position=top}
\begin{document}
\begin{table}[htb!]
\centering
\caption{Parameters which Torque logs.}
\label{tbl:2_1_1}
$\begin{array}{cll}
\toprule
\mathbf{q}_1/\mathbf{q}_2 & 
\multicolumn{1}{c}{\mathbf{0}} & 
\multicolumn{1}{c}{\mathbf{1}} \\
\midrule
\addlinespace
\mathbf{0} & 
  \begin{aligned}
    \frac{\mathrm{d}v_C}{\mathrm{d}t} &= -\frac{1}{C}I_\mathrm{load} \\[1ex]
    \frac{\mathrm{d}i_L}{\mathrm{d}t} &= -\frac{R_L}{L}i_L
  \end{aligned} &
  \begin{aligned}
    \frac{\mathrm{d}v_C}{\mathrm{d}t} &= \frac{1}{C}i_L - \frac{1}{C}I_\mathrm{load} \\[1ex]
    \frac{\mathrm{d}i_L}{\mathrm{d}t} &= -\frac{1}{L}v_C - \frac{R_L}{L}i_L
  \end{aligned} \\
\addlinespace
\midrule
\addlinespace
\mathbf{1} &
  \begin{aligned}
    \frac{\mathrm{d}v_C}{\mathrm{d}t} &= -\frac{R_L}{L}i_L - \frac{1}{L}V_s \\[1ex]
    \frac{\mathrm{d}i_L}{\mathrm{d}t} &= -\frac{1}{C}I_\mathrm{load}
  \end{aligned} &
  \begin{aligned}
    \frac{\mathrm{d}v_C}{\mathrm{d}t} &= \frac{1}{C}i_L - \frac{1}{C}I_\mathrm{load} \\[1ex]
    \frac{\mathrm{d}i_L}{\mathrm{d}t} &= -\frac{1}{L}v_L - \frac{R_L}{L}i_L + \frac{1}{L}V_s 
  \end{aligned} \\
\addlinespace
\bottomrule
\end{array}$
\end{table}
\end{document}

Note the \addlinespace for leaving a bit more room and the [1ex] spacing between the rows in aligned (it's common to use a spacing when fractions are involved. Left alignment seems preferable.

enter image description here

  • @WG- I changed a bit my answer; the \mathstrut trick is really not necessary and \addlinespace is preferable. – egreg Mar 2 '13 at 1:08
  • Okay! Thanks for your answer. As you can see in the comment to my own question I figured out also that \addlinespace could do the trick to add more space. Using the array environment seems also a bit smoother then the tabular environment. – WG- Mar 2 '13 at 1:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.