空间不等的乳胶方程

问题描述

我已经输入了一组方程的代码,但我不确定是什么问题,因为它与左边的间距不同,你能帮我纠正这个不均匀的间距

\begin{eqnarray}
    L(x) &=& T_e(x) - T_i(x)\\
    \label{eq:latencymsg}
    L_{avg} &=& 1/N \sum_{n=1}^{N} L(x)\\
    \label{eq:latencymsgavg}
    \begin{cases}
    \frac{1}{b-a}&\text{for $L(x)\in[a,b]$}\\
    0&\text{otherwise}\\
    \end{cases}\\
    \begin{cases}
    0&\text{for $L(x)<a$}\\
    \frac{x-a}{b-a}&\text{for $L(x)\in[a,b)$}\\
    1&\text{for $L(x)\ge b$}
    \end{cases}
\end{eqnarray}

enter image description here

解决方法

知道了:不要将 cases 嵌套到 eqnarray 中,只需使用另外两个 equation 环境。

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\begin{eqnarray}
    L(x) &=& T_e(x) - T_i(x)\\
    \label{eq:latencymsg}
    L_{avg} &=& 1/N \sum_{n=1}^{N} L(x)
    \label{eq:latencymsgavg}
\end{eqnarray}

\begin{equation}
\begin{cases}
    \frac{1}{b-a}&\text{for $L(x)\in[a,b]$}\\
    0&\text{otherwise}\\
\end{cases}
\end{equation}

\begin{equation}
\begin{cases}
    0&\text{for $L(x)<a$}\\
    \frac{x-a}{b-a}&\text{for $L(x)\in[a,b)$}\\
    1&\text{for $L(x)\ge b$}
\end{cases}
\end{equation}

\end{document}

Labelng 不一样,因为我的 MWE 中没有第 1、2 和 3 章,但是:

equations aligned

最后,再添加两个 label 以引用第三和第四等式。