删除表格中多行化学方程式周围的垂直空格

删除表格中多行化学方程式周围的垂直空格

有什么方法可以消除multline表格环境中化学方程式周围的垂直间距?

我尝试按照建议设置显示跳过的长度这个问题但它似乎不起作用。

正如信息所示,该\ce命令不会导致这种行为;在正常的数学方程式中也可以看到这种行为。

梅威瑟:

\documentclass[a4paper, 10pt, oneside]{memoir}
\usepackage{mhchem}
\usepackage{amsmath}

% This doesn't work.
\setlength{\abovedisplayskip}{0pt}
\setlength{\belowdisplayskip}{0pt}
\setlength{\abovedisplayshortskip}{0pt}
\setlength{\multlinegap}{0pt}

\begin{document}

\begin{table}
    \begin{tabular}{rp{27em}l}
        1  & \begin{multline*}\ce{This is a very long list of products ->\\[-0.5em] This is another very long list of reactants}\end{multline*} & Align top \\
        2  & \ce{Na+ + Cl- -> NaCl} & Example \\
        3 & \begin{multline}
            This is not a chemical equation environment \\
            But theres still vertical spacing.
        \end{multline} & Align top
    \end{tabular}
\end{table}

\end{document}

在此处输入图片描述

谢谢你!

答案1

环境multlined可以采用两个可选参数:其垂直位置(t, cb)及其宽度。我自然选择了列宽:

\documentclass[a4paper, 10pt, oneside]{memoir}
\usepackage{mhchem}
\usepackage{mathtools}
\makeatletter\newcommand*{\compress}{\@minipagetrue}

\setlength{\multlinegap}{20pt}

\begin{document}

\begin{table}
    \begin{tabular}{r|p{27em}|l}
        1 & $ \begin{multlined}[t][27em]\ce{This is a very long list of products ->\\This is another very long list of reactants}\end{multlined} $ & Align top \\
        2 & \ce{Na+ + Cl- -> NaCl} & Example \\
        3 &\leavevmode$ \begin{multlined}[t][27em]
            \text{This is not a chemical equation environment} \\
            \text{But theres still vertical spacing}.
        \end{multlined} $ & Align top
    \end{tabular}
\end{table}

\end{document} 

在此处输入图片描述

相关内容