1. 是aligned,不是align!!
网上写的公式大多是这样的
\begin{equation}\label{eq:2}
\begin{align}
Q\left( {s,t} \right) = a{s^2} + 2bst + c{t^2} + 2ds + 2et + f
\end{align}
\end{equation}
但是报错:
! Package amsmath Error: Erroneous nesting of equation structures;
(amsmath) trying to recover with `aligned'.
! 包amsmath错误:方程结构嵌套错误;
(amsmath)尝试用`aligned'恢复。
See the amsmath package documentation for explanation.
Type H <return> for immediate help.
align换成aligned,不报错了
\begin{equation}\label{eq:2}
\begin{aligned}
Q\left( {s,t} \right) = a{s^2} + 2bst + c{t^2} + 2ds + 2et + f
\end{aligned}
\end{equation}
2. \begin{document}
重新运行报错
Runaway argument?
{2
! File ended while scanning use of \@LN.
<inserted text>
\par
l.30 \begin{document}
?
解决办法:关掉所有编译后,
选择:文件→删除辅助文件→选择所有→删除。
再次运行就可以了
1.3空格
两个quad空格 | a \qquad b | a b a \qquad b ab | 两个m的宽度 |
quad空格 | a \quad b | a \quad b | 一个m的宽度 |
大空格 | a\ b | a b a\ b a b | 1/3m宽度 |
中等空格 | a;b | a b a\;b ab | 2/7m宽度 |
小空格 | a,b | a b a\,b ab | 1/6m宽度 |
没有空格 | ab | ab, | |
紧贴 | a!b | a b a\!b ab | 缩进1/6m宽度 |
2. 公式
2.1 多行公式居中对齐
2.1.1 gather=居中对齐+子公式编号
\begin{subequations}\label{eq:2-1}
\begin{gather}
Q\left( {s,t} \right) = a{s^2} + 2bst + c{t^2} + 2ds + 2et + f, \\
\pmb{c}_i = v + s_0\pmb{E}_0 + t_0\pmb{E}_1, \; Q( s_0,t_0){\text{ = min }}Q(s,t),\\
\left\| \pmb{r} \right\| = \mathop {\min }\limits_{i \in [0,{N_f}]} \left\| {\pmb{p} - {\pmb{c}_i}} \right\|
\end{gather}
\end{subequations}
2.1.2 gather*=居中对齐+子公式不编号
\begin{subequations}\label{eq:2-1}
\begin{gather*}
Q\left( {s,t} \right) = a{s^2} + 2bst + c{t^2} + 2ds + 2et + f, \\
\pmb{c}_i = v + s_0\pmb{E}_0 + t_0\pmb{E}_1, \; Q( s_0,t_0){\text{ = min }}Q(s,t),\\
\left\| \pmb{r} \right\| = \mathop {\min }\limits_{i \in [0,{N_f}]} \left\| {\pmb{p} - {\pmb{c}_i}} \right\|
\end{gather*}
\end{subequations}