TeXipedia

mathrm

Formats mathematical text using upright (roman) font style, commonly used for units, constants, and operator names.

Overview

Essential for proper mathematical typography, particularly when writing standardized notation that should not appear in the default italic math style.

  • Used for physical units (e.g., kg, m/s) to follow SI conventions
  • Applied to mathematical operators and named functions
  • Important for chemical formulas and molecular notation
  • Ensures readability of multi-letter identifiers that should be treated as a single entity
  • Commonly employed in scientific and engineering documents to maintain typographical standards

Examples

Using mathrm for chemical compound formulas to ensure proper formatting of subscripts and numbers.

H2O+2Na2NaOH+H2\mathrm{H_2O} + 2\mathrm{Na} \rightarrow 2\mathrm{NaOH} + \mathrm{H_2}
\mathrm{H_2O} + 2\mathrm{Na} \rightarrow 2\mathrm{NaOH} + \mathrm{H_2}

Displaying mathematical constants and standard functions with upright (roman) text.

eiπ+1=0where e=e2.718e^{i\pi} + 1 = 0 \quad \text{where } e = \mathrm{e} \approx 2.718
e^{i\pi} + 1 = 0 \quad \text{where } e = \mathrm{e} \approx 2.718

Labeling physical units in equations using roman type as per scientific convention.

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