1

I'm getting an "overfull hbox" error on the follow code,..I've tried line breaks in all kinds of places but I can't seem to fix it. Please help!

\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 Answers1

3

Using the following code I got no overfull hbox error.

\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}

Maybe the problem is because your defined margins are shorter with respect to the default margins in the minimal document class.

As Au101 said, you should not use \\ on a equation environment. If you want the equations to be in different lines and numbered, you could use the align (or align* to appear without numbers) environment:

\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}
Mico
  • 506,678
  • No problem! Please remember to close this question. Happy TeXing! – Ignacio Correa Mar 22 '17 at 01:51
  • +1. I've taken the liberty of reformatting the align environment solution to remove the final double-backslash to generate more-natural line breaks in the code. Feel free to revert. – Mico May 09 '17 at 00:26