错误描述:
There’s no line here to end. …k=1}\mathcal{R}^t_i(u_k) \label{Eq.10} \
翻译:
这里没有终点线。。。k=1}\mathcal{R}^t_i(u_k)\label{Eq.10}\
原码:
\begin{equation}
\centering
\vspace{-0.2cm}
object=\max \sum^{T}_{t=0}\sum^N_{i=1} \sum^{K_{it}}_{k=1}\mathcal{R}^t_i(u_k) \label{Eq.10} \\
\sum_{t=1}^T\sum_{i=1}^N \vert P_i(t)\vert \leq B \label{Eq.11}
\end{equation}
原因:在于\\
是换行符,它的应用错误。由于equation只是单行公式,无法展示多行公式,顾用\\
换行得到多行公式的时候会报错。且\centering
与\\
冲突
修改方法:
\centering
改为环境\begin{center}..\end{center}
\begin{center}
\vspace{-0.2cm}
\begin{align}
object=\max \sum^{T}_{t=0}\sum^N_{i=1} \sum^{K_{it}}_{k=1}\mathcal{R}^t_i(u_k) \label{Eq.10} \\
\sum_{t=1}^T\sum_{i=1}^N \vert P_i(t)\vert \leq B \label{Eq.11}
\end{align}
\end{center}
错误示例:原因\centering
,用在align环境中的多行公式(换行符)冲突.错误为here’s no line here to end
\begin{align}
\vspace{-0.2cm}
\centering
object=\max \sum^{T}_{t=0}\sum^N_{i=1} \sum^{K_{it}}_{k=1}\mathcal{R}^t_i(u_k) \label{Eq.10} \\
\sum_{t=1}^T\sum_{i=1}^N \vert P_i(t)\vert \leq B \label{Eq.11}
\end{align}
下面的案例正确:
A.只用align,不用\centering
\begin{align}
\vspace{-0.2cm}
object=\max \sum^{T}_{t=0}\sum^N_{i=1} \sum^{K_{it}}_{k=1}\mathcal{R}^t_i(u_k) \label{Eq.10} \\
\sum_{t=1}^T\sum_{i=1}^N \vert P_i(t)\vert \leq B \label{Eq.11}
\end{align}
B. 在align中,只有一行公式,没有换行符
\begin{align}
\vspace{-0.2cm}
\centering
\sum_{t=1}^T\sum_{i=1}^N \vert P_i(t)\vert \leq B \label{Eq.11}
\end{align}