breqn 没有对齐前两行

breqn 没有对齐前两行

我有以下形式的输入(其中我已将 \[ 重新定义为 \begin{dmath*} 并且 \] 重新定义为 \end{dmath*})

\begin{dgroup*}
\[
    A = \frac{1}{T}\left[\frac{2}{\left(\min_{s\in [0,1]}\gamma(s)\right)^2}\sum_{i=0}^{k-1}\delta s_i \norm*{\frac{dH(s)}{ds}} + 7\sum_{i=0}^{k-1}\int_{s_i}^{s_{i+1}}\frac{ds}{\gamma(s)^3} \norm*{\frac{dH(s)}{ds}}^2\right]
\]\[
    = \sum_{i=0}^{k-1}\frac{1}{T}\left[\frac{2}{\left(\min_{s\in [0,1]}\gamma(s)\right)^2}\norm*{\frac{dH_i(\sigma_i)}{d\sigma_i}} + 7\int_{s_i}^{s_{i+1}}\frac{ds}{{\delta s_i}^2\gamma(s)^3}\norm*{\frac{dH_i(\sigma_i)}{d\sigma_i}}^2\right]
\]\[
    = \sum_{i=0}^{k-1}\frac{1}{T}\left[\frac{2}{\left(\min_{s\in [0,1]}\gamma(s)\right)^2}\norm*{\frac{dH_i(\sigma_i)}{d\sigma_i}} + 7\int_0^1 \frac{\delta s_i d\sigma_i}{{\delta s_i}^2\gamma(\sigma_i\delta s_i + s_i)^3}\norm*{\frac{dH_i(\sigma_i)}{d\sigma_i}}^2\right] 
\]
etc.
\end{dgroup*}

我得到了输出

breqn 的输出

其中第一个和第二个等号未对齐。所有后续等号都对齐。我在互联网上找不到这个问题,而且它一直在发生。它不会发生在每个 dgroup 上,如果我切换回对齐环境,一切都会正常工作。有人知道幕后发生了什么导致这种情况吗?或者有没有简单的修复方法,而不需要恢复到对齐环境?

答案1

breqn通过手动拆分行而滥用了操作。

\documentclass{article}
\usepackage{geometry} % wider textwidth
\usepackage{amsmath,mathtools,breqn}

\DeclarePairedDelimiter{\norm}{\lVert}{\rVert}

\begin{document}

\begin{dmath*}
    A = \frac{1}{T}\left[\frac{2}{\left(\min_{s\in [0,1]}\gamma(s)\right)^2}\sum_{i=0}^{k-1}\delta s_i \norm*{\frac{dH(s)}{ds}} + 7\sum_{i=0}^{k-1}\int_{s_i}^{s_{i+1}}\frac{ds}{\gamma(s)^3} \norm*{\frac{dH(s)}{ds}}^2\right]
    = \sum_{i=0}^{k-1}\frac{1}{T}\left[\frac{2}{\left(\min_{s\in [0,1]}\gamma(s)\right)^2}\norm*{\frac{dH_i(\sigma_i)}{d\sigma_i}} + 7\int_{s_i}^{s_{i+1}}\frac{ds}{{\delta s_i}^2\gamma(s)^3}\norm*{\frac{dH_i(\sigma_i)}{d\sigma_i}}^2\right]
    = \sum_{i=0}^{k-1}\frac{1}{T}\left[\frac{2}{\left(\min_{s\in [0,1]}\gamma(s)\right)^2}\norm*{\frac{dH_i(\sigma_i)}{d\sigma_i}} + 7\int_0^1 \frac{\delta s_i d\sigma_i}{{\delta s_i}^2\gamma(\sigma_i\delta s_i + s_i)^3}\norm*{\frac{dH_i(\sigma_i)}{d\sigma_i}}^2\right] 
\end{dmath*}

\end{document}

在此处输入图片描述

答案2

我会使用不同的环境。对齐由 定义&,新行由 定义\\。我还更改了 的下标\min(您可以轻松返回到您的版本)。您可能需要考虑使用直立的d导数。

请确保下次发布 MWE,请参阅我刚刚被要求写一个最简单的例子,那是什么?

\documentclass{memoir}
\usepackage{amsmath,mathtools}
\DeclarePairedDelimiter\norm{\lVert}{\lVert}

\begin{document}
\begin{align*}
    A&=\frac{1}{T}\left[\frac{2}{\left(\min\limits_{s\in [0,1]}\gamma(s)\right)^2}\sum_{i=0}^{k-1}\delta s_i \norm*{\frac{dH(s)}{ds}} + 7\sum_{i=0}^{k-1}\int_{s_i}^{s_{i+1}}\frac{ds}{\gamma(s)^3} \norm*{\frac{dH(s)}{ds}}^2\right]\\
    &=\sum_{i=0}^{k-1}\frac{1}{T}\left[\frac{2}{\left(\min\limits_{s\in [0,1]}\gamma(s)\right)^2}\norm*{\frac{dH_i(\sigma_i)}{d\sigma_i}} + 7\int_{s_i}^{s_{i+1}}\frac{ds}{{\delta s_i}^2\gamma(s)^3}\norm*{\frac{dH_i(\sigma_i)}{d\sigma_i}}^2\right]\\
    &=\sum_{i=0}^{k-1}\frac{1}{T}\left[\frac{2}{\left(\min\limits_{s\in [0,1]}\gamma(s)\right)^2}\norm*{\frac{dH_i(\sigma_i)}{d\sigma_i}} + 7\int_0^1 \frac{\delta s_i d\sigma_i}{{\delta s_i}^2\gamma(\sigma_i\delta s_i + s_i)^3}\norm*{\frac{dH_i(\sigma_i)}{d\sigma_i}}^2\right] 
\end{align*}
\end{document}

在此处输入图片描述

相关内容