TeXipedia

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.

fmax=sup{f(x):xX}f_{\rm max} = \sup\{f(x) : x \in X\}
f_{\rm max} = \sup\{f(x) : x \in X\}

Displaying physical units in upright font within an equation.

v=299792458m/sv = 299\,792\,458\,{\rm m/s}
v = 299\,792\,458\,{\rm m/s}

Showing chemical compounds with proper upright text formatting.

H2O+2Na2NaOH+H2\rm H_2O + 2\rm Na \rightarrow 2\rm NaOH + \rm H_2
\rm H_2O + 2\rm Na \rightarrow 2\rm NaOH + \rm H_2