rm
Switches text to a Roman (upright) font style, traditionally used for non-mathematical text within equations.
Overview
Represents one of the fundamental font-switching commands in traditional LaTeX, though it's considered somewhat outdated in modern usage.
- Historically used to create upright text in mathematical contexts
- Primarily seen in older LaTeX documents and legacy code
- Modern documents prefer \textrm{} or \mathrm{} for better control and compatibility
- Affects all subsequent text in the current group unless explicitly changed
- Part of the basic font-switching family including \it, \bf, and \sf
Examples
Using Roman (upright) text in a mathematical formula to denote a function name.
f_{\rm max} = \sup\{f(x) : x \in X\}
Displaying physical units in upright font within an equation.
v = 299\,792\,458\,{\rm m/s}
Showing chemical compounds with proper upright text formatting.
\rm H_2O + 2\rm Na \rightarrow 2\rm NaOH + \rm H_2