# LaTeX how do I write an equation

• LaTeX
Nusc
Hey, how do I write an equation without the text looking all garbled up:

\begin{equation}
\frac{\partial u}{\partial x} + \frac{\partial w}{\partial z} = 0 with u = v_{x} and w = v_z
\end{equation}

I don't want to use  since I want this eqn centered and numbered but with text immediately following the major expression.

Last edited by a moderator:

Gold Member

possible solutions:
Code:
\begin{equation}
\begin{array}{ccccc}
\frac{\partial u}{\partial x} + \frac{\partial w}{\partial z} = 0 & with & u = v_{x} & and & w = v_z
\end{array}
\end{equation}
Code:
\begin{eqnarray}
\begin{array}{rlcll}
&&\frac{\partial u}{\partial x} + \frac{\partial w}{\partial z} = 0&& \\ \mathrm{with:} & u = v_{x} & \mathrm{and} & w = v_z&
\end{array}
\end{eqnarray}

its the \mathrm{} that changes font in the mathtype and the arrays that let you space things correctly.

Staff Emeritus

Use the \text macro. It is designed specifically for this problem, inserting short amounts of text within math.

\begin{equation}
\frac{\partial u}{\partial x} + \frac{\partial w}{\partial z} = 0
\ \text{with}\ u = v_{x} \ \text{and}\ w = v_z
\end{equation}

$$\frac{\partial u}{\partial x} + \frac{\partial w}{\partial z} = 0 \ \text{with}\ u = v_{x} \ \text{and}\ w = v_z$$

Gold Member

what is that a part of? Because mathematica always puts that in its LaTeX output, but my version of LEd with MikTeX 2.8 doesn't recognize "\text"

Nusc

Thanks for the input guys.

Staff Emeritus