LaTeX 报错:Foreign command \atopwithdelims; \frac or \genfrac should be used

50 篇文章 1 订阅
33 篇文章 3 订阅

报错信息:

Foreign command \atopwithdelims; \frac or \genfrac should be used

在这里插入图片描述

代码

\begin{equation}
    {\mathbf{S}^{t_1}\brack\mathbf{W}^{t_1}} = {\mathbf{S}^{t_0}\brack\mathbf{W}^{t_0}} + \int^{t_1}_{t_0} g\left( {\mathbf{S}^t\brack\mathbf{W}^t}, t \right) dt, 
\end{equation}

[ S t 1 W t 1 ] = [ S t 0 W t 0 ] + ∫ t 0 t 1 g ( [ S t W t ] , t ) d t , {\mathbf{S}^{t_1}\brack\mathbf{W}^{t_1}} = {\mathbf{S}^{t_0}\brack\mathbf{W}^{t_0}} + \int^{t_1}_{t_0} g\left( {\mathbf{S}^t\brack\mathbf{W}^t}, t \right) dt, [Wt1St1]=[Wt0St0]+t0t1g([WtSt],t)dt,

原因

报错信息中说\atopwithdelims被使用了,这个命令是一个 TeX \TeX TEX 数学命令,如果我们使用了amsmath包,那么我们不需要使用类似于\atopwithdelims\atop这样的命令,而应该使用amsmath设定的命令,例如\frac\binom\genfrac等。

具体可以下图:

在这里插入图片描述

来自于这个网页

解决方案

我个人建议使用\genfrac来使用,示例:

原来:

{a\brack b}

[ a b ] {a\brack b} [ba]
更新:

\genfrac [ ] {0pt}{0}{a}{b}

[ a b ] \genfrac [ ] {0pt}{0}{a}{b} [ba]

更新后的公式:

\begin{equation}
    \genfrac [ ] {0pt}{0}{\mathbf{S}^{t_1}}{\mathbf{W}^{t_1}} = \genfrac [ ] {0pt}{0}{\mathbf{S}^{t_0}}{\mathbf{W}^{t_0}} + \int^{t_1}_{t_0} g\left( \genfrac [ ] {0pt}{0}{\mathbf{S}^t}{\mathbf{W}^t}, t \right) dt, 
\end{equation}

[ S t 1 W t 1 ] = [ S t 0 W t 0 ] + ∫ t 0 t 1 g ( [ S t W t ] , t ) d t , \genfrac [ ] {0pt}{0}{\mathbf{S}^{t_1}}{\mathbf{W}^{t_1}} = \genfrac [ ] {0pt}{0}{\mathbf{S}^{t_0}}{\mathbf{W}^{t_0}} + \int^{t_1}_{t_0} g\left( \genfrac [ ] {0pt}{0}{\mathbf{S}^t}{\mathbf{W}^t}, t \right) dt, [Wt1St1]=[Wt0St0]+t0t1g([WtSt],t)dt,

零报错,很舒服!
在这里插入图片描述

参考文献

  1. Stefan Kottwitz. Jun 1, 2011. “Why does amsmath print a warning about a foreign command?”. Retrieved from https://tex.stackexchange.com/questions/19587/why-does-amsmath-print-a-warning-about-a-foreign-command
  2. KaTeX \KaTeX KATEX Supported Functions”. Retrieved from https://katex.org/docs/supported.html#fractions-and-binomials. Accessed on May 26, 2022.
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Xovee

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值