表格内对齐的 toprule 和 bottomrule - 错误和间距问题

表格内对齐的 toprule 和 bottomrule - 错误和间距问题

下表给出了2个错误:

\documentclass{report}

\usepackage[intlimits]{amsmath}     
\usepackage{floatflt}
\usepackage{caption}
\usepackage{listliketab}
\usepackage{tabularx}
\usepackage{booktabs}

\begin{document}
\begin{table}[htbp]
    \centering
    \caption{Ableitungen der dimensionslosen freien Enthalpie $\gamma$, Gl. \ref{glg_IF97_R1_Basis}}
    \label{tab:IF97_R1_Abl}
    \toprule
        \begin{align}
            \gamma_\pi          &= \left( \frac{\partial \gamma}{\partial \pi} \right)_{\tau}       & &= \displaystyle\sum_{i=1}^{34} -n_i I_i (7,1-\pi)^{I_i-1} (\tau - 1,222)^{J_i}   \\
            \gamma_{\pi\pi} &= \left( \frac{\partial^2 \gamma}{\partial \pi^2} \right)_{\tau} &  &= \displaystyle\sum_{i=1}^{34} n_i I_i (I_i -1)(7,1-\pi)^{I_i-2} (\tau - 1,222)^{J_i}   \\            
            \gamma_\tau     &= \left( \frac{\partial \gamma}{\partial \tau} \right)_{\pi}       & &= \displaystyle\sum_{i=1}^{34} n_i(7,1-\pi)^{I_i} J_i (\tau - 1,222)^{J_i-1}   \\
            \gamma_{\tau\tau}   &= \left( \frac{\partial^2 \gamma}{\partial \tau^2} \right)_{\pi} & &= \displaystyle\sum_{i=1}^{34} n_i(7,1-\pi)^{I_i} J_i (J_i -1) (\tau - 1,222)^{J_i-2} \\
            \gamma_{\pi \tau} &= \left( \frac{\partial^2 \gamma}{\partial \pi \partial \tau} \right) & &= \displaystyle\sum_{i=1}^{34} -n_i I_i (7,1-\pi)^{I_i-1} J_i (\tau - 1,222)^{J_i-1} 
        \end{align} 
        \bottomrule
\end{table}
\end{document}

结果

这些错误与\toprule和有关\bottomrule,但我不确定为什么:

放错位置的 \noalign

\bottomrule ->\noalign

我也不知道如何减少等式左右两边之间的巨大空白,以及为什么上下两行之间有这么多空白。也许这与错误有关?

答案1

你必须使用tabular

\documentclass{report}

\usepackage[intlimits]{amsmath}     
\usepackage{caption}
\usepackage{booktabs}

\begin{document}
\begin{table}[htbp]
\centering
\caption{Ableitungen der dimensionslosen freien Enthalpie $\gamma$, Gl. \ref{glg_IF97_R1_Basis}}
\label{tab:IF97_R1_Abl}
\begin{tabular}{@{}p{\textwidth}@{}}
\toprule
\addlinespace[-\normalbaselineskip]
{\begin{alignat}{2}
 \gamma_\pi        &= \left( \frac{\partial \gamma}{\partial \pi} \right)_{\tau}          &&= \sum_{i=1}^{34} -n_i I_i (7,1-\pi)^{I_i-1} (\tau - 1,222)^{J_i}   \\
 \gamma_{\pi\pi}   &= \left( \frac{\partial^2 \gamma}{\partial \pi^2} \right)_{\tau}      &&= \sum_{i=1}^{34} n_i I_i (I_i -1)(7,1-\pi)^{I_i-2} (\tau - 1,222)^{J_i}   \\            
 \gamma_\tau       &= \left( \frac{\partial \gamma}{\partial \tau} \right)_{\pi}          &&= \sum_{i=1}^{34} n_i(7,1-\pi)^{I_i} J_i (\tau - 1,222)^{J_i-1}   \\
 \gamma_{\tau\tau} &= \left( \frac{\partial^2 \gamma}{\partial \tau^2} \right)_{\pi}      &&= \sum_{i=1}^{34} n_i(7,1-\pi)^{I_i} J_i (J_i -1) (\tau - 1,222)^{J_i-2} \\
 \gamma_{\pi \tau} &= \left( \frac{\partial^2 \gamma}{\partial \pi \partial \tau} \right) &&= \sum_{i=1}^{34} -n_i I_i (7,1-\pi)^{I_i-1} J_i (\tau - 1,222)^{J_i-1} 
 \end{alignat}}
\\
\addlinespace[-\normalbaselineskip]
\bottomrule
\end{tabular}
\end{table}
\end{document}

在此处输入图片描述

答案2

如果您不想将align环境嵌入到类似 的环境中tabular,而只是想在整个文本块宽度上画线,请不要使用\toprule\bottomrule。只需使用\hrule即可。

在此处输入图片描述

\documentclass{report}

\usepackage[intlimits]{amsmath}     
\usepackage{floatflt}
\usepackage{caption}
\usepackage{listliketab}
\usepackage{tabularx}
\usepackage{booktabs}

\begin{document}
\begin{table}[htbp]
    %\centering
    \caption{Ableitungen der dimensionslosen freien Enthalpie $\gamma$, Gl. \ref{glg_IF97_R1_Basis}}
    \label{tab:IF97_R1_Abl}

    \hrule
        \begin{align}
            \gamma_\pi          &= \left( \frac{\partial \gamma}{\partial \pi} \right)_{\tau}       & &= \displaystyle\sum_{i=1}^{34} -n_i I_i (7,1-\pi)^{I_i-1} (\tau - 1,222)^{J_i}   \\
            \gamma_{\pi\pi} &= \left( \frac{\partial^2 \gamma}{\partial \pi^2} \right)_{\tau} &  &= \displaystyle\sum_{i=1}^{34} n_i I_i (I_i -1)(7,1-\pi)^{I_i-2} (\tau - 1,222)^{J_i}   \\            
            \gamma_\tau     &= \left( \frac{\partial \gamma}{\partial \tau} \right)_{\pi}       & &= \displaystyle\sum_{i=1}^{34} n_i(7,1-\pi)^{I_i} J_i (\tau - 1,222)^{J_i-1}   \\
            \gamma_{\tau\tau}   &= \left( \frac{\partial^2 \gamma}{\partial \tau^2} \right)_{\pi} & &= \displaystyle\sum_{i=1}^{34} n_i(7,1-\pi)^{I_i} J_i (J_i -1) (\tau - 1,222)^{J_i-2} \\
            \gamma_{\pi \tau} &= \left( \frac{\partial^2 \gamma}{\partial \pi \partial \tau} \right) & &= \displaystyle\sum_{i=1}^{34} -n_i I_i (7,1-\pi)^{I_i-1} J_i (\tau - 1,222)^{J_i-1} 
        \end{align} 

\hrule
\end{table}
\end{document}

答案3

如果您想使用\toprule类似的东西,您应该使用 tabular 或 tabularx 环境:

\documentclass{report}

\usepackage[intlimits]{amsmath}
\usepackage{floatflt}
\usepackage{caption}
\usepackage{listliketab}
\usepackage{tabularx}
\usepackage{booktabs}

\begin{document}
\begin{table}[!htbp]
\setlength\abovedisplayskip{-2ex}
\setlength\belowdisplayskip{-0.5ex}
    \caption{Ableitungen der dimensionslosen freien Enthalpie $\gamma$, Gl. \ref{glg_IF97_R1_Basis}}
    \label{tab:IF97_R1_Abl}
\begin{tabularx}{\linewidth}{X}%{@{}p{\linewidth}@{}}
  \toprule
        {\begin{align}
            \gamma_\pi &= \left( \frac{\partial \gamma}{\partial \pi} \right)_{\tau} & &= \displaystyle\sum_{i=1}^{34} -n_i I_i (7,1-\pi)^{I_i-1} (\tau - 1,222)^{J_i} \\
               \gamma_{\pi\pi} &= \left( \frac{\partial^2 \gamma}{\partial \pi^2} \right)_{\tau} & &= \displaystyle\sum_{i=1}^{34} n_i I_i (I_i -1)(7,1-\pi)^{I_i-2} (\tau - 1,222)^{J_i} \\
             \gamma_\tau &= \left( \frac{\partial \gamma}{\partial \tau} \right)_{\pi} & &= \displaystyle\sum_{i=1}^{34} n_i(7,1-\pi)^{I_i} J_i (\tau - 1,222)^{J_i-1} \\
             \gamma_{\tau\tau} &= \left( \frac{\partial^2 \gamma}{\partial \tau^2} \right)_{\pi} & &= \displaystyle\sum_{i=1}^{34} n_i(7,1-\pi)^{I_i} J_i (J_i -1) (\tau - 1,222)^{J_i-2} \\
             \gamma_{\pi \tau} &= \left( \frac{\partial^2 \gamma}{\partial \pi \partial \tau} \right) & &= \displaystyle\sum_{i=1}^{34} -n_i I_i (7,1-\pi)^{I_i-1} J_i (\tau - 1,222)^{J_i-1}
        \end{align}}\\
        \bottomrule
\end{tabularx}
\end{table}
\end{document} 

在此处输入图片描述

相关内容