![方程中的水平盒子过满,不知道原因是什么?](https://linux22.com/image/351501/%E6%96%B9%E7%A8%8B%E4%B8%AD%E7%9A%84%E6%B0%B4%E5%B9%B3%E7%9B%92%E5%AD%90%E8%BF%87%E6%BB%A1%EF%BC%8C%E4%B8%8D%E7%9F%A5%E9%81%93%E5%8E%9F%E5%9B%A0%E6%98%AF%E4%BB%80%E4%B9%88%EF%BC%9F.png)
我在以下代码中收到“overfull hbox”错误。我尝试在各种地方换行,但似乎无法修复它。请帮忙!
\begin{equation}
\frac{\partial M_u}{\partial z} = E_u - D_u \\
\frac{\partial (M_u s_u)}{\partial z} = E_u \overline{s} - D_u s_u + L_v
\overline{\rho} c_u \\
\frac{\partial (M_u q_u)}{\partial z} = E_u \overline{q} - D_u q_u -
\overline{\rho} c_u \\
\frac{\partial (M_u l)}{\partial z} = - D_u l + \overline{\rho} c_u -
\overline{\rho} G_p \\
\end{equation}
答案1
使用下面的代码我没有得到过满的 hbox 错误。
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{equation}
\frac{\partial M_u}{\partial z} = E_u - D_u \\
\frac{\partial (M_u s_u)}{\partial z} = E_u \overline{s} - D_u s_u + L_v
\overline{\rho} c_u \\
\frac{\partial (M_u q_u)}{\partial z} = E_u \overline{q} - D_u q_u -
\overline{\rho} c_u \\
\frac{\partial (M_u l)}{\partial z} = - D_u l + \overline{\rho} c_u -
\overline{\rho} G_p \\
\end{equation}
\end{document}
也许问题在于您定义的边距相对于minimal
文档类中的默认边距较短。
正如 Au101 所说,您不应该\\
在equation
环境中使用。如果您希望方程式在不同的行中并编号,则可以使用align
(或align*
不带数字出现)环境:
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align}
\frac{\partial M_u}{\partial z}
&= E_u - D_u \\
\frac{\partial (M_u s_u)}{\partial z}
&= E_u \overline{s} - D_u s_u + L_v \overline{\rho} c_u \\
\frac{\partial (M_u q_u)}{\partial z}
&= E_u \overline{q} - D_u q_u - \overline{\rho} c_u \\
\frac{\partial (M_u l)}{\partial z}
&= - D_u l + \overline{\rho} c_u - \overline{\rho} G_p
\end{align}
\end{document}