我在以下代码中收到“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}