The font type LaTeX uses in math mode is somewhat special since it is optimized for writing mathematical formulas. Letters are printed in italics, with more space left in-between, spaces are ignored. In certain cases it may be desirable to include “normal text” within an equation. There is a simple way to add “normal text” fragments in math mode.
$...\textrm{normal text}...$
Alternatively, using the amsmath package:
\usepackage{amsmath}
$...\text{normal text}...$
Normal text can be added no matter which math mode you are using.
Consider the following descriptive illustration of the fraction notation, first in math mode and below in “normal text”.
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align*}
fraction&=\frac{numerator}{denominator}\\
&\\
\text{fraction}&=\frac{\text{numerator}}{\text{denominator}}
\end{align*}
\end{document}
Taking a closer look at the first two characters of “fraction” in math mode shows that LaTeX assigns them more space, giving the word a somewhat unnatural appearance.
Here is another example where switching to normal text is desirable. Any whitespace is added in “normal text” mode since math mode ignores it.
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\[
f(x) =
\begin{cases}
0 & \text{if $x=0$,}\\
\frac{1}{x} & \text{otherwise.}
\end{cases}
\]
\end{document}
See User Guide for the amsmath Package for more details on the amsmath package.
Addendum
For multi-letter variables in math mode, use \mathit{} to omit whitespace in-between letters. Can you see the difference?
$\mathit{def}$
Thanks for your comment João!



September 24th, 2012 at 9:10 am
Instead of using eqnarray and array you should use the macros from amsmath, align and cases
September 24th, 2012 at 9:23 am
Ouch! My mistake. Thanks for letting me know, appreciate it! It’s fixed. Best, Tom.
September 24th, 2012 at 9:51 am
Space left in-between exists because writing (e.g.)
$var$actually means “v times a times r”. Not knowing this is the source of many ill-looking papers out there, so this could be a great opportunity to show the difference between using$var$and$\mathit{var}$– thus showing how to properly typeset multiletter variables.September 24th, 2012 at 3:47 pm
Hi João,
Thank you for pointing this out. Will add it to the post.
Cheers, Tom.
September 24th, 2012 at 3:29 pm
(Maybe there is no point in avoiding amsmath altogether, but) if you want functionality similar to amsmath’s \text, but without loading amsmath, you can use the solution to this question: http://tex.stackexchange.com/questions/55741/is-it-possible-to-typeset-text-inside-math-without-amsmath
September 24th, 2012 at 3:45 pm
Interesting, thanks for the link. Tom.
September 24th, 2012 at 7:29 pm
Why not using mathrm? Is it producing the same effect of ‘v*a*r’?
September 25th, 2012 at 12:57 am
Hi!
Thanks for the comment.
\mathrmand\textrm(or\textimplemented by the amsmath package) are similar, but not the same. A good discussion about the topic can be found here.Best, Tom.
January 25th, 2013 at 2:41 am
Thanks I like it . Useful, and it works for Beamer
February 10th, 2013 at 3:37 pm
There is another nice discussion on \textnormal{} vs. \textrm{} (and also a little bit of \text{} in the comments} which I believe is very relevant to this post.
http://stefaanlippens.net/textnormal
February 12th, 2013 at 6:33 am
Thanks for the link! Tom.