等式内的间距

等式内的间距

我得到以下等式:

\begin{align*}
y_{i} &= f(x_{i}) + \epsilon_{i} \nonumber \\
&\approx \underbrace{f(x_{0})}_\text{=$\beta_{0}$} + (x_{i}-x_{0})\underbrace{f^{'}(x_{0})}_\text{=$\beta_{1}$} + (x_{i}-x_{0})^{2}\underbrace{\frac{f^{''}(x_{0})}{2!}}_\text{=$\beta_{2}$} + \ldots + (x_{i}-x_{0})^{l}\underbrace{\frac{f^{(l)}(x_{0})}{l!}}_\text{=$\beta_{l}$}  +  \epsilon_{i}  \nonumber \\
&= \beta_{0} + \beta_{1}(x_{i}-x_{0}) + \beta_{2}(x_{i}-x_{0})^{2} + \ldots + \beta_{l}(x_{i}-x_{0})^{l}  +  \epsilon_{i} \ . 
\end{align*}

但是,第二行的\epsilon_{i}“+”后面没有空格。我不确定这是为什么。有没有办法在“+”后面留一个空格,也就是“适当”的间距?

谢谢!

答案1

在此处输入图片描述

在此处输入图片描述

您需要{}在 之前+\epsilon{i}。或者按如下方式将每个\underbrace内容括起来。{}

{\underbrace{f(x_0)}_{=\beta_0}}

我还删除了{}原始代码中不必要的部分,以节省更多的数据存储,并使您的代码更具可读性和更易于维护。

\documentclass[preview,border=12pt]{standalone}
\usepackage{amsmath}
\begin{document}
\abovedisplayskip=0pt\relax
\begin{align*}
y_i
&= 
f(x_i) + \epsilon_i
\\%======================================================================
&\approx
    {\underbrace{f(x_0)}_{=\beta_0}}
+ (x_i-x_0){\underbrace{f'(x_0)}_{=\beta_1}}
+ (x_i-x_0)^2{\underbrace{\frac{f''(x_0)}{2!}}_{=\beta_2}}
+ \ldots 
+ (x_i-x_0)^l{\underbrace{\frac{f^{(l)}(x_0)}{l!}}_{=\beta_l}}
+ \epsilon_i
\\%======================================================================
&= 
    \beta_0
+ \beta_1(x_i-x_0) 
+ \beta_2(x_i-x_0)^2
+ \ldots 
+ \beta_l(x_i-x_0)^l 
+ \epsilon_i
\end{align*}
\end{document}

相关内容