方程式编号错误

方程式编号错误
\documentclass{report}
\usepackage{amsmath}
\usepackage{mathtools}
\begin{document}
\begin{gather}
\intertext{Removing the K factor, Eqn.  turn into the classical CORDIC Equations}
\label{Equ. 3.14}
x_{i+1}=[x_i-y_i \cdot 2^{-i}\cdot d_i] \\
\label{Equ. 3.15}
 y_{i+1}=[y_i+x_i \cdot 2^{-i}\cdot d_i] \\
 \intertext{Considering the aim of the CORDIC algorithm is to rotate a vector V(x, y) to unit vector (1, 0), the direction of each rotation can be decided by $y_{i+1}$ or the angle accumulator, which is defined as $Z_{i+1}$.  Since $y_{i+1}$  would finally be 0, via Equ., the direction of rotation could be defined as:}
\end{gather}

\begin{equation}
\label{equ: 3.16}
d_i =
\left\{
\begin{array}{ll}
    +1  & \mbox{if } y_i < 0  \\
    -1 & \mbox{if }  y_i \geq 0
\end{array}
\right.
\end{equation} 
\end{document}

由于某些未知原因,我得到了中间额外的第 3 个方程,如下所示:- 在此处输入图片描述

答案1

\intertext用于方程之间的文本,但第二个方程之后的下一个方程\intertext为空。以下示例将最后一个方程移至gather环境。此外,使用环境cases代替手动array构造:

\documentclass{report}
\usepackage{amsmath}
\usepackage{mathtools}
\begin{document}
\begin{gather}
\intertext{Removing the $K$ factor, Eqn.\@ turn into the classical CORDIC
Equations}
\label{Equ. 3.14}
x_{i+1}=[x_i-y_i \cdot 2^{-i}\cdot d_i] \\
\label{Equ. 3.15}
 y_{i+1}=[y_i+x_i \cdot 2^{-i}\cdot d_i] \\
\intertext{Considering the aim of the CORDIC algorithm is to rotate a
vector $V(x, y)$ to unit vector $(1, 0)$, the direction of each rotation can be
decided by $y_{i+1}$ or the angle accumulator, which is defined as
$Z_{i+1}$.  Since $y_{i+1}$  would finally be 0, via Equ., the direction of
rotation could be defined as:}
\label{equ: 3.16}
d_i =
\begin{cases}
    +1 & \mbox{if } y_i < 0  \\
    -1 & \mbox{if } y_i \geq 0
\end{cases}
\end{gather}
\end{document}

结果

答案2

你误用了\intertext。在这种情况下,它完全没有必要,因为它的目的是在对齐显示,但也没有gather进行equation任何形式的对齐:它们只是将方程式置于中心。

\documentclass{report}
\usepackage{amsmath}
\usepackage{mathtools}
\begin{document}

Removing the $K$ factor, Eqn.  turn into the classical CORDIC Equations
\begin{gather}
\label{Equ. 3.14}
x_{i+1}=[x_i-y_i \cdot 2^{-i}\cdot d_i] \\
\label{Equ. 3.15}
 y_{i+1}=[y_i+x_i \cdot 2^{-i}\cdot d_i]
\end{gather}
Considering the aim of the CORDIC algorithm is to rotate a vector $V(x, y)$ to unit vector 
$(1, 0)$, the direction of each rotation can be decided by $y_{i+1}$ or the angle 
accumulator, which is defined as $Z_{i+1}$.  Since $y_{i+1}$ would finally be 0, via 
Equ., the direction of rotation could be defined as:
\begin{equation}
\label{equ: 3.16}
d_i =
\begin{cases}
    +1 & \text{if $y_i < 0$}  \\
    -1 & \text{if $y_i \geq 0$}
\end{cases}
\end{equation} 
\end{document}

还要注意数学的使用cases以及应如何始终正确地分离:例如,它必须是$V(x, y)$

在此处输入图片描述

顺便说一句,错误的方程编号来自前面\\\intertext。应该有绝不是诸如. , ,之类的尾随\\环境。amsmathalignalignatgathermultline

相关内容