Math & Science ⇒ Text in formulas
Text in formulas
Is there any way to put actual text inside a mathematical formula? I'm writing some review notes for my students, and I wanted to make a fraction expressing that probability was \frac{number of successful outcomes}{number of total outcomes}.
NEW: TikZ book now 40% off at Amazon.com for a short time.

-
- Posts: 707
- Joined: Tue Mar 25, 2008 5:02 pm
Text in formulas
The \mbox command works in many cases:
However, this will produce text that's the same size as body text, which may or may not be what you want (especially if the text is used in a super- or subscript).
The amstext package (included automatically by the amsmath package) defines the \text command, which serves the same purpose but gets the sizing right:
Code: Select all
\[ \frac{\mbox{number of successful outcomes}}{\mbox{number of total outcomes}} \]
The amstext package (included automatically by the amsmath package) defines the \text command, which serves the same purpose but gets the sizing right:
Code: Select all
\usepackage{amstext}
\[ \frac{\text{number of successful outcomes}}{\text{number of total outcomes}} \]