表格环境中的方程式,没有垂直间距

表格环境中的方程式,没有垂直间距

我的方程式间距有问题。根据这个https://tex.stackexchange.com/a/50348/15360booktabs 很少需要调节间距。

但是下面的代码的结果给我:

带方程式的表格

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

我还用$\begin{aligned} ... \end{aligned}$它来组合方程式,这样您就不必使用命令了\multirow

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

arraystretch\\[8mm]也没什么帮助。

答案1

这是一种可能性;我省略了垂直规则:(几乎)从来不需要它们。

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

请注意\addlinespace留出更多的空间和[1ex]行之间的间距aligned(涉及分数时通常使用间距。左对齐似乎更可取。

在此处输入图片描述

相关内容