\sfrac 在多行环境中打破垂直间距

\sfrac 在多行环境中打破垂直间距

我发现将\sfracfrom 包xfrac包含到multlined环境 from中mathtools会完全破坏 的垂直间距。实际上,这会影响集合中multlined所有块的第一行和第二行之间的间距。multlined

这尤其糟糕,因为它会导致文本重叠而产生负间距。

\documentclass{article}
\usepackage{mathtools}
\usepackage{xfrac}

\begin{document}
  \texttt{multlined} (two copies inside \texttt{gather}) works fine
  \begin{gather}
    \begin{multlined}
       \sin(x) = \sum_i \frac{(-1)^i x^{2i+1}}{(2i+1)!} \\
       = x - \frac{x^3}{6} + \frac{x^5}{120} - \frac{x^7}{5040} \\
       = x - \frac{x^3}{6} + \frac{x^5}{120} - \frac{x^7}{5040}
    \end{multlined} \\
    \begin{multlined}
       \cos(x) = \sum_i \frac{(-1)^i x^{2i}}{(2i)!}  \\
       = 1 - \frac{x^2}{2} + \frac{x^4}{24} - \frac{x^6}{720} \\
       = 1 - \frac{x^2}{2} + \frac{x^4}{24} - \frac{x^6}{720}
    \end{multlined}
  \end{gather}
  but with even a single \texttt{\textbackslash sfrac} breaks the spacing
  \begin{gather}
    \begin{multlined}
       \sin(x) = \sum_i \frac{(-1)^i x^{2i+1}}{(2i+1)!} \\
       = x - \frac{x^3}{6} + \frac{x^5}{120} - \frac{x^7}{5040} \\
       = x - \frac{x^3}{6} + \sfrac{x^5}{120} - \frac{x^7}{5040}
    \end{multlined} \\
    \begin{multlined}
       \cos(x) = \sum_i \frac{(-1)^i x^{2i}}{(2i)!}  \\
       = 1 - \frac{x^2}{2} + \frac{x^4}{24} - \frac{x^6}{720} \\
       = 1 - \frac{x^2}{2} + \frac{x^4}{24} - \frac{x^6}{720}
    \end{multlined}
  \end{gather}
\end{document}

这仅发生在multlined。如果我使用splitinsidegather或 ,不会发生任何奇怪的事情multline

答案1

与其说是一种修复,不如说是一种解决方法...在输入之前将其放入自己的框中gather

\documentclass{article}
\usepackage{mathtools}
\usepackage{xfrac}
\newsavebox\mybox
\begin{document}
  \sbox\mybox{$\displaystyle\sfrac{x^5}{120}$}
  \begin{gather}
    \begin{multlined}
       \sin(x) = \sum_i \frac{(-1)^i x^{2i+1}}{(2i+1)!} \\
       = x - \frac{x^3}{6} + \frac{x^5}{120} - \frac{x^7}{5040} \\
       = x - \frac{x^3}{6} + \usebox{\mybox} - \frac{x^7}{5040}
    \end{multlined} \\
    \begin{multlined}
       \cos(x) = \sum_i \frac{(-1)^i x^{2i}}{(2i)!}  \\
       = 1 - \frac{x^2}{2} + \frac{x^4}{24} - \frac{x^6}{720} \\
       = 1 - \frac{x^2}{2} + \frac{x^4}{24} - \frac{x^6}{720}
    \end{multlined}
  \end{gather}
\end{document}

在此处输入图片描述

相关内容