LaTeX how do I write an equation

  • LaTeX
  • Thread starter Nusc
  • Start date
  • #1
753
2
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:

Answers and Replies

  • #2
Hepth
Gold Member
449
39


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.
 
  • #3
D H
Staff Emeritus
Science Advisor
Insights Author
15,415
687


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}

[tex]
\frac{\partial u}{\partial x} + \frac{\partial w}{\partial z} = 0
\ \text{with}\ u = v_{x} \ \text{and}\ w = v_z
[/tex]
 
  • #4
Hepth
Gold Member
449
39


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"
 
  • #5
753
2


Thanks for the input guys.
 
  • #6
D H
Staff Emeritus
Science Advisor
Insights Author
15,415
687


what is that a part of?
\text is provided by the AMS math package, the ReVTeX package, and others.

Because mathematica always puts that in its LaTeX output, but my version of LEd with MikTeX 2.8 doesn't recognize "\text"
As a general rule, always treat autogenerated code as suspect. That autogenerated junk rarely is a good pattern to follow. From the appearance, it looks like mathematica's generated LaTeX code fits that rule quite nicely.
 

Related Threads on LaTeX how do I write an equation

  • Last Post
Replies
3
Views
12K
Replies
11
Views
4K
  • Last Post
Replies
7
Views
1K
  • Last Post
Replies
2
Views
3K
  • Last Post
Replies
1
Views
69K
Replies
2
Views
6K
Replies
6
Views
5K
Replies
2
Views
1K
  • Last Post
Replies
13
Views
5K
Replies
1
Views
1K
Top