我是 Latex 新手,在解决无法正确显示的方程式时遇到了麻烦。我尝试在 Latex 中创建的方程式是:
...但是我不断得到从倒数第三项开始的嵌套分数,因此它看起来像:
我使用的代码是:
\begin{equation}
\centering
\frac{\partial UB}{\partial t}+\frac{\partial UUB }{\partial x}+\frac{\partial WUB}{\partial z}=gB\sin\alpha+g\cos\alpha B\frac{\partial \eta}{\partial x}-\frac{g\cos\alpha B}{\rho} \[\int_\eta^z \frac{\partial \rho}{\partial x}dz\]+\frac{1}{\rho}\frac{\partial B\tau_x_x}{\partial x}+\frac{1}{\rho}\frac{\partial B\tau_x_z}{\partial z}+qBU_x
\label{eqn:horizontalmomentum}
\end{equation}
我还遇到了一大堆错误:
答案1
不能\[ ... \]
在数学表达式中使用。使用
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align}\label{eqn:horizontalmomentum}
\begin{aligned}
\frac{\partial UB}{\partial t}+\frac{\partial UUB }{\partial x}
+\frac{\partial WUB}{\partial z} & = gB\sin\alpha
+g\cos\alpha B\frac{\partial \eta}{\partial x}
-\frac{g\cos\alpha B}{\rho} \int_\eta^z \frac{\partial \rho}{\partial x}dz \\
&
+\frac{1}{\rho}\frac{\partial B{\tau_x}_x}{\partial x}
+\frac{1}{\rho}\frac{\partial B{\tau_x}_z}{\partial z}+qBU_x
\end{aligned}
\end{align}
\end{document}