\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}
答案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
。应该有绝不是诸如. , ,之类的尾随\\
环境。amsmath
align
alignat
gather
multline